Ignore:
Timestamp:
2009-07-25T23:44:19+02:00 (17 years ago)
Author:
Gubaer
Message:

replaced calls to JOptionPane.* by calls to OptionPaneUtil.*

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java

    r1820 r1847  
    2323import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2424import org.openstreetmap.josm.gui.ExtendedDialog;
     25import org.openstreetmap.josm.gui.OptionPaneUtil;
    2526import org.openstreetmap.josm.gui.layer.GpxLayer;
    2627import org.openstreetmap.josm.gui.layer.Layer;
     
    9091        }
    9192        if (Main.map == null) {
    92             JOptionPane.showMessageDialog(Main.parent, tr("No document open so nothing to save."));
     93            JOptionPane.showMessageDialog(
     94                    Main.parent,
     95                    tr("No document open so nothing to save."),
     96                    tr("Warning"),
     97                    JOptionPane.WARNING_MESSAGE
     98            );
    9399            return false;
    94100        }
     
    128134            dstStream = new FileOutputStream(dst);
    129135        } catch (FileNotFoundException e) {
    130             JOptionPane.showMessageDialog(Main.parent, tr("Could not back up file.")+"\n"+e.getMessage());
     136            OptionPaneUtil.showMessageDialog(
     137                    Main.parent,
     138                    tr("Could not back up file. Exception is: {0}", e.getMessage()),
     139                    tr("Error"),
     140                    JOptionPane.ERROR_MESSAGE
     141            );
    131142            return;
    132143        }
     
    192203                }
    193204            } else {
    194                 JOptionPane.showMessageDialog(Main.parent, tr("Unknown file extension."));
     205                OptionPaneUtil.showMessageDialog(
     206                        Main.parent,
     207                        tr("Unknown file extension for file ''{0}''", file.toString()),
     208                        tr("Error"),
     209                        JOptionPane.ERROR_MESSAGE
     210                );
    195211                return;
    196212            }
     
    198214        } catch (IOException e) {
    199215            e.printStackTrace();
    200             JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while saving.")+"\n"+e.getMessage());
     216            OptionPaneUtil.showMessageDialog(
     217                    Main.parent,
     218                    tr("<html>An error occurred while saving. <br>Error is: <br>{0}</html>", e.getMessage()),
     219                    tr("Error"),
     220                    JOptionPane.ERROR_MESSAGE
     221            );
    201222
    202223            try {
     
    208229            } catch (IOException e2) {
    209230                e2.printStackTrace();
    210                 JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while restoring backup file.")+"\n"+e2.getMessage());
     231                OptionPaneUtil.showMessageDialog(
     232                        Main.parent,
     233                        tr("<html>An error occurred while restoring backup file.<br> Error is: <br>{0}</html>", e2.getMessage()),
     234                        tr("Error"),
     235                        JOptionPane.ERROR_MESSAGE
     236                );
    211237            }
    212238        }
     
    235261                }
    236262            } else {
    237                 JOptionPane.showMessageDialog(Main.parent, tr("Unknown file extension."));
     263                OptionPaneUtil.showMessageDialog(
     264                        Main.parent,
     265                        tr("Unknown file extension."),
     266                        tr("Error"),
     267                        JOptionPane.ERROR_MESSAGE
     268                );
    238269                return;
    239270            }
     
    250281        } catch (IOException e) {
    251282            e.printStackTrace();
    252             JOptionPane.showMessageDialog(Main.parent, tr("An error occurred while restoring backup file.")+"\n"+e.getMessage());
     283            OptionPaneUtil.showMessageDialog(
     284                    Main.parent,
     285                    tr("<html>An error occurred while restoring backup file.<br>Error is:<br>{0}</html>", e.getMessage()),
     286                    tr("Error"),
     287                    JOptionPane.ERROR_MESSAGE
     288            );;
    253289        }
    254290    }
Note: See TracChangeset for help on using the changeset viewer.