|
|
||||
| Package com.dassault_systemes.catweb.base.catlet.command |
Class CmdHeader
|
| Class Hierarchy |
java.lang.Object | +-com.dassault_systemes.catweb.base.catlet.command.CmdHeader
| Class Location |
| Class Description |
public class CmdHeader
The Default Command Header class.
All Implemented Interfaces: ActionListener PropertyChangeListener
| Field Summary |
| boolean | isSelected |
| boolean | isEnabled |
| Class | commandClass |
| Command | command |
| Vector | repList |
| Vector | repPool |
| String | startingLabel |
| String | name |
| String | userArgument |
| Class | menuRepClass |
| Class | toolbarRepClass |
| Class | ctxMenuRepClass |
| String | defAWTToolbarRepClassName |
| String | defAWTMenuRepClassName |
| String | defAWTCtxMenuRepClassName |
| Class | defAWTToolbarRepClass |
| Class | defAWTMenuRepClass |
| Class | defAWTCtxMenuRepClass |
| String | defSwingToolbarRepClassName |
| String | defSwingMenuRepClassName |
| String | defSwingCtxMenuRepClassName |
| Class | defSwingToolbarRepClass |
| Class | defSwingMenuRepClass |
| Class | defSwingCtxMenuRepClass |
| int | AWT_MODE |
| int | SWING_MODE |
| ICATlet | masterCATlet |
| ViewInterface | masterViewer |
| char | mnemonic |
| String | acceleratorStr |
| Object | accelerator |
| boolean | isVisible |
| Image[] | icons |
| Constructor Summary |
| CmdHeader() |
| Method Summary |
| Field Detail |
boolean isSelected
Are reps are selected
boolean isEnabled
Are reps are enabled
Class commandClass
The command class to instantiate
Command command
The instantiated command associated with this header
Vector repList
The list of rep currently displayed
Vector repPool
The list of rep instantiated but not displayed
String startingLabel
The label to display in the status bar when command is started
String name
This header name
String userArgument
This header user argument
Class menuRepClass
The classes to instantiate for reps
Class toolbarRepClass
Class ctxMenuRepClass
String defAWTToolbarRepClassName
default RepClass management: if RepClass is not explicitly set,
uses the default one (depending on the graphical mode)
String defAWTMenuRepClassName
String defAWTCtxMenuRepClassName
Class defAWTToolbarRepClass
Class defAWTMenuRepClass
Class defAWTCtxMenuRepClass
String defSwingToolbarRepClassName
String defSwingMenuRepClassName
String defSwingCtxMenuRepClassName
Class defSwingToolbarRepClass
Class defSwingMenuRepClass
Class defSwingCtxMenuRepClass
int AWT_MODE
int SWING_MODE
ICATlet masterCATlet
The CATlet which is associated with this CmdHeader
ViewInterface masterViewer
The header may be related to a ViewerCommand, in which case, there is a masterViewer
char mnemonic
A mnemonic for menu reps
String acceleratorStr
The tring represenattion of a shortcut for reps activation
Object accelerator
The shortcut object for reps activation
boolean isVisible
Header can be invisible (no representation ...)
Image[] icons
Icon (and eventually iconFocus) associated with the command
| Constructor Detail |
CmdHeader()
Default constructor
| Method Detail |
CmdHeader duplicate()
returns a copy of this
String toString()
returns a string representing this command header
void doCleanup()
Do inner cleanup then call the regular @see #cleanup() method - (final implementation)
void cleanup()
Called before the CmdHeader destruction.
Should be overriden for specific intern cleanup to be garbage collected.
boolean isSelected()
Returns the state of the reps. Reps are selected when command is started, unselected otherwise
void setSelected(boolean flag)
Sets the state of the reps
flag
boolean isEnabled()
Returns the state of the reps. Reps are enabled when command is valid
Given the context, a command may be started or not (in which case it is enabled or not)
void setEnabled(boolean flag)
Sets the state of all reps
flag
boolean isVisible()
Determines wether this haeder is visible
A header can have no representations. It is then considered as invisible
void setVisible(boolean flag)
Sets whether or not this header is visible .
flag
String getHeaderName()
Returns the name of the header.
void setHeaderName(String hdrName)
Sets the header name
hdrName
void setUserArgument(String userArgument)
Sets the user argument
userArgument
String getUserArgument()
Returns the user argument
void setMasterCATlet(ICATlet catlet)
Sets the CATlet to which this command is associated
During the CmdHeader creation, this is the last method called, so you are
sure that when this method is called, the CmdHeader has been fully initialized
catlet
ICATlet getMasterCATlet()
Returns the CATlet to which this command is associated
void setMasterViewer(ViewInterface viewer)
Sets the Viewer to which this command is associated
viewer
ViewInterface getMasterViewer()
Returns the Viwer to which this command is associated
Class getCommandClass()
Returns the command class this header will instantiate
String getCommandClassName()
Returns the class name of the command this header will instantiate
void setCommandClassName(String cmdClassName)
Sets the command class name for this header
it must be called just after the constructor when you use the Class.newInstance
cmdClassName
void setMenuRepClassName(String className)
Sets the class name of the menu rep this header will use
className
void setToolbarRepClassName(String className)
Sets the class name of the toolbar rep this header will use
className
void setCtxMenuRepClassName(String className)
Sets the class name of the contextual menu rep this header will use
className
void setDisplayMode(int mode)
sets the display mode (AWT_MODE or SWING_MODE)
int getDisplayMode()
returns the display mode
Class getMenuRepClass()
returns the MenuRepClass (or the default one if not set)
Class getToolbarRepClass()
returns the ToolbarRepClass (or the default one if not set)
Class getCtxMenuRepClass()
returns the CtxMenuRepClass (or the default one if not set)
String getStartingLabel()
Returns the label that will be printed in the status bar when command starts.
void setStartingLabel(String startingLabel)
Sets the label that will be printed in the status bar when command starts.
startingLabel
boolean isValid()
Returns the availability of the command. Given the context, a command may be available or
not. If not available, isValid() will return false and reps will be disabled
by default return true
void setValid(boolean valid)
Sets the headers validity.
valid
String getCommandName()
Returns the name of the command instantiated by this header as defined inside its beaninfo
String getCommandLongHelp()
Returns the long help associated with this command.
LongHelp is a value stored in the BeanDescriptor of the Command BeanInfo
String getCommandShortHelp()
Returns the short help associated with this command.
ShortHelp is a value stored in the BeanDescriptor of the Command BeanInfo
Image getCommandIcon()
Returns the icon of the command instantiated by this header as defined inside its beaninfo
Image[] getCommandIcons()
Returns the icons (default and focus) of the command instantiated by this
header as defined inside its beaninfo
void setCommandIcons(Image[] icons)
Sets the icons associated with the command
icons
void actionPerformed(ActionEvent evt)
Called when a rep of this command has been selected.
void startCommand()
Creates and Launches the associated Command
void propertyChange(PropertyChangeEvent evt)
Invoked when the command's state has changed.
This method implementation has been redirected to a inner class to prevend side effect
from application overwriting without calling the super method \
evt
void setMnemonic(char mnemonic)
Sets the mnemonic key for invoking the command
Deprecated. - Replaced by setAccelerator method
char getMnemonic()
Returns the mnemonic key of the command
Deprecated. - Replaced by getAccelerator method
void setAccelerator(String acceleratorStr)
Sets the accelerator keys for invoking the command
acceleratorStr
String getAccelerator()
Returns the accelerator keys of the command
boolean deleteCommandWhenStopped()
void cleanCommandInstance()
destroys the command instance
void newCommandInstance()
creates and initializes a new command instance