source: osm/applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/ClearChosenRelationAction.java@ 26919

Last change on this file since 26919 was 25695, checked in by zverik, 14 years ago

fix all strings for translation, update relation types (relcontext plugin)

File size: 1.0 KB
Line 
1package relcontext.actions;
2
3import java.awt.event.ActionEvent;
4import javax.swing.AbstractAction;
5import javax.swing.Action;
6import static org.openstreetmap.josm.tools.I18n.tr;
7import org.openstreetmap.josm.data.osm.Relation;
8import org.openstreetmap.josm.tools.ImageProvider;
9import relcontext.ChosenRelation;
10import relcontext.ChosenRelationListener;
11
12public class ClearChosenRelationAction extends AbstractAction implements ChosenRelationListener {
13 private ChosenRelation rel;
14
15 public ClearChosenRelationAction( ChosenRelation rel ) {
16 super();
17// putValue(Action.NAME, "X");
18 putValue(Action.SMALL_ICON, ImageProvider.get("relcontext", "clear"));
19 putValue(Action.SHORT_DESCRIPTION, tr("Clear the chosen relation"));
20 this.rel = rel;
21 rel.addChosenRelationListener(this);
22 setEnabled(false);
23 }
24
25 public void actionPerformed( ActionEvent e ) {
26 rel.clear();
27 }
28
29 public void chosenRelationChanged( Relation oldRelation, Relation newRelation ) {
30 setEnabled(newRelation != null);
31 }
32}
Note: See TracBrowser for help on using the repository browser.