|
|
|||||
| Package com.dassault_systemes.catweb.base.catlet.command |
Class Command
|
| Class Hierarchy |
java.lang.Object | +-com.dassault_systemes.catweb.base.catlet.command.Command
| Class Location |
| Class Description |
public abstract class Command
Abstract class for command object activation can be done interactively (from a commandselector) or non-interactively (from an external event)
All Implemented Interfaces: Controller
| Field Summary |
| protected int | activationMode
The command mode of activation (shared or exclusive) |
| protected int | currentState
Contains the current state of the command |
| public static final int | EXCLUSIVE_MODE
these fields define the activation mode of the command |
| protected String | masterCATletName
Name of the CATlet to which the command is attached |
| protected Model[] | models
Models for this command |
| public static final int | RESUMED
|
| public static final int | SHARED_MODE
|
| public static final int | STARTED
these fields define the state of the command |
| protected String | startingLabel
a label that can be displayed in a status bar when the command is started |
| public static final int | STOPPED
|
| protected PropertyChangeSupport | support
A usefull support for propertyChangeEvent management |
| public static final int | SUSPENDED
|
| protected Model | temporaryModel
|
| protected ViewInterface[] | views
Views for this command |
| Constructor Summary |
| Command()
Default constructor |
| Method Summary |
| public void | addCommandListener(CommandListener list)
Adds the specified listener to receive command events from this command. |
| public void | addPropertyChangeListener(PropertyChangeListener l)
Adds the specified listener to receive property change events from this command. |
| public final void | doCleanup()
Do inner cleanup then call the regular @see #cleanup() method - (final implementation) |
| public final void | doResume()
Shouldn't be called. |
| public void | doStart()
Shouldn't be called. |
| public void | doStop()
Shouldn't be called. |
| public final void | doSuspend()
Shouldn't be called. |
| public void | fireCommandEvent(CommandEvent evt)
Fires an event to warn that a command has been selected or unselected |
| public void | firePropertyChangeEvent(PropertyChangeEvent evt)
Fires the specified property change event. |
| public int | getActivationMode()
Returns the activation mode of this CATlet |
| protected BeanInfo | getCommandBeanInfo()
Returns the BeanInfo of this command |
| public int | getHelpID()
Returns an id to retreive the help for this command By default, this method returns -1 |
| public ICATlet | getMasterCATlet()
Returns the CATlet to which this command is associated |
| public String | getMasterCATletName()
Returns the name of the CATlet to which this command is associated |
| public ViewInterface | getMasterViewer()
Returns the Viewer to which this command is associated A command has a master viewer only if it comes from a viewer workshop |
| public String | getName()
Returns the name of this command as defined inside its beaninfo |
| public String | getStartingLabel()
Returns the label that will be printed in the status bar when command starts. |
| public final void | initBean()
initilializes the command's bean properties |
| public abstract void | initialize()
Initializes the Command. |
| public boolean | isDeletable()
Returns if the command is deletable or not. |
| public boolean | isValid()
Returns the command validity. |
| public void | removeCommandListener(CommandListener list)
Removes the specified listener so that it no longer receives command events from this command. |
| public void | removePropertyChangeListener(PropertyChangeListener l)
Removes the specified listener so that it no longer receives property change events from this command. |
| public void | resume()
Resumes the command |
| public void | runCommand()
method called to instantiate interactively the command Used by Portal and not by Enovia |
| public void | setActivationMode(int mode)
Sets the activation mode of this CATlet |
| public void | setMasterCATlet(ICATlet catlet)
Sets the CATlet to which this command is associated |
| public void | setMasterCATletName(String name)
Sets the name of the CATlet to which this command is associated |
| public void | setMasterViewer(ViewInterface viewer)
Sets the Viewer to which this command is associated A command has a master viewer only if it comes from a viewer workshop |
| public void | setModel(Model mdl)
Sets the Command model. |
| public void | setStartingLabel(String startingLabel)
Sets the label that will be printed in the status bar when command starts. |
| public void | setView(ViewInterface view)
Sets the Command model. |
| public abstract void | start()
Starts the command |
| public abstract void | stop()
Stops the command |
| public void | suspend()
Suspends the command |
| Field Detail |
protected int activationMode
The command mode of activation (shared or exclusive)
protected int currentState
Contains the current state of the command
public static final int EXCLUSIVE_MODE
these fields define the activation mode of the command
protected String masterCATletName
Name of the CATlet to which the command is attached
protected Model[] models
Models for this command
public static final int RESUMED
public static final int SHARED_MODE
public static final int STARTED
these fields define the state of the command
protected String startingLabel
a label that can be displayed in a status bar when the command is started
public static final int STOPPED
protected PropertyChangeSupport support
A usefull support for propertyChangeEvent management
public static final int SUSPENDED
protected Model temporaryModel
protected ViewInterface[] views
Views for this command
| Constructor Detail |
Command()
Default constructor
| Method Detail |
public void addCommandListener(CommandListener list)
Adds the specified listener to receive command events from this command.
list
public void addPropertyChangeListener(PropertyChangeListener l)
Adds the specified listener to receive property change events from this command.
l
public final void doCleanup()
Do inner cleanup then call the regular @see #cleanup() method - (final implementation)
public final void doResume()
Shouldn't be called. Use @see #resume() method instead
Only called by the Command Selector
public void doStart()
Shouldn't be called. Use @see #start() method instead.
Only called by the Command Selector
public void doStop()
Shouldn't be called. Use @see #stop() method instead
Only called by the Command Selector
public final void doSuspend()
Shouldn't be called. Use @see #suspend() method instead
Only called by the Command Selector
public void fireCommandEvent(CommandEvent evt)
Fires an event to warn that a command has been selected or unselected
evt
public void firePropertyChangeEvent(PropertyChangeEvent evt)
Fires the specified property change event.
evt
public int getActivationMode()
Returns the activation mode of this CATlet
protected BeanInfo getCommandBeanInfo()
Returns the BeanInfo of this command
public int getHelpID()
Returns an id to retreive the help for this command
By default, this method returns -1
public ICATlet getMasterCATlet()
Returns the CATlet to which this command is associated
public String getMasterCATletName()
Returns the name of the CATlet to which this command is associated
public ViewInterface getMasterViewer()
Returns the Viewer to which this command is associated
A command has a master viewer only if it comes from a viewer workshop
public String getName()
Returns the name of this command as defined inside its beaninfo
public String getStartingLabel()
Returns the label that will be printed in the status bar when command starts.
public final void initBean()
initilializes the command's bean properties
public abstract void initialize()
Initializes the Command.
It is a special state between constructed and started.
Must be implemented by the user
If the command need to subscribe to the Hookup, it is recommanded to do it here.
public boolean isDeletable()
Returns if the command is deletable or not.
By default, a command is created when started and destroyed when stopped. If you don't want
your command to be deleted when stopped, overload this method to make it return false.
public boolean isValid()
Returns the command validity.
Default implementation returns always true.
public void removeCommandListener(CommandListener list)
Removes the specified listener
so that it no longer receives command events from this command.
list
public void removePropertyChangeListener(PropertyChangeListener l)
Removes the specified listener
so that it no longer receives property change events from this command.
l
public void resume()
Resumes the command
public void runCommand()
method called to instantiate interactively the command
Used by Portal and not by Enovia
public void setActivationMode(int mode)
Sets the activation mode of this CATlet
mode
public void setMasterCATlet(ICATlet catlet)
Sets the CATlet to which this command is associated
catlet
public void setMasterCATletName(String name)
Sets the name of the CATlet to which this command is associated
name
public void setMasterViewer(ViewInterface viewer)
Sets the Viewer to which this command is associated
A command has a master viewer only if it comes from a viewer workshop
viewer
public void setModel(Model mdl)
Sets the Command model. May a model of the MasterCATlet
Used by Portal and not by Enovia
public void setStartingLabel(String startingLabel)
Sets the label that will be printed in the status bar when command starts.
startingLabel
public void setView(ViewInterface view)
Sets the Command model. May a view of the MasterCATlet
Used by Portal and not by Enovia
public abstract void start()
Starts the command
public abstract void stop()
Stops the command
public void suspend()
Suspends the command