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

Framework : PortalBase

Module : PLBbase

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

accelerator

    protected Object accelerator
The shortcut object for reps activation


acceleratorStr

    protected String acceleratorStr
The tring represenattion of a shortcut for reps activation


AWT_MODE

    public static final int AWT_MODE


command

    protected Command command
The instantiated command associated with this header


commandClass

    protected Class commandClass
The command class to instantiate


ctxMenuRepClass

    protected Class ctxMenuRepClass


defAWTCtxMenuRepClass

    protected static Class defAWTCtxMenuRepClass


defAWTCtxMenuRepClassName

    public static String defAWTCtxMenuRepClassName


defAWTMenuRepClass

    protected static Class defAWTMenuRepClass


defAWTMenuRepClassName

    public static String defAWTMenuRepClassName


defAWTToolbarRepClass

    protected static Class defAWTToolbarRepClass


defAWTToolbarRepClassName

    public static String defAWTToolbarRepClassName
default RepClass management: if RepClass is not explicitly set, uses the default one (depending on the graphical mode)


defSwingCtxMenuRepClass

    protected static Class defSwingCtxMenuRepClass


defSwingCtxMenuRepClassName

    public static String defSwingCtxMenuRepClassName


defSwingMenuRepClass

    protected static Class defSwingMenuRepClass


defSwingMenuRepClassName

    public static String defSwingMenuRepClassName


defSwingToolbarRepClass

    protected static Class defSwingToolbarRepClass


defSwingToolbarRepClassName

    public static String defSwingToolbarRepClassName


icons

    protected Image[] icons
Icon (and eventually iconFocus) associated with the command


isEnabled

    protected boolean isEnabled
Are reps are enabled


isSelected

    protected boolean isSelected
Are reps are selected


isVisible

    protected boolean isVisible
Header can be invisible (no representation ...)


masterCATlet

    protected ICATlet masterCATlet
The CATlet which is associated with this CmdHeader


masterViewer

    protected ViewInterface masterViewer
The header may be related to a ViewerCommand, in which case, there is a masterViewer


menuRepClass

    protected Class menuRepClass
The classes to instantiate for reps


mnemonic

    protected char mnemonic
A mnemonic for menu reps


name

    protected String name
This header name


repList

    protected Vector repList
The list of rep currently displayed


repPool

    protected Vector repPool
The list of rep instantiated but not displayed


startingLabel

    protected String startingLabel
The label to display in the status bar when command is started


SWING_MODE

    public static final int SWING_MODE


toolbarRepClass

    protected Class toolbarRepClass


userArgument

    protected String userArgument
This header user argument


Constructor Detail

CmdHeader

    CmdHeader()

Default constructor


Method Detail

actionPerformed

    public void actionPerformed(ActionEvent evt)

Called when a rep of this command has been selected.


cleanCommandInstance

    protected void cleanCommandInstance()

destroys the command instance


cleanup

    public void cleanup()

Called before the CmdHeader destruction. Should be overriden for specific intern cleanup to be garbage collected.


deleteCommandWhenStopped

    protected boolean deleteCommandWhenStopped()


doCleanup

    public final void doCleanup()

Do inner cleanup then call the regular @see #cleanup() method - (final implementation)


duplicate

    public CmdHeader duplicate()

returns a copy of this


getAccelerator

    public String getAccelerator()

Returns the accelerator keys of the command


getCommandClass

    public Class getCommandClass()

Returns the command class this header will instantiate


getCommandClassName

    public String getCommandClassName()

Returns the class name of the command this header will instantiate


getCommandIcon

    public Image getCommandIcon()

Returns the icon of the command instantiated by this header as defined inside its beaninfo


getCommandIcons

    public Image[] getCommandIcons()

Returns the icons (default and focus) of the command instantiated by this header as defined inside its beaninfo


getCommandLongHelp

    public String getCommandLongHelp()

Returns the long help associated with this command. LongHelp is a value stored in the BeanDescriptor of the Command BeanInfo


getCommandName

    public String getCommandName()

Returns the name of the command instantiated by this header as defined inside its beaninfo


getCommandShortHelp

    public String getCommandShortHelp()

