Last change
on this file since 10465 was 8308, checked in by Don-vip, 9 years ago |
fix potential NPEs and Sonar issues related to serialization
|
-
Property svn:eol-style
set to
native
|
File size:
773 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.dialogs;
|
---|
3 |
|
---|
4 | import javax.swing.JLabel;
|
---|
5 | import javax.swing.tree.DefaultMutableTreeNode;
|
---|
6 |
|
---|
7 | import org.openstreetmap.josm.command.PseudoCommand;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * MutableTreeNode implementation for Command list JTree
|
---|
11 | */
|
---|
12 | public class CommandListMutableTreeNode extends DefaultMutableTreeNode {
|
---|
13 |
|
---|
14 | protected transient PseudoCommand cmd;
|
---|
15 | protected int idx;
|
---|
16 |
|
---|
17 | public CommandListMutableTreeNode(PseudoCommand cmd, int idx) {
|
---|
18 | super(new JLabel(cmd.getDescriptionText(), cmd.getDescriptionIcon(), JLabel.HORIZONTAL));
|
---|
19 | this.cmd = cmd;
|
---|
20 | this.idx = idx;
|
---|
21 | }
|
---|
22 |
|
---|
23 | public PseudoCommand getCommand() {
|
---|
24 | return cmd;
|
---|
25 | }
|
---|
26 |
|
---|
27 | public int getIndex() {
|
---|
28 | return idx;
|
---|
29 | }
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.