Last change
on this file since 12396 was 10600, checked in by Don-vip, 8 years ago |
see #11390 - sonar - squid:S1609 - Java 8: @FunctionalInterface annotation should be used to flag Single Abstract Method interfaces
|
-
Property svn:eol-style
set to
native
|
File size:
1.2 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.dialogs.layer;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import java.awt.event.ActionEvent;
|
---|
7 |
|
---|
8 | import javax.swing.AbstractAction;
|
---|
9 |
|
---|
10 | import org.openstreetmap.josm.gui.dialogs.IEnabledStateUpdating;
|
---|
11 | import org.openstreetmap.josm.gui.dialogs.LayerListDialog.LayerListModel;
|
---|
12 | import org.openstreetmap.josm.tools.ImageProvider;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * The action to move up the currently selected entries in the list.
|
---|
16 | */
|
---|
17 | public class MoveUpAction extends AbstractAction implements IEnabledStateUpdating {
|
---|
18 | private final LayerListModel model;
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Constructs a new {@code MoveUpAction}.
|
---|
22 | * @param model layer list model
|
---|
23 | */
|
---|
24 | public MoveUpAction(LayerListModel model) {
|
---|
25 | this.model = model;
|
---|
26 | putValue(NAME, tr("Move up"));
|
---|
27 | new ImageProvider("dialogs", "up").getResource().attachImageIcon(this, true);
|
---|
28 | putValue(SHORT_DESCRIPTION, tr("Move the selected layer one row up."));
|
---|
29 | updateEnabledState();
|
---|
30 | }
|
---|
31 |
|
---|
32 | @Override
|
---|
33 | public void updateEnabledState() {
|
---|
34 | setEnabled(model.canMoveUp());
|
---|
35 | }
|
---|
36 |
|
---|
37 | @Override
|
---|
38 | public void actionPerformed(ActionEvent e) {
|
---|
39 | model.moveUp();
|
---|
40 | }
|
---|
41 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.