Ignore:
Timestamp:
2024-06-17T19:37:02+02:00 (23 months ago)
Author:
taylor.smock
Message:

Cleanup some new PMD warnings from PMD 7.x (followup of r19101)

File:
1 edited

Legend:

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

    r18942 r19108  
    33
    44import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
     5import static org.openstreetmap.josm.tools.I18n.marktr;
    56import static org.openstreetmap.josm.tools.I18n.tr;
    67import static org.openstreetmap.josm.tools.I18n.trn;
     
    89import java.awt.Component;
    910import java.awt.Dimension;
     11import java.awt.GridBagConstraints;
    1012import java.awt.GridBagLayout;
    1113import java.awt.event.ActionEvent;
     
    8486    private static final BooleanProperty SAVE_PLUGIN_INFORMATION_PROPERTY = new BooleanProperty("session.saveplugins", false);
    8587    private static final String TOOLTIP_DEFAULT = tr("Save the current session.");
     88    private static final String SAVE_SESSION = marktr("Save Session");
    8689
    8790    protected transient FileFilter joz = new ExtensionFileFilter("joz", "joz", tr("Session file (archive) (*.joz)"));
     
    120123     */
    121124    protected SessionSaveAction(boolean toolbar, boolean installAdapters) {
    122         this(tr("Save Session"), "session", TOOLTIP_DEFAULT,
     125        this(tr(SAVE_SESSION), "session", TOOLTIP_DEFAULT,
    123126                Shortcut.registerShortcut("system:savesession", tr("File: {0}", tr("Save Session...")), KeyEvent.VK_S, Shortcut.ALT_CTRL),
    124127                toolbar, "save-session", installAdapters);
     
    183186                .collect(Collectors.toList());
    184187
    185         boolean zipRequired = layersOut.stream().map(l -> exporters.get(l))
     188        boolean zipRequired = layersOut.stream().map(exporters::get)
    186189                .anyMatch(ex -> ex != null && ex.requiresZip()) || pluginsWantToSave();
    187190
     
    333336
    334337        if (zipRequired) {
    335             fc = createAndOpenFileChooser(false, false, tr("Save Session"), joz, JFileChooser.FILES_ONLY, "lastDirectory");
     338            fc = createAndOpenFileChooser(false, false, tr(SAVE_SESSION), joz, JFileChooser.FILES_ONLY, "lastDirectory");
    336339        } else {
    337             fc = createAndOpenFileChooser(false, false, tr("Save Session"), Arrays.asList(jos, joz), jos,
     340            fc = createAndOpenFileChooser(false, false, tr(SAVE_SESSION), Arrays.asList(jos, joz), jos,
    338341                    JFileChooser.FILES_ONLY, "lastDirectory");
    339342        }
     
    366369         */
    367370        public SessionSaveAsDialog() {
    368             super(MainApplication.getMainFrame(), tr("Save Session"), tr("Save As"), tr("Cancel"));
     371            super(MainApplication.getMainFrame(), tr(SAVE_SESSION), tr("Save As"), tr("Cancel"));
    369372            configureContextsensitiveHelp("Action/SessionSaveAs", true /* show help button */);
    370373            initialize();
     
    442445                JPanel wrapper = new JPanel(new GridBagLayout());
    443446                wrapper.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
    444                 wrapper.add(exportPanel, GBC.std().fill(GBC.HORIZONTAL));
    445                 ip.add(wrapper, GBC.eol().fill(GBC.HORIZONTAL).insets(2, 2, 4, 2));
    446             }
    447             ip.add(GBC.glue(0, 1), GBC.eol().fill(GBC.VERTICAL));
     447                wrapper.add(exportPanel, GBC.std().fill(GridBagConstraints.HORIZONTAL));
     448                ip.add(wrapper, GBC.eol().fill(GridBagConstraints.HORIZONTAL).insets(2, 2, 4, 2));
     449            }
     450            ip.add(GBC.glue(0, 1), GBC.eol().fill(GridBagConstraints.VERTICAL));
    448451            JScrollPane sp = new JScrollPane(ip);
    449452            sp.setBorder(BorderFactory.createEmptyBorder());
     
    475478            p.add(include, GBC.std());
    476479            p.add(lbl, GBC.std());
    477             p.add(GBC.glue(1, 0), GBC.std().fill(GBC.HORIZONTAL));
     480            p.add(GBC.glue(1, 0), GBC.std().fill(GridBagConstraints.HORIZONTAL));
    478481            return p;
    479482        }
     
    538541     * @deprecated since 18833, use {@link #setCurrentSession(File, List, SessionWriter.SessionWriterFlags...)} instead
    539542     */
    540     @Deprecated
     543    @Deprecated(since = "18833")
    541544    public static void setCurrentSession(File file, boolean zip, List<Layer> layers) {
    542545        if (zip) {
Note: See TracChangeset for help on using the changeset viewer.