public class FwkCommand extends FwkPropertyChange implements FwkCommandInterface
,
Serialized FormModifier 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.
|
source
author, 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, titleName
CONTROLLER_PROPERTY, MENU_REASON_CANCELED, MENU_REASON_DESELECTED, MENU_REASON_SELECTED
AUTHOR, 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, suspendPropertyChangeEvents
getAuthor, 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, setTitleName
getNiceVersion, release
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPresentationString, getPresentationString
release
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeArray, getPropertyChangeListenerArray, getPropertyChangeListenerArray, isPropertyChangeEventSuspended, removePropertyChangeListener, removePropertyChangeListener, setSource, suspendPropertyChangeEvents
public 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()
FwkInterface
getVersion
in interface FwkInterface
getVersion
in class FwkPropertyChange
public java.lang.String getCommandName()
getCommandName
in interface FwkCommandInterface
setCommandName(String)
public FwkControllerInterface getController()
getController
in interface FwkControlledByInterface
#setController(Object)
,
#FwkMenuFactory
public java.lang.String getHelpID()
getHelpID
in interface FwkCommandInterface
setHelpID(String)
public FwkIconInterface getIcon()
getIcon
in interface FwkCommandInterface
getIcon
in interface FwkDescriptionInterface
getIcon
in class FwkDescription
setIconKey(String)
,
#setIconImage(Image)
,
#getIconfilename()
public java.lang.String getIconKey()
getIconKey
in interface FwkCommandInterface
getIconKey
in interface FwkDescriptionInterface
getIconKey
in class FwkDescription
#getIconImage()
public int getMnemonic()
getMnemonic
in interface FwkCommandInterface
public boolean getRadioGroupState()
getRadioGroupState
in interface FwkCommandInterface
setRadioGroupState(boolean)
public boolean getSensitivity()
getSensitivity
in interface FwkCommandInterface
setSensitivity(boolean)
public boolean getSeparator()
getSeparator
in interface FwkCommandInterface
setSeparator(boolean)
public java.lang.String getText()
getText
in interface FwkCommandInterface
setText(String)
,
getTextKey()
public java.lang.String getTextKey()
getTextKey
in interface FwkCommandInterface
setTextKey(String)
,
getText()
public boolean getToggle()
getToggle
in interface FwkCommandInterface
setToggle(boolean)
public boolean getToggleState()
getToggleState
in interface FwkCommandInterface
setToggleState(boolean)
public java.lang.String getToolTipKey()
getToolTipKey
in interface FwkCommandInterface
setToolTipKey(String)
,
getToolTipText()
public java.lang.String getToolTipText()
getToolTipText
in interface FwkCommandInterface
setToolTipText(String)
,
getToolTipKey()
public boolean getVisibility()
getVisibility
in interface FwkCommandInterface
setVisibility(boolean)
public void setToolBarEnabled(boolean flag)
setToolBarEnabled
in interface FwkCommandInterface
true
- If the command should be enabled for the toolbar.public boolean getToolBarEnabled()
getToolBarEnabled
in interface FwkCommandInterface
public boolean isParent()
isParent
in interface FwkCommandInterface
public void setAsParent()
setAsParent
in interface FwkCommandInterface
public void setCommandName(java.lang.String commandName)
setCommandName
in interface FwkCommandInterface
command
- The new command string of the command.getCommandName()
public void setController(FwkControllerInterface controller)
setController
in interface FwkControlledByInterface
controller
- The new controller of the command.getController()
,
#FwkMenuFactory
public void setHelpID(java.lang.String helpID)
setHelpID
in interface FwkCommandInterface
helpID
- The new helpID of the command.getHelpID()
public void setIcon(FwkIconInterface icon)
setIcon
in interface FwkCommandInterface
setIcon
in interface FwkDescriptionInterface
setIcon
in class FwkDescription
image
- The new icon of the command.#getIconImage()
,
#setIconfilename(String)
public void setIconKey(java.lang.String iconKey)
setIconKey
in interface FwkCommandInterface
setIconKey
in interface FwkDescriptionInterface
setIconKey
in class FwkDescription
iconKey
- The new icon property keyword.getIconKey()
,
getIcon()
public void setMenuEventEnabled(boolean flag)
setMenuEventEnabled
in interface FwkCommandInterface
flag
- if true the menu events are enabled.public boolean getMenuEventEnabled()
getMenuEventEnabled
in interface FwkCommandInterface
public boolean menuSelect(javax.swing.event.MenuEvent event, int reason)
menuSelect
in interface FwkCommandInterface
event
- The menueventreason
- The reson. Use predefined constants above.public void setMnemonic(int mnemonic)
setMnemonic
in interface FwkCommandInterface
mnemonic
- The new mnemonic of the command.getMnemonic()
public void setRadioGroupState(boolean flag)
setRadioGroupState
in interface FwkCommandInterface
flag
- true if command is a toggle.getRadioGroupState()
public void setSensitivity(boolean flag)
setSensitivity
in interface FwkCommandInterface
flag
- true if sensitive.getSensitivity()
public void setSeparator(boolean flag)
setSeparator
in interface FwkCommandInterface
flag
- true if separator.getSeparator()
public void setText(java.lang.String text)
setText
in interface FwkCommandInterface
text
- The new text of the command.getText()
,
setTextKey(String)
public void setTextKey(java.lang.String textKey)
setTextKey
in interface FwkCommandInterface
textKey
- The new text key of the command.getTextKey()
,
getText()
public void setToggle(boolean flag)
setToggle
in interface FwkCommandInterface
flag
- true if command is a toggle.getToggle()
public void setToggleState(boolean flag)
setToggleState
in interface FwkCommandInterface
flag
- true if command is a toggle.getToggle()
public void setToolTipText(java.lang.String toolTipText)
setToolTipText
in interface FwkCommandInterface
toolTipText
- The new tooltip text of the command.getToolTipText()
,
getToolTipKey()
public void setToolTipKey(java.lang.String toolTipKey)
setToolTipKey
in interface FwkCommandInterface
toolTipKey
- The new tooltip key of the command.getToolTipKey()
,
getToolTipText()
public void setVisibility(boolean flag)
setVisibility
in interface FwkCommandInterface
flag
- true if visible.getVisibility()
public void register(java.lang.Object obj)
register
in interface FwkCommandInterface
obj
- The object to be stored.public void unregister(java.lang.Object obj)
unregister
in interface FwkCommandInterface
obj
- The object to be unregistered,public java.util.Enumeration registeredObjects()
registeredObjects
in interface FwkCommandInterface
public int registrySize()
registrySize
in interface FwkCommandInterface
public boolean hasActionListeners()
hasActionListeners
in interface FwkCommandInterface
public boolean hasMenuListeners()
hasMenuListeners
in interface FwkCommandInterface
public FwkArrayInterface getActionListenerArray()
getActionListenerArray
in interface FwkCommandInterface
public FwkArrayInterface getMenuListenerArray()
getMenuListenerArray
in interface FwkCommandInterface
public void addActionListener(java.awt.event.ActionListener actionListener)
addActionListener
in interface FwkCommandInterface
actionListener
- The action listener to be added.public void addMenuListener(javax.swing.event.MenuListener menuListener)
addMenuListener
in interface FwkCommandInterface
menuListener
- The menu listener to be added.public void removeActionListener(java.awt.event.ActionListener actionListener)
removeActionListener
in interface FwkCommandInterface
actionListener
- The action listener to be removed.public void removeMenuListener(javax.swing.event.MenuListener menuListener)
removeMenuListener
in interface FwkCommandInterface
menuListener
- The menu listener to be removed.public boolean execute(java.util.EventObject ev)
execute
in interface FwkCommandInterface
ev
- The event that is the trigger of this command. May be nullpublic void addCommand(FwkCommandInterface command)
addCommand
in interface FwkInstructionInterface
command
- The command to be added.public void addCommand(int index, FwkCommandInterface command)
addCommand
in interface FwkInstructionInterface
index
- 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 FwkInstructionInterface
command
- The action command string.public FwkCommandInterface[] getCommands()
getCommands
in interface FwkInstructionInterface
public void removeCommand(FwkCommandInterface command)
removeCommand
in interface FwkInstructionInterface
command
- The sub-command to be removed.public void setCommands(FwkCommandInterface[] commands)
setCommands
in interface FwkInstructionInterface
commands
- An array containing all sub-Commands.addCommand(FwkCommand command)
public java.lang.Object getProperty(java.lang.String key)
getProperty
in interface FwkCommandInterface
key
- The property keyword.public java.util.Iterator getProperties()
getProperties
in interface FwkCommandInterface
public void setProperty(java.lang.String key, java.lang.Object value)
setProperty
in interface FwkCommandInterface
key
- The property keyword.object
- The property value.public boolean commandsAvailable()
commandsAvailable
in interface FwkInstructionInterface
public void clearCommands()
clearCommands
in interface FwkInstructionInterface
public void addToGroup(int index, java.lang.String groupIdent, java.lang.String commandName)
addToGroup
in interface FwkInstructionInterface
index
- 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 FwkInstructionInterface
groupIdent
- The string identified of the group.commandName
- The name of the command.public void deleteGroup(java.lang.String groupIdent)
deleteGroup
in interface FwkInstructionInterface
groupIdent
- The string identified of the group.public FwkCommandInterface[] getGroup(java.lang.String groupIdent)
getGroup
in interface FwkInstructionInterface
groupIdent
- The string identified of the group.public boolean groupExists(java.lang.String groupIdent)
groupExists
in interface FwkInstructionInterface
public void removeFromGroup(java.lang.String groupIdent, java.lang.String commandName)
removeFromGroup
in interface FwkInstructionInterface
groupIdent
- The string identified of the group.commandName
- The name of the command.public java.lang.String toString()
toString
in class FwkDescription
public void setButtonClass(java.lang.Class clazz)
setButtonClass
in interface FwkCommandInterface
the
- 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 FwkCommandInterface
public void setMenuItemClass(java.lang.Class clazz)
setMenuItemClass
in interface FwkCommandInterface
the
- menu item class to be used when creating a menu item out of the command.public java.lang.Class getMenuItemClass()
getMenuItemClass
in interface FwkCommandInterface