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     */
020    public abstract String getDescriptionText();
021
022    /**
023     * Provides a descriptive icon of this command.
024     */
025    public Icon getDescriptionIcon() {
026        return null;
027    }
028
029    /**
030     * Return the primitives that take part in this command.
031     */
032    public abstract Collection<? extends OsmPrimitive> getParticipatingPrimitives();
033
034    /**
035     * Returns the subcommands of this command.
036     * Override for subclasses that have child commands.
037     * @return the subcommands, null if there are no child commands
038     */
039    public Collection<PseudoCommand> getChildren() {
040        return null;
041    }
042}