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
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
CmdHeader duplicate()
String toString()
void doCleanup()
void cleanup()
boolean isSelected()
void setSelected(boolean flag)
boolean isEnabled()
void setEnabled(boolean flag)
boolean isVisible()
void setVisible(boolean flag)
String getHeaderName()
void setHeaderName(String hdrName)
void setUserArgument(String userArgument)
String getUserArgument()
void setMasterCATlet(ICATlet catlet)
ICATlet getMasterCATlet()
void setMasterViewer(ViewInterface viewer)
ViewInterface getMasterViewer()
Class getCommandClass()
String getCommandClassName()
void setCommandClassName(String cmdClassName)
void setMenuRepClassName(String className)
void setToolbarRepClassName(String className)
void setCtxMenuRepClassName(String className)
void setDisplayMode(int mode)
int getDisplayMode()
Class getMenuRepClass()
Class getToolbarRepClass()
Class getCtxMenuRepClass()
String getStartingLabel()
void setStartingLabel(String startingLabel)
boolean isValid()
void setValid(boolean valid)
String getCommandName()
String getCommandLongHelp()
String getCommandShortHelp()
Image getCommandIcon()
Image[] getCommandIcons()
void setCommandIcons(Image[] icons)
void actionPerformed(ActionEvent evt)
void startCommand()
void propertyChange(PropertyChangeEvent evt)
void setMnemonic(char mnemonic)
char getMnemonic()
void setAccelerator(String acceleratorStr)
String getAccelerator()
boolean deleteCommandWhenStopped()
void cleanCommandInstance()
void newCommandInstance()


Field Detail

isSelected

    boolean isSelected
Are reps are selected


isEnabled

    boolean isEnabled
Are reps are enabled


commandClass

    Class commandClass
The command class to instantiate


command

    Command command
The instantiated command associated with this header


repList

    Vector repList
The list of rep currently displayed


repPool

    Vector repPool
The list of rep instantiated but not displayed


startingLabel

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


name

    String name
This header name


userArgument

    String userArgument
This header user argument


menuRepClass

    Class menuRepClass
The classes to instantiate for reps


toolbarRepClass

    Class toolbarRepClass


ctxMenuRepClass

    Class ctxMenuRepClass


defAWTToolbarRepClassName

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


defAWTMenuRepClassName

    String defAWTMenuRepClassName


defAWTCtxMenuRepClassName

    String defAWTCtxMenuRepClassName


defAWTToolbarRepClass

    Class defAWTToolbarRepClass


defAWTMenuRepClass

    Class defAWTMenuRepClass


defAWTCtxMenuRepClass

    Class defAWTCtxMenuRepClass


defSwingToolbarRepClassName

    String defSwingToolbarRepClassName


defSwingMenuRepClassName

    String defSwingMenuRepClassName


defSwingCtxMenuRepClassName

    String defSwingCtxMenuRepClassName


defSwingToolbarRepClass

    Class defSwingToolbarRepClass


defSwingMenuRepClass

    Class defSwingMenuRepClass


defSwingCtxMenuRepClass

    Class defSwingCtxMenuRepClass


AWT_MODE

    int AWT_MODE


SWING_MODE

    int SWING_MODE


masterCATlet

    ICATlet masterCATlet
The CATlet which is associated with this CmdHeader


masterViewer

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


mnemonic

    char mnemonic
A mnemonic for menu reps


acceleratorStr

    String acceleratorStr
The tring represenattion of a shortcut for reps activation


accelerator

    Object accelerator
The shortcut object for reps activation


isVisible

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


icons

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


Constructor Detail

CmdHeader

    CmdHeader()

Default constructor


Method Detail

duplicate

    CmdHeader duplicate()

returns a copy of this


toString

    String toString()

returns a string representing this command header


doCleanup

    void doCleanup()

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


cleanup

    void cleanup()

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


isSelected

    boolean isSelected()

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


setSelected

    void setSelected(boolean flag)

Sets the state of the reps

Parameters:
flag
- the new selection state to set.

isEnabled

    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)


setEnabled

    void setEnabled(boolean flag)

Sets the state of all reps

Parameters:
flag
- the new enable state to set.

isVisible

    boolean isVisible()

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


setVisible

    void setVisible(boolean flag)

Sets whether or not this header is visible .

Parameters:
flag
- the visible state to set.

getHeaderName

    String getHeaderName()

Returns the name of the header.


setHeaderName

    void setHeaderName(String hdrName)

Sets the header name

Parameters:
hdrName
- the name of the header to set

setUserArgument

    void setUserArgument(String userArgument)

Sets the user argument

Parameters:
userArgument
- the user argument to set

getUserArgument

    String getUserArgument()

Returns the user argument


setMasterCATlet

    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.

getMasterCATlet

    ICATlet getMasterCATlet()

Returns the CATlet to which this command is associated


setMasterViewer

    void setMasterViewer(ViewInterface viewer)

Sets the Viewer to which this command is associated

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

getMasterViewer

    ViewInterface getMasterViewer()

Returns the Viwer to which this command is associated


getCommandClass

    Class getCommandClass()

Returns the command class this header will instantiate


getCommandClassName

    String getCommandClassName()

Returns the class name of the command this header will instantiate


setCommandClassName

    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.

setMenuRepClassName

    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.

setToolbarRepClassName

    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.

setCtxMenuRepClassName

    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

    void setDisplayMode(int mode)

sets the display mode (AWT_MODE or SWING_MODE)


getDisplayMode

    int getDisplayMode()

returns the display mode


getMenuRepClass

    Class getMenuRepClass()

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


getToolbarRepClass

    Class getToolbarRepClass()

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


getCtxMenuRepClass

    Class getCtxMenuRepClass()

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


getStartingLabel

    String getStartingLabel()

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


setStartingLabel

    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.

isValid

    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


setValid

    void setValid(boolean valid)

Sets the headers validity.

Parameters:
valid
- The new valid state.

getCommandName

    String getCommandName()

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


getCommandLongHelp

    String getCommandLongHelp()

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


getCommandShortHelp

    String getCommandShortHelp()

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


getCommandIcon

    Image getCommandIcon()

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


getCommandIcons

    Image[] getCommandIcons()

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


setCommandIcons

    void setCommandIcons(Image[] icons)

Sets the icons associated with the command

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

actionPerformed

    void actionPerformed(ActionEvent evt)

Called when a rep of this command has been selected.


startCommand

    void startCommand()

Creates and Launches the associated Command


propertyChange

    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.

setMnemonic

    void setMnemonic(char mnemonic)

Sets the mnemonic key for invoking the command

Deprecated. - Replaced by setAccelerator method


getMnemonic

    char getMnemonic()

Returns the mnemonic key of the command

Deprecated. - Replaced by getAccelerator method


setAccelerator

    void setAccelerator(String acceleratorStr)

Sets the accelerator keys for invoking the command

Parameters:
acceleratorStr
- accelerator string for this command activation

getAccelerator

    String getAccelerator()

Returns the accelerator keys of the command


deleteCommandWhenStopped

    boolean deleteCommandWhenStopped()


cleanCommandInstance

    void cleanCommandInstance()

destroys the command instance


newCommandInstance

    void newCommandInstance()

creates and initializes a new command instance



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