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

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

See #16388: Checkstyle: Convert tabs to spaces.

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 memberTable member table
20 * @param memberTableModel member table model
21 */
22 public SortBelowAction(IRelationEditorActionAccess editorAccess) {
23 super(editorAccess, IRelationEditorUpdateOn.MEMBER_TABLE_CHANGE, IRelationEditorUpdateOn.MEMBER_TABLE_SELECTION);
24 new ImageProvider("dialogs", "sort_below").getResource().attachImageIcon(this, true);
25 putValue(NAME, tr("Sort below"));
26 putValue(SHORT_DESCRIPTION, tr("Sort the selected relation members and all members below"));
27 updateEnabledState();
28 }
29
30 @Override
31 public void actionPerformed(ActionEvent e) {
32 editorAccess.getMemberTableModel().sortBelow();
33 }
34
35 @Override
36 protected void updateEnabledState() {
37 setEnabled(editorAccess.getMemberTableModel().getRowCount() > 0 && !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.