source: josm/trunk/src/org/openstreetmap/josm/gui/dialogs/CommandListMutableTreeNode.java@ 12301

Last change on this file since 12301 was 11048, checked in by Don-vip, 8 years ago

sonar

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.dialogs;
3
4import javax.swing.JLabel;
5import javax.swing.tree.DefaultMutableTreeNode;
6
7import org.openstreetmap.josm.command.PseudoCommand;
8
9/**
10 * MutableTreeNode implementation for Command list JTree
11 */
12public class CommandListMutableTreeNode extends DefaultMutableTreeNode {
13
14 protected final transient PseudoCommand cmd;
15 protected final int idx;
16
17 /**
18 * Constructs a new {@code CommandListMutableTreeNode}.
19 * @param cmd command
20 * @param idx index
21 */
22 public CommandListMutableTreeNode(PseudoCommand cmd, int idx) {
23 super(new JLabel(cmd.getDescriptionText(), cmd.getDescriptionIcon(), JLabel.HORIZONTAL));
24 this.cmd = cmd;
25 this.idx = idx;
26 }
27
28 /**
29 * Returns the command.
30 * @return the command
31 */
32 public PseudoCommand getCommand() {
33 return cmd;
34 }
35
36 /**
37 * Returns the index.
38 * @return the index
39 */
40 public int getIndex() {
41 return idx;
42 }
43}
Note: See TracBrowser for help on using the repository browser.