Changeset 32395 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/DeleteChosenRelationAction.java
- Timestamp:
- 2016-06-24T09:10:57+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/DeleteChosenRelationAction.java
r28813 r32395 1 // License: GPL. For details, see LICENSE file. 1 2 package relcontext.actions; 2 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 4 6 import java.awt.event.ActionEvent; 5 7 import java.util.Collections; 8 6 9 import javax.swing.AbstractAction; 10 7 11 import org.openstreetmap.josm.Main; 8 12 import org.openstreetmap.josm.command.Command; … … 10 14 import org.openstreetmap.josm.data.osm.Relation; 11 15 import org.openstreetmap.josm.tools.ImageProvider; 16 12 17 import relcontext.ChosenRelation; 13 18 import relcontext.ChosenRelationListener; … … 16 21 private ChosenRelation rel; 17 22 18 public DeleteChosenRelationAction( ChosenRelation rel) {23 public DeleteChosenRelationAction(ChosenRelation rel) { 19 24 super(tr("Delete relation")); 20 25 putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete")); … … 24 29 } 25 30 26 public void actionPerformed( ActionEvent e ) { 31 @Override 32 public void actionPerformed(ActionEvent e) { 27 33 Relation r = rel.get(); 28 34 rel.clear(); 29 35 Command c = DeleteCommand.delete(Main.main.getEditLayer(), Collections.singleton(r), true, true); 30 if (c != null )36 if (c != null ) { 31 37 Main.main.undoRedo.add(c); 38 } 32 39 } 33 40 34 public void chosenRelationChanged( Relation oldRelation, Relation newRelation ) { 41 @Override 42 public void chosenRelationChanged(Relation oldRelation, Relation newRelation) { 35 43 setEnabled(newRelation != null); 36 44 }
Note:
See TracChangeset
for help on using the changeset viewer.
