Changeset 5028 in josm for trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
- Timestamp:
- 2012-02-28T11:29:30+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
r4982 r5028 20 20 import java.util.Set; 21 21 22 import javax.swing.AbstractAction; 22 23 import javax.swing.JMenuItem; 23 24 import javax.swing.JOptionPane; … … 51 52 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 52 53 import org.openstreetmap.josm.io.OsmTransferException; 54 import org.openstreetmap.josm.tools.ImageProvider; 53 55 import org.openstreetmap.josm.tools.Shortcut; 54 56 import org.xml.sax.SAXException; … … 61 63 * @author frsantos 62 64 */ 63 public class ValidatorDialog extends ToggleDialog implements ActionListener,SelectionChangedListener, LayerChangeListener {65 public class ValidatorDialog extends ToggleDialog implements SelectionChangedListener, LayerChangeListener { 64 66 /** Serializable ID */ 65 67 private static final long serialVersionUID = 2952292777351992696L; … … 105 107 106 108 List<SideButton> buttons = new LinkedList<SideButton>(); 107 selectButton = new SideButton(marktr("Select"), "select", "Validator", 108 tr("Set the selected elements on the map to the selected items in the list above."), this); 109 110 selectButton = new SideButton(new AbstractAction() { 111 { 112 putValue(NAME, marktr("Select")); 113 putValue(SHORT_DESCRIPTION, tr("Set the selected elements on the map to the selected items in the list above.")); 114 putValue(SMALL_ICON, ImageProvider.get("dialogs","select")); 115 } 116 @Override 117 public void actionPerformed(ActionEvent e) { 118 setSelectedItems(); 119 } 120 }); 109 121 selectButton.setEnabled(false); 110 122 buttons.add(selectButton); … … 112 124 buttons.add(new SideButton(Main.main.validator.validateAction)); 113 125 114 fixButton = new SideButton(marktr("Fix"), "fix", "Validator", tr("Fix the selected issue."), this); 126 fixButton = new SideButton(new AbstractAction() { 127 { 128 putValue(NAME, marktr("Fix")); 129 putValue(SHORT_DESCRIPTION, tr("Fix the selected issue.")); 130 putValue(SMALL_ICON, ImageProvider.get("dialogs","fix")); 131 } 132 @Override 133 public void actionPerformed(ActionEvent e) { 134 fixErrors(e); 135 } 136 }); 115 137 fixButton.setEnabled(false); 116 138 buttons.add(fixButton); 117 139 118 140 if (Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)) { 119 ignoreButton = new SideButton(marktr("Ignore"), "delete", "Validator", 120 tr("Ignore the selected issue next time."), this); 141 ignoreButton = new SideButton(new AbstractAction() { 142 { 143 putValue(NAME, marktr("Ignore")); 144 putValue(SHORT_DESCRIPTION, tr("Ignore the selected issue next time.")); 145 putValue(SMALL_ICON, ImageProvider.get("dialogs","fix")); 146 } 147 @Override 148 public void actionPerformed(ActionEvent e) { 149 ignoreErrors(e); 150 } 151 }); 121 152 ignoreButton.setEnabled(false); 122 153 buttons.add(ignoreButton); … … 332 363 } 333 364 Main.main.getCurrentDataSet().setSelected(sel); 334 }335 336 @Override337 public void actionPerformed(ActionEvent e) {338 String actionCommand = e.getActionCommand();339 if (actionCommand.equals("Select")) {340 setSelectedItems();341 } else if (actionCommand.equals("Fix")) {342 fixErrors(e);343 } else if (actionCommand.equals("Ignore")) {344 ignoreErrors(e);345 }346 365 } 347 366
Note:
See TracChangeset
for help on using the changeset viewer.