Changeset 17146 in josm
- Timestamp:
- 2020-10-10T19:05:40+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
r17036 r17146 7 7 import java.awt.Dimension; 8 8 import java.awt.GridBagLayout; 9 import java.awt.GridLayout; 9 10 import java.awt.event.ActionEvent; 10 11 import java.awt.event.ActionListener; … … 24 25 25 26 import javax.swing.AbstractAction; 26 import javax.swing.Box;27 27 import javax.swing.JButton; 28 28 import javax.swing.JFileChooser; … … 202 202 scroll.setPreferredSize(new Dimension(400, 200)); 203 203 204 JPanel buttonPanel = new JPanel(new GridLayout(1, 6)); 204 205 JButton add = new JButton(tr("Add"), ImageProvider.get("dialogs/add", ImageProvider.ImageSizes.SMALLICON)); 205 p.add(Box.createHorizontalGlue(), GBC.std().fill(GBC.HORIZONTAL));206 p.add(add, GBC.std().insets(0, 5, 0, 0));206 buttonPanel.add(add); 207 add.setToolTipText(add.getText()); 207 208 add.addActionListener(e -> { 208 209 PrefEntry pe = table.addPreference(gui); … … 215 216 216 217 JButton edit = new JButton(tr("Edit"), ImageProvider.get("dialogs/edit", ImageProvider.ImageSizes.SMALLICON)); 217 p.add(edit, GBC.std().insets(5, 5, 5, 0)); 218 buttonPanel.add(edit); 219 edit.setToolTipText(edit.getText()); 218 220 edit.addActionListener(e -> { 219 221 if (table.editPreference(gui)) … … 223 225 224 226 JButton reset = new JButton(tr("Reset"), ImageProvider.get("undo", ImageProvider.ImageSizes.SMALLICON)); 225 p.add(reset, GBC.std().insets(0, 5, 0, 0)); 227 buttonPanel.add(reset); 228 reset.setToolTipText(reset.getText()); 226 229 reset.addActionListener(e -> table.resetPreferences(gui)); 227 230 table.getSelectionModel().addListSelectionListener(event -> reset.setEnabled(table.getSelectedRowCount() > 0)); 228 231 229 232 JButton read = new JButton(tr("Read from file"), ImageProvider.get("open", ImageProvider.ImageSizes.SMALLICON)); 230 p.add(read, GBC.std().insets(5, 5, 0, 0)); 233 buttonPanel.add(read); 234 read.setToolTipText(read.getText()); 231 235 read.addActionListener(e -> readPreferencesFromXML()); 232 236 233 237 JButton export = new JButton(tr("Export selected items"), ImageProvider.get("save", ImageProvider.ImageSizes.SMALLICON)); 234 p.add(export, GBC.std().insets(5, 5, 0, 0)); 238 buttonPanel.add(export); 239 export.setToolTipText(export.getText()); 235 240 export.addActionListener(e -> exportSelectedToXML()); 236 241 237 242 final JButton more = new JButton(tr("More...")); 238 p.add(more, GBC.std().insets(5, 5, 0, 0)); 243 buttonPanel.add(more); 244 more.setToolTipText(more.getText()); 239 245 more.addActionListener(new ActionListener() { 240 246 private final JPopupMenu menu = buildPopupMenu(); … … 246 252 } 247 253 }); 254 p.add(buttonPanel, GBC.eol()); 248 255 } 249 256
Note:
See TracChangeset
for help on using the changeset viewer.