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