001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.gui.dialogs; 003 004import javax.swing.JLabel; 005import javax.swing.tree.DefaultMutableTreeNode; 006 007import org.openstreetmap.josm.command.PseudoCommand; 008 009/** 010 * MutableTreeNode implementation for Command list JTree 011 */ 012public class CommandListMutableTreeNode extends DefaultMutableTreeNode { 013 014 protected transient PseudoCommand cmd; 015 protected int idx; 016 017 public CommandListMutableTreeNode(PseudoCommand cmd, int idx) { 018 super(new JLabel(cmd.getDescriptionText(), cmd.getDescriptionIcon(), JLabel.HORIZONTAL)); 019 this.cmd = cmd; 020 this.idx = idx; 021 } 022 023 public PseudoCommand getCommand() { 024 return cmd; 025 } 026 027 public int getIndex() { 028 return idx; 029 } 030}