com.virtuosotechnologies.lib.basiccommand
Class BasicDecoratingCommandNode

java.lang.Object
  extended bycom.virtuosotechnologies.lib.container.PseudoModifiablePropertySet
      extended bycom.virtuosotechnologies.lib.container.BasicModifiablePropertySet
          extended bycom.virtuosotechnologies.lib.command.AbstractCommandNode
              extended bycom.virtuosotechnologies.lib.basiccommand.BasicCommandNode
                  extended bycom.virtuosotechnologies.lib.basiccommand.BasicDecoratingCommandNode
All Implemented Interfaces:
CommandListener, CommandNode, EventListener, ModifiablePropertySet, PropertySet

public class BasicDecoratingCommandNode
extends BasicCommandNode

A command node that decorates another one. It shares the same flavor and invocation behavior as its delegate, and normally shares the same properties, but the properties can be overridden. This is useful in cases where there are multiple ways to invoke a particular command, with potentially different titles (for example, a menu command and a button with different text).


Field Summary
 
Fields inherited from class com.virtuosotechnologies.lib.basiccommand.BasicCommandNode
ACCELERATOR_KEYSTROKE_PROPERTY, ACTIONITEM_FLAVOR, APPEARANCECHANGING_TOGGLEITEM_FLAVOR, CONTAINER_FLAVOR, DISABLED_PROPERTY, GROUP_FLAVOR, HIDDEN_PROPERTY, LONG_DESCRIPTION_PROPERTY, MNEMONIC_CODE_PROPERTY, NAME_PROPERTY, NULL_FLAVOR, RADIOCONTAINER_FLAVOR, RADIOGROUP_FLAVOR, RADIOMUTEX_FLAVOR, SELECTED_CHILD_PROPERTY, SELECTED_NAME_PROPERTY, SELECTED_SHORT_DESCRIPTION_PROPERTY, SELECTED_SMALL_ICON_PROPERTY, SELECTION_STATE_PROPERTY, SEPARATOR_FLAVOR, SHORT_DESCRIPTION_PROPERTY, SMALL_ICON_PROPERTY, TOGGLEITEM_FLAVOR
 
Fields inherited from interface com.virtuosotechnologies.lib.command.CommandListener
COMMAND_INVOKED_METHOD
 
Constructor Summary
BasicDecoratingCommandNode(CommandNode delegate)
          Constructor.
 
Method Summary
 void commandInvoked(CommandEvent ev)
          Invoke the command.
 CommandNode getDelegate()
          Get delegate
 CommandNodeFlavor getFlavor()
          Get the flavor of CommandNode
 void putValue(ConstrainedKey key, Object value)
          Set a property.
 
Methods inherited from class com.virtuosotechnologies.lib.basiccommand.BasicCommandNode
dump, getAcceleratorKeystrokeProperty, getDefaultProperties, getDisabledProperty, getHiddenProperty, getLongDescriptionProperty, getMnemonicCodeProperty, getNameProperty, getSelectedChildProperty, getSelectedNameProperty, getSelectedShortDescriptionProperty, getSelectedSmallIconProperty, getSelectionStateProperty, getShortDescriptionProperty, getSmallIconProperty, setAcceleratorKeystrokeProperty, setDisabledProperty, setHiddenProperty, setLongDescriptionProperty, setMnemonicCodeProperty, setNameProperty, setSelectedChildProperty, setSelectedNameProperty, setSelectedShortDescriptionProperty, setSelectedSmallIconProperty, setSelectionStateProperty, setShortDescriptionProperty, setSmallIconProperty
 
Methods inherited from class com.virtuosotechnologies.lib.command.AbstractCommandNode
addChild, addNodeListener, fireAllChildrenRemovedEvent, fireChildAddedEvent, fireChildRemovedEvent, getIndexOfChild, getNthChild, getNumChildren, insertChild, invoke, isChild, removeAllChildren, removeNodeListener, removeNthChild
 
Methods inherited from class com.virtuosotechnologies.lib.container.PseudoModifiablePropertySet
addPropertySetListener, firePropertySetEvent, getDefaultValue, getValue, removePropertySetListener, resetValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.virtuosotechnologies.lib.container.ModifiablePropertySet
resetValue
 
Methods inherited from interface com.virtuosotechnologies.lib.container.PropertySet
addPropertySetListener, getDefaultValue, getValue, removePropertySetListener
 

Constructor Detail

BasicDecoratingCommandNode

public BasicDecoratingCommandNode(CommandNode delegate)
Constructor.

Parameters:
delegate - node to decorate
Method Detail

getFlavor

public CommandNodeFlavor getFlavor()
Get the flavor of CommandNode

Returns:
the flavor of the decorated delegate

putValue

public void putValue(ConstrainedKey key,
                     Object value)
Set a property. Normally, this will result in the decorator's properties being set, overriding the delegate's properties, but in a few cases (such as state), it doesn't make sense to decorate the property, so the original delegate will have its property set.

Specified by:
putValue in interface ModifiablePropertySet
Overrides:
putValue in class PseudoModifiablePropertySet
Parameters:
key - key object for the property.
value - new value for the property.

commandInvoked

public void commandInvoked(CommandEvent ev)
Invoke the command. Delegates to the original node.

Parameters:
ev - event

getDelegate

public CommandNode getDelegate()
Get delegate

Returns:
the delegate CommandNode