001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.command; 003 004import java.util.Collection; 005 006import javax.swing.Icon; 007 008import org.openstreetmap.josm.data.osm.OsmPrimitive; 009 010/** 011 * PseudoCommand is a reduced form of a command. It can be presented in a tree view 012 * as subcommand of real commands but it is just an empty shell and can not be 013 * executed or undone. 014 */ 015public abstract class PseudoCommand { 016 017 /** 018 * Provides a description text representing this command. 019 * @return description text representing this command 020 */ 021 public abstract String getDescriptionText(); 022 023 /** 024 * Provides a descriptive icon of this command. 025 * @return descriptive icon of this command 026 */ 027 public Icon getDescriptionIcon() { 028 return null; 029 } 030 031 /** 032 * Return the primitives that take part in this command. 033 * @return primitives that take part in this command 034 */ 035 public abstract Collection<? extends OsmPrimitive> getParticipatingPrimitives(); 036 037 /** 038 * Returns the subcommands of this command. 039 * Override for subclasses that have child commands. 040 * @return the subcommands, null if there are no child commands 041 */ 042 public Collection<PseudoCommand> getChildren() { 043 return null; 044 } 045}