org.esa.beam.framework.ui.command
Class SelectableCommand

java.lang.Object
  extended by org.esa.beam.framework.ui.command.Command
      extended by org.esa.beam.framework.ui.command.SelectableCommand
All Implemented Interfaces:
com.bc.ceres.core.runtime.ConfigurableExtension
Direct Known Subclasses:
ExecCommand, ToolCommand

public abstract class SelectableCommand
extends Command

A command which also has a 'selected' state.

Version:
$Revision$ $Date$
Author:
Norman Fomferra

Field Summary
static String SELECTED_ACTION_KEY
           
 
Fields inherited from class org.esa.beam.framework.ui.command.Command
ACTION_KEY_CONTEXT, ACTION_KEY_LARGE_ICON, ACTION_KEY_LOCATION, ACTION_KEY_PARENT, ACTION_KEY_PLACE_AFTER, ACTION_KEY_PLACE_BEFORE, ACTION_KEY_PLACE_CONTEXT_TOP, ACTION_KEY_POPUP_TEXT, ACTION_KEY_SEPARATOR_AFTER, ACTION_KEY_SEPARATOR_BEFORE, ACTION_KEY_SORT_CHILDREN, HELP_ID_KEY
 
Constructor Summary
SelectableCommand()
           
SelectableCommand(String commandID)
           
SelectableCommand(String commandID, CommandListener listener)
           
 
Method Summary
 void actionPerformed(CommandEvent event)
          Invoked when a command action is performed.
 void addCommandListener(CommandListener l)
          Adds a command listener.
 void configure(com.bc.ceres.core.runtime.ConfigurationElement config)
           
 void configure(ResourceBundle resourceBundle)
          Configures this command with the properties (if any) found in the given recource bundle.
protected  Action createAction()
          Creates an appropriate action instance for this command.
protected  void fireActionPerformed(ActionEvent actionEvent, Object argument)
          Notify all listeners that have registered interest for notification on the 'action performed' event type.
 boolean isSelected()
           
 void removeCommandListener(CommandListener l)
          Removes a command listener.
 void setSelected(boolean selected)
           
 
Methods inherited from class org.esa.beam.framework.ui.command.Command
addEventListener, containsContext, containsLocation, containsProperty, containsPropertyValue, createMenuItem, createResourceKey, createToolBarButton, fireUpdateState, getAccelerator, getAction, getCommandID, getCommandUIFactory, getConfigBoolean, getConfigIcon, getConfigString, getConfigStrings, getContexts, getEventListenerList, getHelpId, getLargeIcon, getLocations, getLongDescription, getMnemonic, getParent, getPlaceAfter, getPlaceBefore, getPopupText, getProperty, getProperty, getProperty, getProperty, getResourceBoolean, getResourceIcon, getResourceString, getResourceStringArray, getResourceStrings, getShortDescription, getSmallIcon, getSortChildren, getText, getValue, isEnabled, isPlaceAtContextTop, isSeparatorAfter, isSeparatorBefore, removeEventListener, setAccelerator, setCommandID, setCommandUIFactory, setContexts, setEnabled, setHelpId, setLargeIcon, setLocations, setLongDescription, setMnemonic, setParent, setPlaceAfter, setPlaceAtContextTop, setPlaceBefore, setPopupText, setProperty, setProperty, setSeparatorAfter, setSeparatorBefore, setShortDescription, setSmallIcon, setText, toString, updateComponentTreeUI, updateState, updateState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SELECTED_ACTION_KEY

public static final String SELECTED_ACTION_KEY
See Also:
Constant Field Values
Constructor Detail

SelectableCommand

public SelectableCommand()

SelectableCommand

public SelectableCommand(String commandID)

SelectableCommand

public SelectableCommand(String commandID,
                         CommandListener listener)
Method Detail

isSelected

public boolean isSelected()

setSelected

public void setSelected(boolean selected)

addCommandListener

public void addCommandListener(CommandListener l)
Adds a command listener.

Parameters:
l - the command listener

removeCommandListener

public void removeCommandListener(CommandListener l)
Removes a command listener.

Parameters:
l - the command listener

fireActionPerformed

protected void fireActionPerformed(ActionEvent actionEvent,
                                   Object argument)
Notify all listeners that have registered interest for notification on the 'action performed' event type. The event instance is lazily created using the parameters passed into the fire method.


configure

public void configure(ResourceBundle resourceBundle)
Configures this command with the properties (if any) found in the given recource bundle. Overrides the base class implementation in order to configure the following extra properties:

  • command.command-ID.selected = true or false
  • Overrides:
    configure in class Command
    Parameters:
    resourceBundle - the resource bundle from which the properties are received
    Throws:
    IllegalArgumentException - if the recource bundle is null

    configure

    public void configure(com.bc.ceres.core.runtime.ConfigurationElement config)
                   throws com.bc.ceres.core.CoreException
    Specified by:
    configure in interface com.bc.ceres.core.runtime.ConfigurableExtension
    Overrides:
    configure in class Command
    Throws:
    com.bc.ceres.core.CoreException

    actionPerformed

    public void actionPerformed(CommandEvent event)
    Invoked when a command action is performed.

    Parameters:
    event - the command event

    createAction

    protected Action createAction()
    Description copied from class: Command
    Creates an appropriate action instance for this command.

    Specified by:
    createAction in class Command


    Copyright © 2002-2013 Brockmann Consult GmbH. All Rights Reserved.