|
Last change
on this file since 26919 was 25695, checked in by zverik, 15 years ago |
|
fix all strings for translation, update relation types (relcontext plugin)
|
|
File size:
1.0 KB
|
| Line | |
|---|
| 1 | package relcontext.actions;
|
|---|
| 2 |
|
|---|
| 3 | import java.awt.event.ActionEvent;
|
|---|
| 4 | import javax.swing.AbstractAction;
|
|---|
| 5 | import javax.swing.Action;
|
|---|
| 6 | import static org.openstreetmap.josm.tools.I18n.tr;
|
|---|
| 7 | import org.openstreetmap.josm.data.osm.Relation;
|
|---|
| 8 | import org.openstreetmap.josm.tools.ImageProvider;
|
|---|
| 9 | import relcontext.ChosenRelation;
|
|---|
| 10 | import relcontext.ChosenRelationListener;
|
|---|
| 11 |
|
|---|
| 12 | public 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.