public class FwkCommand extends FwkPropertyChange implements FwkCommandInterface
,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected FwkArrayInterface |
actionListeners
The array that holds the action listener.
|
protected java.lang.Class |
buttonClass
The button class.
|
protected java.lang.String |
commandName
The command string.
|
protected java.lang.String |
helpID
The help id of the component to be created.
|
protected FwkIconInterface |
icon
The icon image.
|
protected java.lang.String |
iconKey
The icon property keyword.
|
protected FwkInstructionInterface |
instruction
The instruction interface implementation reference.
|
protected boolean |
menuEventEnabled
The flag that decides whether the command is enabled to react on menu events.
|
protected java.lang.Class |
menuItemClass
The menu item class.
|
protected FwkArrayInterface |
menuListeners
The array that holds the menu listener.
|
protected int |
mnemonic
The mnemonic of the command.
|
protected java.util.Properties |
properties
The properties of the command.
|
protected boolean |
radioGroupState
The radio group flag.
|
protected java.util.Hashtable |
registry
The registry.
|
protected boolean |
sensitive
The sensitive flag.
|
protected boolean |
separator
The separator flag.
|
protected java.lang.String |
text
The text of the command.
|
protected java.lang.String |
textKey
The text of the command.
|
protected boolean |
toggle
The toggle flag.
|
protected boolean |
toggleState
The toggle state flag.
|
protected boolean |
toolBarEnabled
The flag that decides whether the command is a toolbar command.
|
protected java.lang.String |
toolTipKey
The tool tip text key.
|
protected java.lang.String |
toolTipText
The tool tip text.
|
static java.lang.String |
version |
protected boolean |
visible
The visible flag.
|
sourceauthor, buildnr, className, company, copyright, creationDate, dateFormatString, description, eMail, FWK_ICON, FWK_ICON_ARRAY, FWK_ICON_BG, FWK_ICON_BG_ARRAY, FWK_ICON_BG_LARGE, FWK_ICON_BG_LARGE_ARRAY, FWK_ICON_LARGE, FWK_ICON_LARGE_ARRAY, ICON, iconCount, internetAddress, name, titleNameCONTROLLER_PROPERTY, MENU_REASON_CANCELED, MENU_REASON_DESELECTED, MENU_REASON_SELECTEDAUTHOR, BUILDNR, COMPANY, COPYRIGHT, DATE_FORMAT, DEFAULT_ICON, DESCRIPTION, INTERNET, LARGE_ICON, LARGE_KEY_EXT, LARGE_OPAQUE_ICON, LARGE_OPAQUE_KEY_EXT, OPAQUE_ICON, OPAQUE_KEY_EXT, RCS_DATE_FORMAT, SUPPORT_EMAIL, TITLE_NAME| Constructor and Description |
|---|
FwkCommand()
The constructor.
|
FwkCommand(FwkControllerInterface controller)
The constructor receiving the controller.
|
FwkCommand(java.lang.String text)
The constructor receiving the text value.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addActionListener(java.awt.event.ActionListener actionListener)
Add an action listener to the command.
|
void |
addCommand(FwkCommandInterface command)
Add the command to the command array.
|
void |
addCommand(int index,
FwkCommandInterface command)
Insert a command at the specified position.
|
void |
addMenuListener(javax.swing.event.MenuListener menuListener)
Add a menu listener to the command.
|
void |
addToGroup(int index,
java.lang.String groupIdent,
java.lang.String commandName)
Add a command to a group.
|
void |
addToGroup(java.lang.String groupIdent,
java.lang.String commandName)
Add a command to a group.
|
void |
clearCommands()
Clear all commands.
|
boolean |
commandsAvailable()
This method returns a boolean that indicates whether
the command array is initialized.
|
void |
deleteGroup(java.lang.String groupIdent)
Delete command group.
|
boolean |
execute(java.util.EventObject ev)
Execute the command.
|
FwkArrayInterface |
getActionListenerArray()
Get the action listener array of the command.
|
java.lang.Class |
getButtonClass()
Get the button class.
|
FwkCommandInterface |
getCommand(java.lang.String command)
Get a sub-command.
|
java.lang.String |
getCommandName()
Get the command name.
|
FwkCommandInterface[] |
getCommands()
Get the sub-commands of the command.
|
FwkControllerInterface |
getController()
Get the command controller.
|
FwkCommandInterface[] |
getGroup(java.lang.String groupIdent)
Retrieve the command group.
|
java.lang.String |
getHelpID()
Get the help id.
|
FwkIconInterface |
getIcon()
Get the icon image of the command.
|
java.lang.String |
getIconKey()
Get the icon property keyword.
|
boolean |
getMenuEventEnabled()
Get the menu event enabled flag.
|
java.lang.Class |
getMenuItemClass()
Get the menu item class.
|
FwkArrayInterface |
getMenuListenerArray()
Get the menu listener array of the command.
|
int |
getMnemonic()
Get the mnemonic of the command.
|
java.util.Iterator |
getProperties()
Get all keywords that define a property.
|
java.lang.Object |
getProperty(java.lang.String key)
Get the property for the specified property keyword.
|
boolean |
getRadioGroupState()
Gets the radio group state.
|
boolean |
getSensitivity()
Gets the sensitivity.
|
boolean |
getSeparator()
Gets the separator flag.
|
java.lang.String |
getText()
Get the command text.
|
java.lang.String |
getTextKey()
Get the command text key.
|
boolean |
getToggle()
Gets the toggle flag.
|
boolean |
getToggleState()
Gets the toggle state.
|
boolean |
getToolBarEnabled()
Returns a boolean whether the command is atoolbar command.
|
java.lang.String |
getToolTipKey()
Get the command tooltip key.
|
java.lang.String |
getToolTipText()
Get the command tooltip text.
|
java.lang.String |
getVersion()
Return the version string of the FWK component.
|
boolean |
getVisibility()
Gets the visiblity.
|
boolean |
groupExists(java.lang.String groupIdent)
Check whether a group exists.
|
boolean |
hasActionListeners()
Returns a boolean whether the command has action listeners.
|
boolean |
hasMenuListeners()
Returns a boolean whether the command has menu listeners.
|
boolean |
isParent()
Returns a boolean whether the command has children.
|
boolean |
menuSelect(javax.swing.event.MenuEvent event,
int reason)
The callback for menuevents.
|
void |
register(java.lang.Object obj)
Register the object at the command.
|
java.util.Enumeration |
registeredObjects()
Retrieves the enumeration of registered objects.
|
int |
registrySize()
Return the total number of registered objects.
|
void |
removeActionListener(java.awt.event.ActionListener actionListener)
Remove an action listener from the command.
|
void |
removeCommand(FwkCommandInterface command)
Remove a sub-command.
|
void |
removeFromGroup(java.lang.String groupIdent,
java.lang.String commandName)
Remove a command from a group.
|
void |
removeMenuListener(javax.swing.event.MenuListener menuListener)
Remove a menu listener from the command.
|
void |
setAsParent()
Set the FwkCommand as a parent.
|
void |
setButtonClass(java.lang.Class clazz)
Set the button class.
|
void |
setCommandName(java.lang.String commandName)
Set the command name.
|
void |
setCommands(FwkCommandInterface[] commands)
Set the sub-commands of the command.
|
void |
setController(FwkControllerInterface controller)
Set the command controller.
|
void |
setHelpID(java.lang.String helpID)
Set the command help ID.
|
void |
setIcon(FwkIconInterface icon)
Set the icon image of the command.
|
void |
setIconKey(java.lang.String iconKey)
Set the icon key to get the icon from properties.
|
void |
setMenuEventEnabled(boolean flag)
Set the menu event enabled flag.
|
void |
setMenuItemClass(java.lang.Class clazz)
Set the menu item class.
|
void |
setMnemonic(int mnemonic)
Set the mnemonic of the command.
|
void |
setProperty(java.lang.String key,
java.lang.Object value)
Set a property for the specified property keyword.
|
void |
setRadioGroupState(boolean flag)
Sets the radio group state.
|
void |
setSensitivity(boolean flag)
Sets the sensitivity of the command.
|
void |
setSeparator(boolean flag)
Sets the command as separator.
|
void |
setText(java.lang.String text)
Set the command text.
|
void |
setTextKey(java.lang.String textKey)
Set the command text key to get the properties.
|
void |
setToggle(boolean flag)
Sets the command as toggle.
|
void |
setToggleState(boolean flag)
Sets the command toggle state.
|
void |
setToolBarEnabled(boolean flag)
Returns a boolean whether the command is atoolbar command.
|
void |
setToolTipKey(java.lang.String toolTipKey)
Set the command tooltip key to get the properties.
|
void |
setToolTipText(java.lang.String toolTipText)
Set the command tooltip text.
|
void |
setVisibility(boolean flag)
Sets the visibility of the command.
|
java.lang.String |
toString()
Return the string representation of the command.
|
void |
unregister(java.lang.Object obj)
Unregister the object.
|
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, setSource, suspendPropertyChangeEventsgetAuthor, getBuild, getClassName, getCompany, getCompanyInternetAddress, getCopyright, getCreationDate, getCreationDate, getDateFormatString, getDescription, getIcon, getIconKey, getName, getPresentationString, getPresentationString, getSupportEMail, getTitle, getTitleName, getTransferData, getTransferDataFlavors, isDataFlavorSupported, lostOwnership, setAuthor, setBuild, setClassName, setCompany, setCompanyInternetAddress, setCopyright, setCreationDate, setCreationDate, setDateFormatString, setDescription, setDescriptor, setIcon, setIconKey, setName, setSupportEMail, setTitleNamegetNiceVersion, releaseclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPresentationString, getPresentationStringreleaseaddPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, setSource, suspendPropertyChangeEventspublic static final java.lang.String version
protected boolean toolBarEnabled
protected boolean menuEventEnabled
protected java.lang.String text
protected java.lang.String textKey
protected java.lang.String commandName
protected int mnemonic
protected FwkIconInterface icon
protected java.lang.String iconKey
protected java.lang.String toolTipText
protected java.lang.String toolTipKey
protected boolean visible
protected boolean sensitive
protected boolean separator
protected boolean toggle
protected boolean toggleState
protected boolean radioGroupState
protected FwkArrayInterface actionListeners
protected FwkArrayInterface menuListeners
protected java.lang.String helpID
protected java.util.Hashtable registry
protected FwkInstructionInterface instruction
protected java.lang.Class buttonClass
protected java.lang.Class menuItemClass
protected java.util.Properties properties
public FwkCommand()
public FwkCommand(FwkControllerInterface controller)
controller - The command controller.public FwkCommand(java.lang.String text)
text - The text value of the command.public java.lang.String getVersion()
FwkInterfacegetVersion in interface FwkInterfacegetVersion in class FwkPropertyChangepublic java.lang.String getCommandName()
getCommandName in interface FwkCommandInterfacesetCommandName(String)public FwkControllerInterface getController()
getController in interface FwkControlledByInterface#setController(Object),
#FwkMenuFactorypublic java.lang.String getHelpID()
getHelpID in interface FwkCommandInterfacesetHelpID(String)public FwkIconInterface getIcon()
getIcon in interface FwkCommandInterfacegetIcon in interface FwkDescriptionInterfacegetIcon in class FwkDescriptionsetIconKey(String),
#setIconImage(Image),
#getIconfilename()public java.lang.String getIconKey()
getIconKey in interface FwkCommandInterfacegetIconKey in interface FwkDescriptionInterfacegetIconKey in class FwkDescription#getIconImage()public int getMnemonic()
getMnemonic in interface FwkCommandInterfacepublic boolean getRadioGroupState()
getRadioGroupState in interface FwkCommandInterfacesetRadioGroupState(boolean)public boolean getSensitivity()
getSensitivity in interface FwkCommandInterfacesetSensitivity(boolean)public boolean getSeparator()
getSeparator in interface FwkCommandInterfacesetSeparator(boolean)public java.lang.String getText()
getText in interface FwkCommandInterfacesetText(String),
getTextKey()public java.lang.String getTextKey()
getTextKey in interface FwkCommandInterfacesetTextKey(String),
getText()public boolean getToggle()
getToggle in interface FwkCommandInterfacesetToggle(boolean)public boolean getToggleState()
getToggleState in interface FwkCommandInterfacesetToggleState(boolean)public java.lang.String getToolTipKey()
getToolTipKey in interface FwkCommandInterfacesetToolTipKey(String),
getToolTipText()public java.lang.String getToolTipText()
getToolTipText in interface FwkCommandInterfacesetToolTipText(String),
getToolTipKey()public boolean getVisibility()
getVisibility in interface FwkCommandInterfacesetVisibility(boolean)public void setToolBarEnabled(boolean flag)
setToolBarEnabled in interface FwkCommandInterfacetrue - If the command should be enabled for the toolbar.public boolean getToolBarEnabled()
getToolBarEnabled in interface FwkCommandInterfacepublic boolean isParent()
isParent in interface FwkCommandInterfacepublic void setAsParent()
setAsParent in interface FwkCommandInterfacepublic void setCommandName(java.lang.String commandName)
setCommandName in interface FwkCommandInterfacecommand - The new command string of the command.getCommandName()public void setController(FwkControllerInterface controller)
setController in interface FwkControlledByInterfacecontroller - The new controller of the command.getController(),
#FwkMenuFactorypublic void setHelpID(java.lang.String helpID)
setHelpID in interface FwkCommandInterfacehelpID - The new helpID of the command.getHelpID()public void setIcon(FwkIconInterface icon)
setIcon in interface FwkCommandInterfacesetIcon in interface FwkDescriptionInterfacesetIcon in class FwkDescriptionimage - The new icon of the command.#getIconImage(),
#setIconfilename(String)public void setIconKey(java.lang.String iconKey)
setIconKey in interface FwkCommandInterfacesetIconKey in interface FwkDescriptionInterfacesetIconKey in class FwkDescriptioniconKey - The new icon property keyword.getIconKey(),
getIcon()public void setMenuEventEnabled(boolean flag)
setMenuEventEnabled in interface FwkCommandInterfaceflag - if true the menu events are enabled.public boolean getMenuEventEnabled()
getMenuEventEnabled in interface FwkCommandInterfacepublic boolean menuSelect(javax.swing.event.MenuEvent event,
int reason)
menuSelect in interface FwkCommandInterfaceevent - The menueventreason - The reson. Use predefined constants above.public void setMnemonic(int mnemonic)
setMnemonic in interface FwkCommandInterfacemnemonic - The new mnemonic of the command.getMnemonic()public void setRadioGroupState(boolean flag)
setRadioGroupState in interface FwkCommandInterfaceflag - true if command is a toggle.getRadioGroupState()public void setSensitivity(boolean flag)
setSensitivity in interface FwkCommandInterfaceflag - true if sensitive.getSensitivity()public void setSeparator(boolean flag)
setSeparator in interface FwkCommandInterfaceflag - true if separator.getSeparator()public void setText(java.lang.String text)
setText in interface FwkCommandInterfacetext - The new text of the command.getText(),
setTextKey(String)public void setTextKey(java.lang.String textKey)
setTextKey in interface FwkCommandInterfacetextKey - The new text key of the command.getTextKey(),
getText()public void setToggle(boolean flag)
setToggle in interface FwkCommandInterfaceflag - true if command is a toggle.getToggle()public void setToggleState(boolean flag)
setToggleState in interface FwkCommandInterfaceflag - true if command is a toggle.getToggle()public void setToolTipText(java.lang.String toolTipText)
setToolTipText in interface FwkCommandInterfacetoolTipText - The new tooltip text of the command.getToolTipText(),
getToolTipKey()public void setToolTipKey(java.lang.String toolTipKey)
setToolTipKey in interface FwkCommandInterfacetoolTipKey - The new tooltip key of the command.getToolTipKey(),
getToolTipText()public void setVisibility(boolean flag)
setVisibility in interface FwkCommandInterfaceflag - true if visible.getVisibility()public void register(java.lang.Object obj)
register in interface FwkCommandInterfaceobj - The object to be stored.public void unregister(java.lang.Object obj)
unregister in interface FwkCommandInterfaceobj - The object to be unregistered,public java.util.Enumeration registeredObjects()
registeredObjects in interface FwkCommandInterfacepublic int registrySize()
registrySize in interface FwkCommandInterfacepublic boolean hasActionListeners()
hasActionListeners in interface FwkCommandInterfacepublic boolean hasMenuListeners()
hasMenuListeners in interface FwkCommandInterfacepublic FwkArrayInterface getActionListenerArray()
getActionListenerArray in interface FwkCommandInterfacepublic FwkArrayInterface getMenuListenerArray()
getMenuListenerArray in interface FwkCommandInterfacepublic void addActionListener(java.awt.event.ActionListener actionListener)
addActionListener in interface FwkCommandInterfaceactionListener - The action listener to be added.public void addMenuListener(javax.swing.event.MenuListener menuListener)
addMenuListener in interface FwkCommandInterfacemenuListener - The menu listener to be added.public void removeActionListener(java.awt.event.ActionListener actionListener)
removeActionListener in interface FwkCommandInterfaceactionListener - The action listener to be removed.public void removeMenuListener(javax.swing.event.MenuListener menuListener)
removeMenuListener in interface FwkCommandInterfacemenuListener - The menu listener to be removed.public boolean execute(java.util.EventObject ev)
execute in interface FwkCommandInterfaceev - The event that is the trigger of this command. May be nullpublic void addCommand(FwkCommandInterface command)
addCommand in interface FwkInstructionInterfacecommand - The command to be added.public void addCommand(int index,
FwkCommandInterface command)
addCommand in interface FwkInstructionInterfaceindex - The position where the command has to be inserted.command - The command to be added.public FwkCommandInterface getCommand(java.lang.String command)
getCommand in interface FwkInstructionInterfacecommand - The action command string.public FwkCommandInterface[] getCommands()
getCommands in interface FwkInstructionInterfacepublic void removeCommand(FwkCommandInterface command)
removeCommand in interface FwkInstructionInterfacecommand - The sub-command to be removed.public void setCommands(FwkCommandInterface[] commands)
setCommands in interface FwkInstructionInterfacecommands - An array containing all sub-Commands.addCommand(FwkCommand command)public java.lang.Object getProperty(java.lang.String key)
getProperty in interface FwkCommandInterfacekey - The property keyword.public java.util.Iterator getProperties()
getProperties in interface FwkCommandInterfacepublic void setProperty(java.lang.String key,
java.lang.Object value)
setProperty in interface FwkCommandInterfacekey - The property keyword.object - The property value.public boolean commandsAvailable()
commandsAvailable in interface FwkInstructionInterfacepublic void clearCommands()
clearCommands in interface FwkInstructionInterfacepublic void addToGroup(int index,
java.lang.String groupIdent,
java.lang.String commandName)
addToGroup in interface FwkInstructionInterfaceindex - Index where the command should be placed.groupIdent - The string identified of the group.commandName - The name of the command.public void addToGroup(java.lang.String groupIdent,
java.lang.String commandName)
addToGroup in interface FwkInstructionInterfacegroupIdent - The string identified of the group.commandName - The name of the command.public void deleteGroup(java.lang.String groupIdent)
deleteGroup in interface FwkInstructionInterfacegroupIdent - The string identified of the group.public FwkCommandInterface[] getGroup(java.lang.String groupIdent)
getGroup in interface FwkInstructionInterfacegroupIdent - The string identified of the group.public boolean groupExists(java.lang.String groupIdent)
groupExists in interface FwkInstructionInterfacepublic void removeFromGroup(java.lang.String groupIdent,
java.lang.String commandName)
removeFromGroup in interface FwkInstructionInterfacegroupIdent - The string identified of the group.commandName - The name of the command.public java.lang.String toString()
toString in class FwkDescriptionpublic void setButtonClass(java.lang.Class clazz)
setButtonClass in interface FwkCommandInterfacethe - button class to be used when creating a button out of the command.public java.lang.Class getButtonClass()
The return value may be null. In this case use the button you like.
getButtonClass in interface FwkCommandInterfacepublic void setMenuItemClass(java.lang.Class clazz)
setMenuItemClass in interface FwkCommandInterfacethe - menu item class to be used when creating a menu item out of the command.public java.lang.Class getMenuItemClass()
getMenuItemClass in interface FwkCommandInterface