source: josm/trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SortBelowAction.java@ 14030

Last change on this file since 14030 was 14030, checked in by michael2402, 6 years ago

See #16388: Fix Checkstyle / Test issues.

File size: 1.5 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.dialogs.relation.actions;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.awt.event.ActionEvent;
7
8import org.openstreetmap.josm.tools.ImageProvider;
9
10/**
11 * Sort the selected relation members and all members below.
12 * @since 9496
13 */
14public class SortBelowAction extends AbstractRelationEditorAction {
15 private static final long serialVersionUID = 1L;
16
17 /**
18 * Constructs a new {@code SortBelowAction}.
19 * @param editorAccess An interface to access the relation editor contents.
20 */
21 public SortBelowAction(IRelationEditorActionAccess editorAccess) {
22 super(editorAccess, IRelationEditorUpdateOn.MEMBER_TABLE_CHANGE, IRelationEditorUpdateOn.MEMBER_TABLE_SELECTION);
23 new ImageProvider("dialogs", "sort_below").getResource().attachImageIcon(this, true);
24 putValue(NAME, tr("Sort below"));
25 putValue(SHORT_DESCRIPTION, tr("Sort the selected relation members and all members below"));
26 updateEnabledState();
27 }
28
29 @Override
30 public void actionPerformed(ActionEvent e) {
31 editorAccess.getMemberTableModel().sortBelow();
32 }
33
34 @Override
35 protected void updateEnabledState() {
36 setEnabled(editorAccess.getMemberTableModel().getRowCount() > 0
37 && !editorAccess.getMemberTableModel().getSelectionModel().isSelectionEmpty());
38 }
39
40 @Override
41 public boolean isExpertOnly() {
42 return true;
43 }
44}
Note: See TracBrowser for help on using the repository browser.