Returns the short help associated with this command. ShortHelp is a value stored in the BeanDescriptor of the Command BeanInfo


getCtxMenuRepClass

    protected Class getCtxMenuRepClass()

returns the CtxMenuRepClass (or the default one if not set)


getDisplayMode

    public int getDisplayMode()

returns the display mode


getHeaderName

    public String getHeaderName()

Returns the name of the header.


getMasterCATlet

    public ICATlet getMasterCATlet()

Returns the CATlet to which this command is associated


getMasterViewer

    public ViewInterface getMasterViewer()

Returns the Viwer to which this command is associated


getMenuRepClass

    protected Class getMenuRepClass()

returns the MenuRepClass (or the default one if not set)


getMnemonic

    public char getMnemonic()

Returns the mnemonic key of the command

Deprecated. - Replaced by getAccelerator method


getStartingLabel

    public String getStartingLabel()

Returns the label that will be printed in the status bar when command starts.


getToolbarRepClass

    protected Class getToolbarRepClass()

returns the ToolbarRepClass (or the default one if not set)


getUserArgument

    public String getUserArgument()

Returns the user argument


isEnabled

    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)


isSelected

    public boolean isSelected()

Returns the state of the reps. Reps are selected when command is started, unselected otherwise


isValid

    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


isVisible

    public boolean isVisible()

Determines wether this haeder is visible A header can have no representations. It is then considered as invisible


newCommandInstance

    protected final void newCommandInstance()

creates and initializes a new command instance


propertyChange

    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 \

Parameters:
evt
- The PropertyChangeEvent to fire.

setAccelerator

    public void setAccelerator(String acceleratorStr)

Sets the accelerator keys for invoking the command

Parameters:
acceleratorStr
- accelerator string for this command activation

setCommandClassName

    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

Parameters:
cmdClassName
- The class name of the command.

setCommandIcons

    public void setCommandIcons(Image[] icons)

Sets the icons associated with the command

Parameters:
icons
- the icon array associated with this command represenation

setCtxMenuRepClassName

    public void setCtxMenuRepClassName(String className)

Sets the class name of the contextual menu rep this header will use

Parameters:
className
- The class name of the contextual menu representation.

setDisplayMode

    public void setDisplayMode(int mode)

sets the display mode (AWT_MODE or SWING_MODE)


setEnabled

    public void setEnabled(boolean flag)

Sets the state of all reps

Parameters:
flag
- the new enable state to set.

setHeaderName

    public void setHeaderName(String hdrName)

Sets the header name

Parameters:
hdrName
- the name of the header to set

setMasterCATlet

    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

Parameters:
catlet
- the ICATlet instance associated with this CmdHeader.

setMasterViewer

    public void setMasterViewer(ViewInterface viewer)

Sets the Viewer to which this command is associated

Parameters:
viewer
- the ViewInterface instance associated with this CmdHeader.

setMenuRepClassName

    public void setMenuRepClassName(String className)

Sets the class name of the menu rep this header will use

Parameters:
className
- The class name of the graphic menu representation.

setMnemonic

    public void setMnemonic(char mnemonic)

Sets the mnemonic key for invoking the command

Deprecated. - Replaced by setAccelerator method


setSelected

    public void setSelected(boolean flag)

Sets the state of the reps

Parameters:
flag
- the new selection state to set.

setStartingLabel

    public void setStartingLabel(String startingLabel)

Sets the label that will be printed in the status bar when command starts.

Parameters:
startingLabel
- The text set in the starting label.

setToolbarRepClassName

    public void setToolbarRepClassName(String className)

Sets the class name of the toolbar rep this header will use

Parameters:
className
- The class name of the toolbar representation.

setUserArgument

    public void setUserArgument(String userArgument)

Sets the user argument

Parameters:
userArgument
- the user argument to set

setValid

    public void setValid(boolean valid)

Sets the headers validity.

Parameters:
valid
- The new valid state.

setVisible

    public void setVisible(boolean flag)

Sets whether or not this header is visible .

Parameters:
flag
- the visible state to set.

startCommand

    public void startCommand()

Creates and Launches the associated Command


toString

    public String toString()

returns a string representing this command header



Copyright © 2000, Dassault Systèmes. All rights reserved