Changeset 12279 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2017-05-30T15:12:36+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AboutAction.java
r10713 r12279 110 110 111 111 GuiHelper.prepareResizeableOptionPane(panel, panel.getPreferredSize()); 112 int ret = new ExtendedDialog(Main.parent, tr("About JOSM..."), new String[] {tr("OK"), tr("Report bug")})113 .setButtonIcons( new String[] {"ok", "bug"})112 int ret = new ExtendedDialog(Main.parent, tr("About JOSM..."), tr("OK"), tr("Report bug")) 113 .setButtonIcons("ok", "bug") 114 114 .setContent(panel, false) 115 115 .showDialog().getValue(); -
trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java
r11885 r12279 114 114 return targetLayers[0]; 115 115 } 116 ExtendedDialog ed = new ExtendedDialog(Main.parent, title, new String[] {buttonText, tr("Cancel")});117 ed.setButtonIcons( new String[] {buttonIcon, "cancel"});116 ExtendedDialog ed = new ExtendedDialog(Main.parent, title, buttonText, tr("Cancel")); 117 ed.setButtonIcons(buttonIcon, "cancel"); 118 118 ed.setContent(pnl); 119 119 ed.showDialog(); -
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r11657 r12279 49 49 static class SelectWmsLayersDialog extends ExtendedDialog { 50 50 SelectWmsLayersDialog(WMSLayerTree tree, JComboBox<String> formats) { 51 super(Main.parent, tr("Select WMS layers"), new String[]{tr("Add layers"), tr("Cancel")});51 super(Main.parent, tr("Select WMS layers"), tr("Add layers"), tr("Cancel")); 52 52 final JScrollPane scrollPane = new JScrollPane(tree.getLayerTree()); 53 53 scrollPane.setPreferredSize(new Dimension(400, 400)); -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r11553 r12279 61 61 62 62 protected static boolean confirmChangeDirectionOfWays() { 63 ExtendedDialog ed =new ExtendedDialog(Main.parent,63 return new ExtendedDialog(Main.parent, 64 64 tr("Change directions?"), 65 new String[] {tr("Reverse and Combine"), tr("Cancel")});66 ed.setButtonIcons(new String[] {"wayflip", "cancel"});67 ed.setContent(tr("The ways can not be combined in their current directions. "68 + "Do you want to reverse some of them?")) ;69 ed.toggleEnable("combineway-reverse");70 ed.showDialog();71 return ed.getValue() == 1;65 tr("Reverse and Combine"), tr("Cancel")) 66 .setButtonIcons("wayflip", "cancel") 67 .setContent(tr("The ways can not be combined in their current directions. " 68 + "Do you want to reverse some of them?")) 69 .toggleEnable("combineway-reverse") 70 .showDialog() 71 .getValue() == 1; 72 72 } 73 73 -
trunk/src/org/openstreetmap/josm/actions/HistoryInfoAction.java
r10383 r12279 58 58 */ 59 59 public HistoryObjectIDDialog() { 60 super(Main.parent, tr("Show history"), new String[]{tr("Show history"), tr("Cancel")});61 setButtonIcons( new String[]{"dialogs/history", "cancel"});60 super(Main.parent, tr("Show history"), tr("Show history"), tr("Cancel")); 61 setButtonIcons("dialogs/history", "cancel"); 62 62 init(); 63 63 } -
trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
r12093 r12279 217 217 new String[] {tr("OK"), tr("Cancel")}, 218 218 false); 219 setButtonIcons( new String[] {"ok", "cancel"});219 setButtonIcons("ok", "cancel"); 220 220 contentInsets = new Insets(10, 15, 5, 15); 221 221 JPanel pnl = new JPanel(new GridBagLayout()); … … 294 294 Main.parent, 295 295 tr("Overwrite"), 296 new String[] {tr("Overwrite"), tr("Cancel")}296 tr("Overwrite"), tr("Cancel") 297 297 ) { { 298 298 contentInsets = new Insets(10, 15, 10, 15); 299 299 } }; 300 300 dialog.setContent(tr("Offset bookmark already exists. Overwrite?")); 301 dialog.setButtonIcons( new String[] {"ok.png", "cancel.png"});301 dialog.setButtonIcons("ok", "cancel"); 302 302 dialog.setupDialog(); 303 303 dialog.setVisible(true); -
trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java
r10604 r12279 162 162 ExtendedDialog diag = new ExtendedDialog(Main.parent, 163 163 tr("Add Rectified Image"), 164 165 new String[] {tr("Add Rectified Image"), tr("Cancel")}); 166 diag.setContent(panel); 167 diag.setButtonIcons(new String[] {"OLmarker", "cancel"}); 164 tr("Add Rectified Image"), tr("Cancel")) 165 .setContent(panel) 166 .setButtonIcons("OLmarker", "cancel"); 168 167 169 168 // This repeatedly shows the dialog in case there has been an error. -
trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
r11986 r12279 65 65 WhichTasksToPerformDialog(JList<DownloadTask> list) { 66 66 super(Main.parent, tr("Which tasks to perform?"), new String[]{tr("Ok"), tr("Cancel")}, true); 67 setButtonIcons( new String[]{"ok", "cancel"});67 setButtonIcons("ok", "cancel"); 68 68 final JPanel pane = new JPanel(new GridLayout(2, 1)); 69 69 pane.add(new JLabel(tr("Which tasks to perform?"))); … … 138 138 ExtendedDialog dialog = new ExtendedDialog(Main.parent, 139 139 tr("Download Location"), 140 new String[] {tr("Download URL"), tr("Cancel")} 141 ); 142 dialog.setContent(all, false /* don't embedded content in JScrollpane */); 143 dialog.setButtonIcons(new String[] {"download", "cancel"}); 144 dialog.setToolTipTexts(new String[] { 140 tr("Download URL"), tr("Cancel")) 141 .setContent(all, false /* don't embedded content in JScrollpane */) 142 .setButtonIcons("download", "cancel") 143 .setToolTipTexts( 145 144 tr("Start downloading data"), 146 tr("Close dialog and cancel downloading") 147 }); 148 dialog.configureContextsensitiveHelp("/Action/OpenLocation", true /* show help button */); 149 dialog.showDialog(); 150 if (dialog.getValue() == 1) { 145 tr("Close dialog and cancel downloading")) 146 .configureContextsensitiveHelp("/Action/OpenLocation", true /* show help button */); 147 if (dialog.showDialog().getValue() == 1) { 151 148 USE_NEW_LAYER.put(layer.isSelected()); 152 149 remindUploadAddressHistory(uploadAddresses); -
trunk/src/org/openstreetmap/josm/actions/SaveAction.java
r8510 r12279 47 47 Main.parent, 48 48 tr("Overwrite"), 49 new String[] {tr("Overwrite"), tr("Cancel")} 50 ); 51 dialog.setButtonIcons(new String[] {"save_as", "cancel"}); 52 dialog.setContent(tr("File {0} exists. Overwrite?", f.getName())); 53 dialog.showDialog(); 54 int ret = dialog.getValue(); 55 if (ret != 1) { 49 tr("Overwrite"), tr("Cancel")) 50 .setButtonIcons("save_as", "cancel") 51 .setContent(tr("File {0} exists. Overwrite?", f.getName())); 52 if (dialog.showDialog().getValue() != 1) { 56 53 f = null; 57 54 } -
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r10407 r12279 207 207 public static boolean confirmOverwrite(File file) { 208 208 if (file == null || file.exists()) { 209 ExtendedDialog dialog =new ExtendedDialog(209 return new ExtendedDialog( 210 210 Main.parent, 211 211 tr("Overwrite"), 212 new String[] {tr("Overwrite"), tr("Cancel")} 213 ); 214 dialog.setContent(tr("File exists. Overwrite?")); 215 dialog.setButtonIcons(new String[] {"save_as", "cancel"}); 216 dialog.showDialog(); 217 return dialog.getValue() == 1; 212 tr("Overwrite"), tr("Cancel")) 213 .setContent(tr("File exists. Overwrite?")) 214 .setButtonIcons("save_as", "cancel") 215 .showDialog() 216 .getValue() == 1; 218 217 } 219 218 return true; -
trunk/src/org/openstreetmap/josm/actions/SearchNotesDownloadAction.java
r11889 r12279 53 53 contentPanel.add(searchTermBox, gc); 54 54 55 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Search for notes"), 56 new String[] {tr("Search for notes"), tr("Cancel")}); 57 ed.setContent(contentPanel); 58 ed.setButtonIcons(new String[] {"note_search", "cancel"}); 59 ed.showDialog(); 60 if (ed.getValue() != 1) { 55 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Search for notes"), tr("Search for notes"), tr("Cancel")) 56 .setContent(contentPanel) 57 .setButtonIcons("note_search", "cancel"); 58 if (ed.showDialog().getValue() != 1) { 61 59 return; 62 60 } … … 64 62 String searchTerm = Optional.ofNullable(searchTermBox.getText()).orElse("").trim(); 65 63 if (searchTerm.isEmpty()) { 66 Notification notification = new Notification(tr("You must enter a search term"));67 notification.setIcon(JOptionPane.WARNING_MESSAGE);68 notification.show();64 new Notification(tr("You must enter a search term")) 65 .setIcon(JOptionPane.WARNING_MESSAGE) 66 .show(); 69 67 return; 70 68 } -
trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
r11848 r12279 118 118 fc = createAndOpenFileChooser(false, false, tr("Save session"), joz, JFileChooser.FILES_ONLY, "lastDirectory"); 119 119 } else { 120 fc = createAndOpenFileChooser(false, false, tr("Save session"), Arrays.asList( new FileFilter[]{jos, joz}), jos,120 fc = createAndOpenFileChooser(false, false, tr("Save session"), Arrays.asList(jos, joz), jos, 121 121 JFileChooser.FILES_ONLY, "lastDirectory"); 122 122 } … … 188 188 */ 189 189 public SessionSaveAsDialog() { 190 super(Main.parent, tr("Save Session"), new String[] {tr("Save As"), tr("Cancel")});190 super(Main.parent, tr("Save Session"), tr("Save As"), tr("Cancel")); 191 191 initialize(); 192 setButtonIcons( new String[] {"save_as", "cancel"});192 setButtonIcons("save_as", "cancel"); 193 193 setDefaultButton(1); 194 194 setRememberWindowGeometry(getClass().getName() + ".geometry", -
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r12217 r12279 291 291 ExtendedDialog ed = new ExtendedDialog(Main.parent, 292 292 tr("Status Report"), 293 new String[] {tr("Copy to clipboard and close"), tr("Report bug"), tr("Close") });294 ed.setButtonIcons( new String[] {"copy", "bug", "cancel" });293 tr("Copy to clipboard and close"), tr("Report bug"), tr("Close")); 294 ed.setButtonIcons("copy", "bug", "cancel"); 295 295 ed.setContent(ta, false); 296 296 ed.setMinimumSize(new Dimension(380, 200)); -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r12031 r12279 243 243 configureList(); 244 244 245 setButtonIcons( new String[]{"ok", "cancel"});245 setButtonIcons("ok", "cancel"); 246 246 final JPanel pane = new JPanel(new GridBagLayout()); 247 247 pane.add(new JLabel(getTitle()), GBC.eol().fill(GBC.HORIZONTAL)); -
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r12031 r12279 206 206 207 207 private PropertiesMembershipDialog(boolean preselectNew, boolean queryTags, boolean queryMemberships) { 208 super(Main.parent, tr("Tags / Memberships"), new String[]{tr("Unglue"), tr("Cancel")});209 setButtonIcons( new String[]{"unglueways", "cancel"});208 super(Main.parent, tr("Tags / Memberships"), tr("Unglue"), tr("Cancel")); 209 setButtonIcons("unglueways", "cancel"); 210 210 211 211 final JPanel content = new JPanel(new GridBagLayout()); -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r12065 r12279 869 869 super(Main.parent, 870 870 tr("Move elements"), 871 new String[]{tr("Move them"), tr("Undo move")});872 setButtonIcons( new String[]{"reorder", "cancel"});871 tr("Move them"), tr("Undo move")); 872 setButtonIcons("reorder", "cancel"); 873 873 setCancelButton(2); 874 874 } -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r11986 r12279 340 340 Main.parent, 341 341 initialValues instanceof Filter ? tr("Filter") : tr("Search"), 342 new String[] { 343 initialValues instanceof Filter ? tr("Submit filter") : tr("Start Search"), 344 tr("Cancel")} 342 initialValues instanceof Filter ? tr("Submit filter") : tr("Start Search"), 343 tr("Cancel") 345 344 ) { 346 345 @Override … … 368 367 } 369 368 }; 370 dialog.setButtonIcons( new String[] {"dialogs/search", "cancel"});369 dialog.setButtonIcons("dialogs/search", "cancel"); 371 370 dialog.configureContextsensitiveHelp("/Action/Search", true /* show help button */); 372 371 dialog.setContent(p); 373 dialog.showDialog(); 374 int result = dialog.getValue(); 375 376 if (result != 1) return null; 372 373 if (dialog.showDialog().getValue() != 1) return null; 377 374 378 375 // User pressed OK - let's perform the search -
trunk/src/org/openstreetmap/josm/actions/upload/RelationUploadOrderHook.java
r9543 r12279 80 80 Main.parent, 81 81 tr("Cycling dependencies"), 82 new String[] {tr("OK")}82 tr("OK") 83 83 ); 84 84 dialog.setContent(pnl, false /* don't embed in scroll pane */); 85 dialog.setButtonIcons( new String[] {"ok"});85 dialog.setButtonIcons("ok"); 86 86 dialog.setRememberWindowGeometry( 87 87 getClass().getName() + ".geometry", -
trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
r12212 r12279 141 141 ExtendedDialog ed = new ExtendedDialog(Main.parent, 142 142 tr("Suspicious data found. Upload anyway?"), 143 new String[] {tr("Continue upload"), tr("Cancel")}); 144 ed.setButtonIcons(new String[] {"ok.png", "cancel.png"}); 145 ed.setContent(p); 146 ed.showDialog(); 143 tr("Continue upload"), tr("Cancel")) 144 .setButtonIcons("ok", "cancel") 145 .setContent(p); 147 146 148 if (ed. getValue() != 1) {147 if (ed.showDialog().getValue() != 1) { 149 148 OsmValidator.initializeTests(); 150 149 OsmValidator.initializeErrorLayer();
Note:
See TracChangeset
for help on using the changeset viewer.