Changeset 12279 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2017-05-30T15:12:36+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r12273 r12279 545 545 Main.parent, 546 546 tr("Unsaved osm data"), 547 new String[] {tr("Restore"), tr("Cancel"), tr("Discard")}547 tr("Restore"), tr("Cancel"), tr("Discard") 548 548 ); 549 549 dialog.setContent( … … 551 551 "JOSM found {0} unsaved osm data layers. ", unsavedLayerFiles.size(), unsavedLayerFiles.size()) + 552 552 tr("It looks like JOSM crashed last time. Would you like to restore the data?")); 553 dialog.setButtonIcons( new String[] {"ok", "cancel", "dialogs/delete"});553 dialog.setButtonIcons("ok", "cancel", "dialogs/delete"); 554 554 int selection = dialog.showDialog().getValue(); 555 555 if (selection == 1) { … … 567 567 ExtendedDialog ed = new ExtendedDialog( 568 568 Main.parent, title, 569 new String[]{tr("Change proxy settings"), tr("Cancel")});570 ed.setButtonIcons( new String[]{"dialogs/settings", "cancel"}).setCancelButton(2);569 tr("Change proxy settings"), tr("Cancel")); 570 ed.setButtonIcons("dialogs/settings", "cancel").setCancelButton(2); 571 571 ed.setMinimumSize(new Dimension(460, 260)); 572 572 ed.setIcon(JOptionPane.WARNING_MESSAGE); -
trunk/src/org/openstreetmap/josm/gui/NoteInputDialog.java
r9078 r12279 32 32 */ 33 33 public NoteInputDialog(Component parent, String title, String buttonText) { 34 super(parent, title, new String[] {buttonText, tr("Cancel")});34 super(parent, title, buttonText, tr("Cancel")); 35 35 } 36 36 … … 56 56 contentPanel.add(scrollPane); 57 57 setContent(contentPanel, false); 58 setButtonIcons( new Icon[] {icon, ImageProvider.get("cancel.png")});58 setButtonIcons(icon, ImageProvider.get("cancel.png")); 59 59 60 60 showDialog(); … … 67 67 return textArea.getText(); 68 68 } 69 70 69 } -
trunk/src/org/openstreetmap/josm/gui/NoteSortDialog.java
r11821 r12279 33 33 */ 34 34 public NoteSortDialog(Component parent, String title, String buttonText) { 35 super(parent, title, new String[] {buttonText, tr("Cancel")});35 super(parent, title, buttonText, tr("Cancel")); 36 36 } 37 37 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairType.java
r11879 r12279 17 17 * compare my version of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with their version 18 18 */ 19 MY_WITH_THEIR(tr("My with Their"), new ListRole[] {MY_ENTRIES, THEIR_ENTRIES}),19 MY_WITH_THEIR(tr("My with Their"), MY_ENTRIES, THEIR_ENTRIES), 20 20 21 21 /** 22 22 * compare my version of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with the merged version 23 23 */ 24 MY_WITH_MERGED(tr("My with Merged"), new ListRole[] {MY_ENTRIES, MERGED_ENTRIES}),24 MY_WITH_MERGED(tr("My with Merged"), MY_ENTRIES, MERGED_ENTRIES), 25 25 26 26 /** 27 27 * compare their version of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with the merged veresion 28 28 */ 29 THEIR_WITH_MERGED(tr("Their with Merged"), new ListRole[] {THEIR_ENTRIES, MERGED_ENTRIES});29 THEIR_WITH_MERGED(tr("Their with Merged"), THEIR_ENTRIES, MERGED_ENTRIES); 30 30 31 31 /** the localized display name */ -
trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/PrimitiveDataPaster.java
r11746 r12279 136 136 private static boolean confirmDeleteIncomplete() { 137 137 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Delete incomplete members?"), 138 new String[] {tr("Paste without incomplete members"), tr("Cancel")});139 ed.setButtonIcons( new String[] {"dialogs/relation/deletemembers", "cancel"});138 tr("Paste without incomplete members"), tr("Cancel")); 139 ed.setButtonIcons("dialogs/relation/deletemembers", "cancel"); 140 140 ed.setContent(tr( 141 141 "The copied data contains incomplete objects. " + "When pasting the incomplete objects are removed. " -
trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
r11747 r12279 211 211 lstInActiveDataLayer.addMouseListener(popupMenuLauncher); 212 212 213 createLayout(pnl, false, Arrays.asList( new SideButton[] {213 createLayout(pnl, false, Arrays.asList( 214 214 new SideButton(selectObjectsAction, false), 215 215 new SideButton(readChangesetAction, false), … … 217 217 new SideButton(showChangesetInfoAction, false), 218 218 new SideButton(new LaunchChangesetManagerAction(), false) 219 }));219 )); 220 220 } 221 221 -
trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
r10788 r12279 127 127 wireUpdateEnabledStateUpdater(redoAction, redoTree); 128 128 129 scrollPane = (JScrollPane) createLayout(treesPanel, true, Arrays.asList( new SideButton[] {129 scrollPane = (JScrollPane) createLayout(treesPanel, true, Arrays.asList( 130 130 new SideButton(selectAction), 131 131 new SideButton(undoAction), 132 132 new SideButton(redoAction) 133 }));133 )); 134 134 135 135 InputMapUtils.addEnterAction(undoTree, selectAndZoomAction); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r12178 r12279 135 135 addListSelectionListener(actSelect); 136 136 137 createLayout(lstConflicts, true, Arrays.asList(new SideButton[] { 138 btnResolve, btnSelect 139 })); 137 createLayout(lstConflicts, true, Arrays.asList(btnResolve, btnSelect)); 140 138 141 139 popupMenuHandler.addAction(Main.main.menu.autoScaleActions.get("conflict")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
r12046 r12279 45 45 public ConflictResolutionDialog(Component parent) { 46 46 // We define our own actions, but need to give a hint about number of buttons 47 super(parent, tr("Resolve conflicts"), n ew String[] {null, null, null});47 super(parent, tr("Resolve conflicts"), null, null, null); 48 48 setDefaultButton(1); 49 49 setCancelButton(2); -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
r11993 r12279 239 239 }); 240 240 241 createLayout(userTable, true, Arrays.asList( new SideButton[] {241 createLayout(userTable, true, Arrays.asList( 242 242 addButton, editButton, deleteButton, upButton, downButton 243 }));243 )); 244 244 } 245 245 -
trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
r11452 r12279 62 62 */ 63 63 public InspectPrimitiveDialog(final Collection<OsmPrimitive> primitives, OsmDataLayer layer) { 64 super(Main.parent, tr("Advanced object info"), new String[] {tr("Close")});64 super(Main.parent, tr("Advanced object info"), tr("Close")); 65 65 this.primitives = new ArrayList<>(primitives); 66 66 this.layer = layer; … … 68 68 WindowGeometry.centerInWindow(Main.parent, new Dimension(750, 550))); 69 69 70 setButtonIcons( new String[]{"ok.png"});70 setButtonIcons("ok"); 71 71 final JTabbedPane tabs = new JTabbedPane(); 72 72 -
trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
r11653 r12279 156 156 157 157 public LatLonDialog(Component parent, String title, String help) { 158 super(parent, title, new String[] {tr("Ok"), tr("Cancel")});159 setButtonIcons( new String[] {"ok", "cancel"});158 super(parent, title, tr("Ok"), tr("Cancel")); 159 setButtonIcons("ok", "cancel"); 160 160 configureContextsensitiveHelp(help, true); 161 161 -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java
r10793 r12279 51 51 ExtendedDialog ed = new ExtendedDialog( 52 52 Main.parent, tr("Information about layer"), 53 new String[] {tr("OK")});54 ed.setButtonIcons( new String[] {"ok"});53 tr("OK")); 54 ed.setButtonIcons("ok"); 55 55 ed.setIcon(JOptionPane.INFORMATION_MESSAGE); 56 56 ed.setContent((Component) object); -
trunk/src/org/openstreetmap/josm/gui/dialogs/LogShowDialog.java
r8510 r12279 30 30 */ 31 31 public LogShowDialog(String title, String msg, String log) { 32 super(Main.parent, title, new String[] {tr("OK")});33 setButtonIcons( new String[] {"ok.png"});32 super(Main.parent, title, tr("OK")); 33 setButtonIcons("ok"); 34 34 setContent(build(msg, log)); 35 35 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
r11881 r12279 535 535 return; 536 536 final StyleSource s = model.getRow(sel); 537 ExtendedDialog info = new ExtendedDialog(Main.parent, tr("Map Style info"), new String[] {tr("Close")});537 ExtendedDialog info = new ExtendedDialog(Main.parent, tr("Map Style info"), tr("Close")); 538 538 info.setPreferredSize(new Dimension(600, 400)); 539 info.setButtonIcons( new String[] {"ok.png"});539 info.setButtonIcons("ok"); 540 540 541 541 final JTabbedPane tabs = new JTabbedPane(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/MenuItemSearchDialog.java
r11496 r12279 27 27 28 28 private MenuItemSearchDialog(MainMenu menu) { 29 super(Main.parent, tr("Search menu items"), new String[]{tr("Select"), tr("Cancel")});29 super(Main.parent, tr("Search menu items"), tr("Select"), tr("Cancel")); 30 30 this.selector = new Selector(menu); 31 31 this.selector.setDblClickListener(e -> buttonAction(0, null)); -
trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java
r11713 r12279 107 107 pane.add(new JScrollPane(displayList), BorderLayout.CENTER); 108 108 109 createLayout(pane, false, Arrays.asList( new SideButton[]{109 createLayout(pane, false, Arrays.asList( 110 110 new SideButton(downloadNotesInViewAction, false), 111 111 new SideButton(newAction, false), … … 115 115 new SideButton(sortAction, false), 116 116 new SideButton(openInBrowserAction, false), 117 new SideButton(uploadAction, false) }));117 new SideButton(uploadAction, false))); 118 118 updateButtonStates(); 119 119 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r11610 r12279 163 163 recentRelationsAction = new RecentRelationsAction(editButton); 164 164 165 createLayout(pane, false, Arrays.asList( new SideButton[]{165 createLayout(pane, false, Arrays.asList( 166 166 new SideButton(newAction, false), 167 167 editButton, … … 169 169 new SideButton(deleteRelationsAction, false), 170 170 new SideButton(selectRelationAction, false) 171 }));171 )); 172 172 173 173 InputMapUtils.unassignCtrlShiftUpDown(displaylist, JComponent.WHEN_FOCUSED); -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r11680 r12279 132 132 searchButton.createArrow(e -> SearchPopupMenu.launch(searchButton)); 133 133 134 createLayout(lstPrimitives, true, Arrays.asList( new SideButton[] {134 createLayout(lstPrimitives, true, Arrays.asList( 135 135 selectButton, searchButton, new SideButton(actShowHistory) 136 }));136 )); 137 137 } 138 138 -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r12101 r12279 97 97 userTable.getSelectionModel().addListSelectionListener(showUserInfoAction); 98 98 99 createLayout(userTable, true, Arrays.asList( new SideButton[] {99 createLayout(userTable, true, Arrays.asList( 100 100 new SideButton(selectionUsersPrimitivesAction), 101 101 new SideButton(showUserInfoAction) 102 }));102 )); 103 103 } 104 104 -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r11764 r12279 1014 1014 ExtendedDialog ed = new ExtendedDialog(Main.parent, 1015 1015 tr("Change relation"), 1016 new String[] {tr("Delete from relation"), tr("Cancel")});1017 ed.setButtonIcons( new String[] {"dialogs/delete", "cancel"});1016 tr("Delete from relation"), tr("Cancel")); 1017 ed.setButtonIcons("dialogs/delete", "cancel"); 1018 1018 ed.setContent(tr("Really delete selection from relation {0}?", cur.getDisplayName(DefaultNameFormatter.getInstance()))); 1019 1019 ed.toggleEnable(DELETE_FROM_RELATION_PREF); 1020 ed.showDialog(); 1021 1022 if (ed.getValue() != 1) 1020 1021 if (ed.showDialog().getValue() != 1) 1023 1022 return; 1024 1023 -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r11945 r12279 376 376 */ 377 377 private static boolean warnOverwriteKey(String action, String togglePref) { 378 ExtendedDialog ed =new ExtendedDialog(378 return new ExtendedDialog( 379 379 Main.parent, 380 380 tr("Overwrite key"), 381 new String[]{tr("Replace"), tr("Cancel")}); 382 ed.setButtonIcons(new String[]{"purge", "cancel"}); 383 ed.setContent(action+'\n'+ tr("The new key is already used, overwrite values?")); 384 ed.setCancelButton(2); 385 ed.toggleEnable(togglePref); 386 ed.showDialog(); 387 388 return ed.getValue() == 1; 381 tr("Replace"), tr("Cancel")) 382 .setButtonIcons("purge", "cancel") 383 .setContent(action+'\n'+ tr("The new key is already used, overwrite values?")) 384 .setCancelButton(2) 385 .toggleEnable(togglePref) 386 .showDialog().getValue() == 1; 389 387 } 390 388 … … 416 414 417 415 protected EditTagDialog(String key, Map<String, Integer> map, final boolean initialFocusOnKey) { 418 super(Main.parent, trn("Change value?", "Change values?", map.size()), new String[] {tr("OK"), tr("Cancel")});419 setButtonIcons( new String[] {"ok", "cancel"});416 super(Main.parent, trn("Change value?", "Change values?", map.size()), tr("OK"), tr("Cancel")); 417 setButtonIcons("ok", "cancel"); 420 418 setCancelButton(2); 421 419 configureContextsensitiveHelp("/Dialog/EditValue", true /* show help button */); … … 679 677 680 678 protected AddTagsDialog() { 681 super(Main.parent, tr("Add value?"), new String[] {tr("OK"), tr("Cancel")});682 setButtonIcons( new String[] {"ok", "cancel"});679 super(Main.parent, tr("Add value?"), tr("OK"), tr("Cancel")); 680 setButtonIcons("ok", "cancel"); 683 681 setCancelButton(2); 684 682 configureContextsensitiveHelp("/Dialog/AddValue", true /* show help button */); -
trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java
r10611 r12279 40 40 */ 41 41 public DownloadObjectDialog(Component parent) { 42 super(parent, tr("Download object"), new String[]{tr("Download object"), tr("Cancel")});42 super(parent, tr("Download object"), tr("Download object"), tr("Cancel")); 43 43 init(); 44 setButtonIcons( new String[]{"download", "cancel"});45 setToolTipTexts( new String[]{44 setButtonIcons("download", "cancel"); 45 setToolTipTexts( 46 46 tr("Start downloading"), 47 47 tr("Close dialog and cancel downloading") 48 });48 ); 49 49 configureContextsensitiveHelp("/Action/DownloadObject", true /* show help button */); 50 50 } -
trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java
r10621 r12279 218 218 Main.parent, 219 219 title, 220 new String[] {tr("Ok")})221 .setButtonIcons( new String[] {"ok"})220 tr("Ok")) 221 .setButtonIcons("ok") 222 222 .setIcon(msgType) 223 223 .setContent(p, false); -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r12170 r12279 429 429 Tile clickedTile = clickedTileHolder.getTile(); 430 430 if (clickedTile != null) { 431 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Tile Info"), new String[]{tr("OK")});431 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Tile Info"), tr("OK")); 432 432 JPanel panel = new JPanel(new GridBagLayout()); 433 433 Rectangle2D displaySize = coordinateConverter.getRectangleForTile(clickedTile); -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r12176 r12279 659 659 @Override public Action[] getMenuEntries() { 660 660 List<Action> actions = new ArrayList<>(); 661 actions.addAll(Arrays.asList( new Action[]{661 actions.addAll(Arrays.asList( 662 662 LayerListDialog.getInstance().createActivateLayerAction(this), 663 663 LayerListDialog.getInstance().createShowHideLayerAction(), … … 667 667 LayerListDialog.getInstance().createDuplicateLayerAction(this), 668 668 new LayerSaveAction(this), 669 new LayerSaveAsAction(this), 670 })); 669 new LayerSaveAsAction(this))); 671 670 if (ExpertToggleAction.isExpert()) { 672 actions.addAll(Arrays.asList( new Action[]{671 actions.addAll(Arrays.asList( 673 672 new LayerGpxExportAction(this), 674 new ConvertToGpxLayerAction() }));675 } 676 actions.addAll(Arrays.asList( new Action[]{673 new ConvertToGpxLayerAction())); 674 } 675 actions.addAll(Arrays.asList( 677 676 SeparatorLayerAction.INSTANCE, 678 new RenameLayerAction(getAssociatedFile(), this) }));677 new RenameLayerAction(getAssociatedFile(), this))); 679 678 if (ExpertToggleAction.isExpert()) { 680 679 actions.add(new ToggleUploadDiscouragedLayerAction(this)); 681 680 } 682 actions.addAll(Arrays.asList( new Action[]{681 actions.addAll(Arrays.asList( 683 682 new ConsistencyTestAction(), 684 683 SeparatorLayerAction.INSTANCE, 685 new LayerListPopup.InfoAction(this) }));684 new LayerListPopup.InfoAction(this))); 686 685 return actions.toArray(new Action[actions.size()]); 687 686 } … … 1054 1053 return 2; 1055 1054 } 1056 ExtendedDialog dialog =new ExtendedDialog(1055 return new ExtendedDialog( 1057 1056 Main.parent, 1058 1057 tr("Empty document"), 1059 new String[] {tr("Save anyway"), tr("Cancel")} 1060 ); 1061 dialog.setContent(tr("The document contains no data.")); 1062 dialog.setButtonIcons(new String[] {"save", "cancel"}); 1063 return dialog.showDialog().getValue(); 1058 tr("Save anyway"), tr("Cancel")) 1059 .setContent(tr("The document contains no data.")) 1060 .setButtonIcons("save", "cancel") 1061 .showDialog().getValue(); 1064 1062 })) { 1065 1063 return false; … … 1068 1066 ConflictCollection conflictsCol = getConflicts(); 1069 1067 return conflictsCol == null || conflictsCol.isEmpty() || 1 == GuiHelper.runInEDTAndWaitAndReturn(() -> { 1070 ExtendedDialog dialog =new ExtendedDialog(1068 return new ExtendedDialog( 1071 1069 Main.parent, 1072 1070 /* I18N: Display title of the window showing conflicts */ 1073 1071 tr("Conflicts"), 1074 new String[] {tr("Reject Conflicts and Save"), tr("Cancel")} 1075 ); 1076 dialog.setContent( 1077 tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?")); 1078 dialog.setButtonIcons(new String[] {"save", "cancel"}); 1079 return dialog.showDialog().getValue(); 1072 tr("Reject Conflicts and Save"), tr("Cancel")) 1073 .setContent( 1074 tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?")) 1075 .setButtonIcons("save", "cancel") 1076 .showDialog().getValue(); 1080 1077 }); 1081 1078 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r11914 r12279 142 142 Main.parent, 143 143 tr("Correlate images with GPX track"), 144 new String[] {tr("OK"), tr("Try Again")}).144 tr("OK"), tr("Try Again")). 145 145 setContent(tr("No images could be matched!")). 146 setButtonIcons( new String[] {"ok", "dialogs/refresh"}).146 setButtonIcons("ok", "dialogs/refresh"). 147 147 showDialog().getValue() == 2) 148 148 return AGAIN; … … 732 732 ); 733 733 syncDialog.setContent(panelTf, false); 734 syncDialog.setButtonIcons( new String[] {"ok", "cancel"});734 syncDialog.setButtonIcons("ok", "cancel"); 735 735 syncDialog.setupDialog(); 736 736 outerPanel.add(syncDialog.getContentPane(), BorderLayout.PAGE_START); … … 955 955 new ExtendedDialog(Main.parent, 956 956 tr("Adjust timezone and offset"), 957 new String[] {tr("Close")}).958 setContent(p).setButtonIcons( new String[] {"ok"}).showDialog();957 tr("Close")). 958 setContent(p).setButtonIcons("ok").showDialog(); 959 959 } 960 960 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r12131 r12279 719 719 Main.parent, 720 720 tr("Delete image file from disk"), 721 new String[] {tr("Cancel"), tr("Delete")})722 .setButtonIcons( new String[] {"cancel", "dialogs/delete"})721 tr("Cancel"), tr("Delete")) 722 .setButtonIcons("cancel", "dialogs/delete") 723 723 .setContent(new JLabel(tr("<html><h3>Delete the file {0} from disk?<p>The image file will be permanently lost!</h3></html>", 724 724 toDelete.getFile().getName()), ImageProvider.get("dialogs/geoimage/deletefromdisk"), SwingConstants.LEFT)) -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java
r12173 r12279 265 265 // build dialog 266 266 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Set track visibility for {0}", layer.getName()), 267 new String[]{tr("Show all"), tr("Show selected only"), tr("Cancel")});268 ed.setButtonIcons( new String[]{"eye", "dialogs/filter", "cancel"});267 tr("Show all"), tr("Show selected only"), tr("Cancel")); 268 ed.setButtonIcons("eye", "dialogs/filter", "cancel"); 269 269 ed.setContent(msg, false); 270 270 ed.setDefaultButton(2); -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r11848 r12279 44 44 import javax.swing.DefaultListModel; 45 45 import javax.swing.DefaultListSelectionModel; 46 import javax.swing.Icon;47 46 import javax.swing.ImageIcon; 48 47 import javax.swing.JButton; … … 916 915 */ 917 916 public EditSourceEntryDialog(Component parent, String title, SourceEntry e) { 918 super(parent, title, new String[] {tr("Ok"), tr("Cancel")});917 super(parent, title, tr("Ok"), tr("Cancel")); 919 918 920 919 JPanel p = new JPanel(new GridBagLayout()); … … 942 941 p.add(cbActive, GBC.eol().insets(15, 0, 5, 0)); 943 942 } 944 setButtonIcons( new String[] {"ok", "cancel"});943 setButtonIcons("ok", "cancel"); 945 944 setContent(p); 946 945 … … 1191 1190 } 1192 1191 if (!messages.isEmpty()) { 1193 ExtendedDialog dlg = new ExtendedDialog(Main.parent, tr("Warning"), new String[] {tr("Cancel"), tr("Continue anyway")});1194 dlg.setButtonIcons( new Icon[] {1192 ExtendedDialog dlg = new ExtendedDialog(Main.parent, tr("Warning"), tr("Cancel"), tr("Continue anyway")); 1193 dlg.setButtonIcons( 1195 1194 ImageProvider.get("cancel"), 1196 1195 new ImageProvider("ok").setMaxSize(ImageSizes.LARGEICON).addOverlay( 1197 1196 new ImageOverlay(new ImageProvider("warning-small"), 0.5, 0.5, 1.0, 1.0)).get() 1198 });1199 dlg.setToolTipTexts( new String[] {1197 ); 1198 dlg.setToolTipTexts( 1200 1199 tr("Cancel and return to the previous dialog"), 1201 tr("Ignore warning and install style anyway") });1200 tr("Ignore warning and install style anyway")); 1202 1201 dlg.setContent("<html>" + tr("Some entries have unmet dependencies:") + 1203 1202 "<br>" + Utils.join("<br>", messages) + "</html>"); -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AbstractListEditor.java
r9665 r12279 29 29 */ 30 30 public AbstractListEditor(Component parent, String title, PrefEntry entry) { 31 super(parent, title, new String[] {tr("OK"), tr("Cancel")});31 super(parent, title, tr("OK"), tr("Cancel")); 32 32 this.entry = entry; 33 setButtonIcons( new String[] {"ok.png", "cancel.png"});33 setButtonIcons("ok.png", "cancel.png"); 34 34 setRememberWindowGeometry(getClass().getName() + ".geometry", WindowGeometry.centerInWindow(parent, new Dimension(500, 350))); 35 35 } -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java
r10853 r12279 220 220 221 221 private static boolean askAddSetting(JComponent gui, JPanel p) { 222 return new ExtendedDialog(gui, tr("Add setting"), new String[] {tr("OK"), tr("Cancel")})223 .setContent(p).setButtonIcons( new String[] {"ok.png", "cancel.png"}).showDialog().getValue() == 1;222 return new ExtendedDialog(gui, tr("Add setting"), tr("OK"), tr("Cancel")) 223 .setContent(p).setButtonIcons("ok.png", "cancel.png").showDialog().getValue() == 1; 224 224 } 225 225 -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/StringEditor.java
r9759 r12279 30 30 */ 31 31 public StringEditor(final JComponent gui, PrefEntry entry, StringSetting setting) { 32 super(gui, tr("Change string setting"), new String[] {tr("OK"), tr("Cancel")});32 super(gui, tr("Change string setting"), tr("OK"), tr("Cancel")); 33 33 this.entry = entry; 34 setButtonIcons( new String[] {"ok.png", "cancel.png"});34 setButtonIcons("ok", "cancel"); 35 35 setContent(build(setting.getValue() == null ? "" : setting.getValue())); 36 36 } -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryDialog.java
r9665 r12279 22 22 */ 23 23 public AddImageryDialog(Component parent, AddImageryPanel panel) { 24 super(parent, tr("Add Imagery URL"), new String[] {tr("OK"), tr("Cancel")});25 setButtonIcons( new String[] {"ok", "cancel"});24 super(parent, tr("Add Imagery URL"), tr("OK"), tr("Cancel")); 25 setButtonIcons("ok", "cancel"); 26 26 setCancelButton(2); 27 27 configureContextsensitiveHelp("/Dialog/AddImagery", true /* show help button */); -
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
r11746 r12279 266 266 defPL2.description = tr("the main Potlatch 2 style"); 267 267 268 return Arrays.asList( new ExtendedSourceEntry[] {defJosmMapcss, defPL2});268 return Arrays.asList(defJosmMapcss, defPL2); 269 269 } 270 270 -
trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
r11848 r12279 60 60 Main.warn(e, tr("Could not read tagging preset source: {0}", source)); 61 61 ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Error"), 62 new String[] {tr("Yes"), tr("No"), tr("Cancel")});62 tr("Yes"), tr("No"), tr("Cancel")); 63 63 ed.setContent(tr("Could not read tagging preset source: {0}\nDo you want to keep it?", source)); 64 64 switch (ed.showDialog().getValue()) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
r12142 r12279 435 435 contentInsets = new Insets(10, 5, 0, 5); 436 436 if (showNewRelation) { 437 setButtonIcons( new String[] {"ok", "dialogs/addrelation", "cancel" });437 setButtonIcons("ok", "dialogs/addrelation", "cancel"); 438 438 } else { 439 setButtonIcons( new String[] {"ok", "cancel" });439 setButtonIcons("ok", "cancel"); 440 440 } 441 441 setContent(content); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchDialog.java
r10590 r12279 32 32 33 33 private TaggingPresetSearchDialog() { 34 super(Main.parent, tr("Presets"), new String[] {tr("Select"), tr("Cancel")});34 super(Main.parent, tr("Presets"), tr("Select"), tr("Cancel")); 35 35 selector = new TaggingPresetSelector(true, true); 36 36 setContent(selector, false); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchPrimitiveDialog.java
r10590 r12279 66 66 67 67 TaggingPresetSearchPrimitiveDialog() { 68 super(Main.parent, tr("Presets"), new String[] {tr("Search"), tr("Cancel")});68 super(Main.parent, tr("Presets"), tr("Search"), tr("Cancel")); 69 69 selector = new TaggingPresetSelector(false, false); 70 70 setContent(selector, false); … … 86 86 TaggingPreset preset = selector.getSelectedPresetAndUpdateClassification(); 87 87 if (preset != null) { 88 89 88 final Set<OsmPrimitive> matching = new HashSet<>(Main.getLayerManager().getEditDataSet().getPrimitives(preset)); 90 89 Main.getLayerManager().getEditDataSet().setSelected(matching); -
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r11746 r12279 33 33 34 34 import javax.swing.GrayFilter; 35 import javax.swing.Icon;36 35 import javax.swing.ImageIcon; 37 36 import javax.swing.JComponent; … … 197 196 public static boolean warnUser(String title, String content, ImageIcon baseActionIcon, String continueToolTip) { 198 197 ExtendedDialog dlg = new ExtendedDialog(Main.parent, 199 title, new String[] {tr("Cancel"), tr("Continue")});198 title, tr("Cancel"), tr("Continue")); 200 199 dlg.setContent(content); 201 dlg.setButtonIcons( new Icon[] {200 dlg.setButtonIcons( 202 201 new ImageProvider("cancel").setMaxSize(ImageSizes.LARGEICON).get(), 203 202 new ImageProvider("upload").setMaxSize(ImageSizes.LARGEICON).addOverlay( 204 new ImageOverlay(new ImageProvider("warning-small"), 0.5, 0.5, 1.0, 1.0)).get()}); 205 dlg.setToolTipTexts(new String[] { 206 tr("Cancel"), 207 continueToolTip}); 203 new ImageOverlay(new ImageProvider("warning-small"), 0.5, 0.5, 1.0, 1.0)).get()); 204 dlg.setToolTipTexts(tr("Cancel"), continueToolTip); 208 205 dlg.setIcon(JOptionPane.WARNING_MESSAGE); 209 206 dlg.setCancelButton(1); … … 227 224 p.add(sp, GBC.eol().fill(GBC.BOTH)); 228 225 229 ExtendedDialog ed = new ExtendedDialog(parent, title, new String[] {tr("OK")});230 ed.setButtonIcons( new String[] {"ok.png"});226 ExtendedDialog ed = new ExtendedDialog(parent, title, tr("OK")); 227 ed.setButtonIcons("ok"); 231 228 ed.setContent(p); 232 229 ed.showDialog();
Note:
See TracChangeset
for help on using the changeset viewer.