Ignore:
Timestamp:
2017-05-30T15:12:36+02:00 (3 years ago)
Author:
Don-vip
Message:

sonar - squid:S3878 - Arrays should not be created for varargs parameters

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
40 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r12273 r12279  
    545545                            Main.parent,
    546546                            tr("Unsaved osm data"),
    547                             new String[] {tr("Restore"), tr("Cancel"), tr("Discard")}
     547                            tr("Restore"), tr("Cancel"), tr("Discard")
    548548                            );
    549549                    dialog.setContent(
     
    551551                                    "JOSM found {0} unsaved osm data layers. ", unsavedLayerFiles.size(), unsavedLayerFiles.size()) +
    552552                                    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");
    554554                    int selection = dialog.showDialog().getValue();
    555555                    if (selection == 1) {
     
    567567                ExtendedDialog ed = new ExtendedDialog(
    568568                        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);
    571571                ed.setMinimumSize(new Dimension(460, 260));
    572572                ed.setIcon(JOptionPane.WARNING_MESSAGE);
  • trunk/src/org/openstreetmap/josm/gui/NoteInputDialog.java

    r9078 r12279  
    3232     */
    3333    public NoteInputDialog(Component parent, String title, String buttonText) {
    34         super(parent, title, new String[] {buttonText, tr("Cancel")});
     34        super(parent, title, buttonText, tr("Cancel"));
    3535    }
    3636
     
    5656        contentPanel.add(scrollPane);
    5757        setContent(contentPanel, false);
    58         setButtonIcons(new Icon[] {icon, ImageProvider.get("cancel.png")});
     58        setButtonIcons(icon, ImageProvider.get("cancel.png"));
    5959
    6060        showDialog();
     
    6767        return textArea.getText();
    6868    }
    69 
    7069}
  • trunk/src/org/openstreetmap/josm/gui/NoteSortDialog.java

    r11821 r12279  
    3333     */
    3434    public NoteSortDialog(Component parent, String title, String buttonText) {
    35         super(parent, title, new String[] {buttonText, tr("Cancel")});
     35        super(parent, title, buttonText, tr("Cancel"));
    3636    }
    3737
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairType.java

    r11879 r12279  
    1717     * compare my version of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with their version
    1818     */
    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),
    2020
    2121    /**
    2222     * compare my version of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with the merged version
    2323     */
    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),
    2525
    2626    /**
    2727     * compare their version of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with the merged veresion
    2828     */
    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);
    3030
    3131    /** the localized display name */
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/PrimitiveDataPaster.java

    r11746 r12279  
    136136    private static boolean confirmDeleteIncomplete() {
    137137        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");
    140140        ed.setContent(tr(
    141141                "The copied data contains incomplete objects.  " + "When pasting the incomplete objects are removed.  "
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java

    r11747 r12279  
    211211        lstInActiveDataLayer.addMouseListener(popupMenuLauncher);
    212212
    213         createLayout(pnl, false, Arrays.asList(new SideButton[] {
     213        createLayout(pnl, false, Arrays.asList(
    214214            new SideButton(selectObjectsAction, false),
    215215            new SideButton(readChangesetAction, false),
     
    217217            new SideButton(showChangesetInfoAction, false),
    218218            new SideButton(new LaunchChangesetManagerAction(), false)
    219         }));
     219        ));
    220220    }
    221221
  • trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java

    r10788 r12279  
    127127        wireUpdateEnabledStateUpdater(redoAction, redoTree);
    128128
    129         scrollPane = (JScrollPane) createLayout(treesPanel, true, Arrays.asList(new SideButton[] {
     129        scrollPane = (JScrollPane) createLayout(treesPanel, true, Arrays.asList(
    130130            new SideButton(selectAction),
    131131            new SideButton(undoAction),
    132132            new SideButton(redoAction)
    133         }));
     133        ));
    134134
    135135        InputMapUtils.addEnterAction(undoTree, selectAndZoomAction);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r12178 r12279  
    135135        addListSelectionListener(actSelect);
    136136
    137         createLayout(lstConflicts, true, Arrays.asList(new SideButton[] {
    138             btnResolve, btnSelect
    139         }));
     137        createLayout(lstConflicts, true, Arrays.asList(btnResolve, btnSelect));
    140138
    141139        popupMenuHandler.addAction(Main.main.menu.autoScaleActions.get("conflict"));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java

    r12046 r12279  
    4545    public ConflictResolutionDialog(Component parent) {
    4646        // We define our own actions, but need to give a hint about number of buttons
    47         super(parent, tr("Resolve conflicts"), new String[] {null, null, null});
     47        super(parent, tr("Resolve conflicts"), null, null, null);
    4848        setDefaultButton(1);
    4949        setCancelButton(2);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java

    r11993 r12279  
    239239        });
    240240
    241         createLayout(userTable, true, Arrays.asList(new SideButton[] {
     241        createLayout(userTable, true, Arrays.asList(
    242242                addButton, editButton, deleteButton, upButton, downButton
    243         }));
     243        ));
    244244    }
    245245
  • trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java

    r11452 r12279  
    6262     */
    6363    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"));
    6565        this.primitives = new ArrayList<>(primitives);
    6666        this.layer = layer;
     
    6868                WindowGeometry.centerInWindow(Main.parent, new Dimension(750, 550)));
    6969
    70         setButtonIcons(new String[]{"ok.png"});
     70        setButtonIcons("ok");
    7171        final JTabbedPane tabs = new JTabbedPane();
    7272
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java

    r11653 r12279  
    156156
    157157    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");
    160160        configureContextsensitiveHelp(help, true);
    161161
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java

    r10793 r12279  
    5151                ExtendedDialog ed = new ExtendedDialog(
    5252                        Main.parent, tr("Information about layer"),
    53                         new String[] {tr("OK")});
    54                 ed.setButtonIcons(new String[] {"ok"});
     53                        tr("OK"));
     54                ed.setButtonIcons("ok");
    5555                ed.setIcon(JOptionPane.INFORMATION_MESSAGE);
    5656                ed.setContent((Component) object);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LogShowDialog.java

    r8510 r12279  
    3030     */
    3131    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");
    3434        setContent(build(msg, log));
    3535    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java

    r11881 r12279  
    535535                return;
    536536            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"));
    538538            info.setPreferredSize(new Dimension(600, 400));
    539             info.setButtonIcons(new String[] {"ok.png"});
     539            info.setButtonIcons("ok");
    540540
    541541            final JTabbedPane tabs = new JTabbedPane();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/MenuItemSearchDialog.java

    r11496 r12279  
    2727
    2828    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"));
    3030        this.selector = new Selector(menu);
    3131        this.selector.setDblClickListener(e -> buttonAction(0, null));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java

    r11713 r12279  
    107107        pane.add(new JScrollPane(displayList), BorderLayout.CENTER);
    108108
    109         createLayout(pane, false, Arrays.asList(new SideButton[]{
     109        createLayout(pane, false, Arrays.asList(
    110110                new SideButton(downloadNotesInViewAction, false),
    111111                new SideButton(newAction, false),
     
    115115                new SideButton(sortAction, false),
    116116                new SideButton(openInBrowserAction, false),
    117                 new SideButton(uploadAction, false)}));
     117                new SideButton(uploadAction, false)));
    118118        updateButtonStates();
    119119    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r11610 r12279  
    163163        recentRelationsAction = new RecentRelationsAction(editButton);
    164164
    165         createLayout(pane, false, Arrays.asList(new SideButton[]{
     165        createLayout(pane, false, Arrays.asList(
    166166                new SideButton(newAction, false),
    167167                editButton,
     
    169169                new SideButton(deleteRelationsAction, false),
    170170                new SideButton(selectRelationAction, false)
    171         }));
     171        ));
    172172
    173173        InputMapUtils.unassignCtrlShiftUpDown(displaylist, JComponent.WHEN_FOCUSED);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r11680 r12279  
    132132        searchButton.createArrow(e -> SearchPopupMenu.launch(searchButton));
    133133
    134         createLayout(lstPrimitives, true, Arrays.asList(new SideButton[] {
     134        createLayout(lstPrimitives, true, Arrays.asList(
    135135            selectButton, searchButton, new SideButton(actShowHistory)
    136         }));
     136        ));
    137137    }
    138138
  • trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java

    r12101 r12279  
    9797        userTable.getSelectionModel().addListSelectionListener(showUserInfoAction);
    9898
    99         createLayout(userTable, true, Arrays.asList(new SideButton[] {
     99        createLayout(userTable, true, Arrays.asList(
    100100            new SideButton(selectionUsersPrimitivesAction),
    101101            new SideButton(showUserInfoAction)
    102         }));
     102        ));
    103103    }
    104104
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r11764 r12279  
    10141014            ExtendedDialog ed = new ExtendedDialog(Main.parent,
    10151015                    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");
    10181018            ed.setContent(tr("Really delete selection from relation {0}?", cur.getDisplayName(DefaultNameFormatter.getInstance())));
    10191019            ed.toggleEnable(DELETE_FROM_RELATION_PREF);
    1020             ed.showDialog();
    1021 
    1022             if (ed.getValue() != 1)
     1020
     1021            if (ed.showDialog().getValue() != 1)
    10231022                return;
    10241023
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r11945 r12279  
    376376     */
    377377    private static boolean warnOverwriteKey(String action, String togglePref) {
    378         ExtendedDialog ed = new ExtendedDialog(
     378        return new ExtendedDialog(
    379379                Main.parent,
    380380                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;
    389387    }
    390388
     
    416414
    417415        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");
    420418            setCancelButton(2);
    421419            configureContextsensitiveHelp("/Dialog/EditValue", true /* show help button */);
     
    679677
    680678        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");
    683681            setCancelButton(2);
    684682            configureContextsensitiveHelp("/Dialog/AddValue", true /* show help button */);
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java

    r10611 r12279  
    4040     */
    4141    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"));
    4343        init();
    44         setButtonIcons(new String[]{"download", "cancel"});
    45         setToolTipTexts(new String[]{
     44        setButtonIcons("download", "cancel");
     45        setToolTipTexts(
    4646                tr("Start downloading"),
    4747                tr("Close dialog and cancel downloading")
    48         });
     48        );
    4949        configureContextsensitiveHelp("/Action/DownloadObject", true /* show help button */);
    5050    }
  • trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java

    r10621 r12279  
    218218                Main.parent,
    219219                title,
    220                 new String[] {tr("Ok")})
    221         .setButtonIcons(new String[] {"ok"})
     220                tr("Ok"))
     221        .setButtonIcons("ok")
    222222        .setIcon(msgType)
    223223        .setContent(p, false);
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r12170 r12279  
    429429            Tile clickedTile = clickedTileHolder.getTile();
    430430            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"));
    432432                JPanel panel = new JPanel(new GridBagLayout());
    433433                Rectangle2D displaySize = coordinateConverter.getRectangleForTile(clickedTile);
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r12176 r12279  
    659659    @Override public Action[] getMenuEntries() {
    660660        List<Action> actions = new ArrayList<>();
    661         actions.addAll(Arrays.asList(new Action[]{
     661        actions.addAll(Arrays.asList(
    662662                LayerListDialog.getInstance().createActivateLayerAction(this),
    663663                LayerListDialog.getInstance().createShowHideLayerAction(),
     
    667667                LayerListDialog.getInstance().createDuplicateLayerAction(this),
    668668                new LayerSaveAction(this),
    669                 new LayerSaveAsAction(this),
    670         }));
     669                new LayerSaveAsAction(this)));
    671670        if (ExpertToggleAction.isExpert()) {
    672             actions.addAll(Arrays.asList(new Action[]{
     671            actions.addAll(Arrays.asList(
    673672                    new LayerGpxExportAction(this),
    674                     new ConvertToGpxLayerAction()}));
    675         }
    676         actions.addAll(Arrays.asList(new Action[]{
     673                    new ConvertToGpxLayerAction()));
     674        }
     675        actions.addAll(Arrays.asList(
    677676                SeparatorLayerAction.INSTANCE,
    678                 new RenameLayerAction(getAssociatedFile(), this)}));
     677                new RenameLayerAction(getAssociatedFile(), this)));
    679678        if (ExpertToggleAction.isExpert()) {
    680679            actions.add(new ToggleUploadDiscouragedLayerAction(this));
    681680        }
    682         actions.addAll(Arrays.asList(new Action[]{
     681        actions.addAll(Arrays.asList(
    683682                new ConsistencyTestAction(),
    684683                SeparatorLayerAction.INSTANCE,
    685                 new LayerListPopup.InfoAction(this)}));
     684                new LayerListPopup.InfoAction(this)));
    686685        return actions.toArray(new Action[actions.size()]);
    687686    }
     
    10541053                return 2;
    10551054            }
    1056             ExtendedDialog dialog = new ExtendedDialog(
     1055            return new ExtendedDialog(
    10571056                    Main.parent,
    10581057                    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();
    10641062        })) {
    10651063            return false;
     
    10681066        ConflictCollection conflictsCol = getConflicts();
    10691067        return conflictsCol == null || conflictsCol.isEmpty() || 1 == GuiHelper.runInEDTAndWaitAndReturn(() -> {
    1070             ExtendedDialog dialog = new ExtendedDialog(
     1068            return new ExtendedDialog(
    10711069                    Main.parent,
    10721070                    /* I18N: Display title of the window showing conflicts */
    10731071                    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();
    10801077        });
    10811078    }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r11914 r12279  
    142142                        Main.parent,
    143143                        tr("Correlate images with GPX track"),
    144                         new String[] {tr("OK"), tr("Try Again")}).
     144                        tr("OK"), tr("Try Again")).
    145145                        setContent(tr("No images could be matched!")).
    146                         setButtonIcons(new String[] {"ok", "dialogs/refresh"}).
     146                        setButtonIcons("ok", "dialogs/refresh").
    147147                        showDialog().getValue() == 2)
    148148                return AGAIN;
     
    732732            );
    733733            syncDialog.setContent(panelTf, false);
    734             syncDialog.setButtonIcons(new String[] {"ok", "cancel"});
     734            syncDialog.setButtonIcons("ok", "cancel");
    735735            syncDialog.setupDialog();
    736736            outerPanel.add(syncDialog.getContentPane(), BorderLayout.PAGE_START);
     
    955955            new ExtendedDialog(Main.parent,
    956956                    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();
    959959        }
    960960    }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

    r12131 r12279  
    719719                    Main.parent,
    720720                    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")
    723723            .setContent(new JLabel(tr("<html><h3>Delete the file {0} from disk?<p>The image file will be permanently lost!</h3></html>",
    724724                    toDelete.getFile().getName()), ImageProvider.get("dialogs/geoimage/deletefromdisk"), SwingConstants.LEFT))
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java

    r12173 r12279  
    265265            // build dialog
    266266            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");
    269269            ed.setContent(msg, false);
    270270            ed.setDefaultButton(2);
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r11848 r12279  
    4444import javax.swing.DefaultListModel;
    4545import javax.swing.DefaultListSelectionModel;
    46 import javax.swing.Icon;
    4746import javax.swing.ImageIcon;
    4847import javax.swing.JButton;
     
    916915         */
    917916        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"));
    919918
    920919            JPanel p = new JPanel(new GridBagLayout());
     
    942941                p.add(cbActive, GBC.eol().insets(15, 0, 5, 0));
    943942            }
    944             setButtonIcons(new String[] {"ok", "cancel"});
     943            setButtonIcons("ok", "cancel");
    945944            setContent(p);
    946945
     
    11911190                }
    11921191                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(
    11951194                        ImageProvider.get("cancel"),
    11961195                        new ImageProvider("ok").setMaxSize(ImageSizes.LARGEICON).addOverlay(
    11971196                                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(
    12001199                        tr("Cancel and return to the previous dialog"),
    1201                         tr("Ignore warning and install style anyway")});
     1200                        tr("Ignore warning and install style anyway"));
    12021201                    dlg.setContent("<html>" + tr("Some entries have unmet dependencies:") +
    12031202                            "<br>" + Utils.join("<br>", messages) + "</html>");
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AbstractListEditor.java

    r9665 r12279  
    2929     */
    3030    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"));
    3232        this.entry = entry;
    33         setButtonIcons(new String[] {"ok.png", "cancel.png"});
     33        setButtonIcons("ok.png", "cancel.png");
    3434        setRememberWindowGeometry(getClass().getName() + ".geometry", WindowGeometry.centerInWindow(parent, new Dimension(500, 350)));
    3535    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java

    r10853 r12279  
    220220
    221221    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;
    224224    }
    225225
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/StringEditor.java

    r9759 r12279  
    3030     */
    3131    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"));
    3333        this.entry = entry;
    34         setButtonIcons(new String[] {"ok.png", "cancel.png"});
     34        setButtonIcons("ok", "cancel");
    3535        setContent(build(setting.getValue() == null ? "" : setting.getValue()));
    3636    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryDialog.java

    r9665 r12279  
    2222     */
    2323    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");
    2626        setCancelButton(2);
    2727        configureContextsensitiveHelp("/Dialog/AddImagery", true /* show help button */);
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java

    r11746 r12279  
    266266            defPL2.description = tr("the main Potlatch 2 style");
    267267
    268             return Arrays.asList(new ExtendedSourceEntry[] {defJosmMapcss, defPL2});
     268            return Arrays.asList(defJosmMapcss, defPL2);
    269269        }
    270270
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java

    r11848 r12279  
    6060                            Main.warn(e, tr("Could not read tagging preset source: {0}", source));
    6161                            ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Error"),
    62                                     new String[] {tr("Yes"), tr("No"), tr("Cancel")});
     62                                    tr("Yes"), tr("No"), tr("Cancel"));
    6363                            ed.setContent(tr("Could not read tagging preset source: {0}\nDo you want to keep it?", source));
    6464                            switch (ed.showDialog().getValue()) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r12142 r12279  
    435435            contentInsets = new Insets(10, 5, 0, 5);
    436436            if (showNewRelation) {
    437                 setButtonIcons(new String[] {"ok", "dialogs/addrelation", "cancel" });
     437                setButtonIcons("ok", "dialogs/addrelation", "cancel");
    438438            } else {
    439                 setButtonIcons(new String[] {"ok", "cancel" });
     439                setButtonIcons("ok", "cancel");
    440440            }
    441441            setContent(content);
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchDialog.java

    r10590 r12279  
    3232
    3333    private TaggingPresetSearchDialog() {
    34         super(Main.parent, tr("Presets"), new String[] {tr("Select"), tr("Cancel")});
     34        super(Main.parent, tr("Presets"), tr("Select"), tr("Cancel"));
    3535        selector = new TaggingPresetSelector(true, true);
    3636        setContent(selector, false);
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSearchPrimitiveDialog.java

    r10590 r12279  
    6666
    6767    TaggingPresetSearchPrimitiveDialog() {
    68         super(Main.parent, tr("Presets"), new String[] {tr("Search"), tr("Cancel")});
     68        super(Main.parent, tr("Presets"), tr("Search"), tr("Cancel"));
    6969        selector = new TaggingPresetSelector(false, false);
    7070        setContent(selector, false);
     
    8686            TaggingPreset preset = selector.getSelectedPresetAndUpdateClassification();
    8787            if (preset != null) {
    88 
    8988                final Set<OsmPrimitive> matching = new HashSet<>(Main.getLayerManager().getEditDataSet().getPrimitives(preset));
    9089                Main.getLayerManager().getEditDataSet().setSelected(matching);
  • trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java

    r11746 r12279  
    3333
    3434import javax.swing.GrayFilter;
    35 import javax.swing.Icon;
    3635import javax.swing.ImageIcon;
    3736import javax.swing.JComponent;
     
    197196    public static boolean warnUser(String title, String content, ImageIcon baseActionIcon, String continueToolTip) {
    198197        ExtendedDialog dlg = new ExtendedDialog(Main.parent,
    199                 title, new String[] {tr("Cancel"), tr("Continue")});
     198                title, tr("Cancel"), tr("Continue"));
    200199        dlg.setContent(content);
    201         dlg.setButtonIcons(new Icon[] {
     200        dlg.setButtonIcons(
    202201                    new ImageProvider("cancel").setMaxSize(ImageSizes.LARGEICON).get(),
    203202                    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);
    208205        dlg.setIcon(JOptionPane.WARNING_MESSAGE);
    209206        dlg.setCancelButton(1);
     
    227224        p.add(sp, GBC.eol().fill(GBC.BOTH));
    228225
    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");
    231228        ed.setContent(p);
    232229        ed.showDialog();
Note: See TracChangeset for help on using the changeset viewer.