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

Framework : PortalBase

Module : PLBbase

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

activationMode

    protected int activationMode
The command mode of activation (shared or exclusive)


currentState

    protected int currentState
Contains the current state of the command


EXCLUSIVE_MODE

    public static final int EXCLUSIVE_MODE
these fields define the activation mode of the command


masterCATletName

    protected String masterCATletName
Name of the CATlet to which the command is attached


models

    protected Model[] models
Models for this command


RESUMED

    public static final int RESUMED


SHARED_MODE

    public static final int SHARED_MODE


STARTED

    public static final int STARTED
these fields define the state of the command


startingLabel

    protected String startingLabel
a label that can be displayed in a status bar when the command is started


STOPPED

    public static final int STOPPED


support

    protected PropertyChangeSupport support
A usefull support for propertyChangeEvent management


SUSPENDED

    public static final int SUSPENDED


temporaryModel

    protected Model temporaryModel


views

    protected ViewInterface[] views
Views for this command


Constructor Detail

Command

    Command()

Default constructor


Method Detail

addCommandListener

    public void addCommandListener(CommandListener list)

Adds the specified listener to receive command events from this command.

Parameters:
list
- a CommandListener that will be notified when the command state change.

addPropertyChangeListener

    public void addPropertyChangeListener(PropertyChangeListener l)

Adds the specified listener to receive property change events from this command.

Parameters:
l
- a PropertyChangeListener that will be notified when a property of the Command is modified.

doCleanup

    public final void doCleanup()

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


doResume

    public final void doResume()

Shouldn't be called. Use @see #resume() method instead Only called by the Command Selector


doStart

    public void doStart()

Shouldn't be called. Use @see #start() method instead. Only called by the Command Selector


doStop

    public void doStop()

Shouldn't be called. Use @see #stop() method instead Only called by the Command Selector


doSuspend

    public final void doSuspend()

Shouldn't be called. Use @see #suspend() method instead Only called by the Command Selector


fireCommandEvent

    public void fireCommandEvent(CommandEvent evt)

Fires an event to warn that a command has been selected or unselected

Parameters:
evt
- The CommandEvent to fire.

firePropertyChangeEvent

    public void firePropertyChangeEvent(PropertyChangeEvent evt)

Fires the specified property change event.

Parameters:
evt
- The PropertyChangeEvent to fire.

getActivationMode

    public int getActivationMode()

Returns the activation mode of this CATlet

See Also:
com.dassault_systemes.catweb.base.catlet.command.Command#EXCLUSIVE_MODE
com.dassault_systemes.catweb.base.catlet.command.Command#SHARED_MODE

getCommandBeanInfo

    protected BeanInfo getCommandBeanInfo()

Returns the BeanInfo of this command


getHelpID

    public int getHelpID()

Returns an id to retreive the help for this command By default, this method returns -1


getMasterCATlet

    public ICATlet getMasterCATlet()

Returns the CATlet to which this command is associated

Return:
com.dassault_systemes.catweb.base.catlet.ICATlet

getMasterCATletName

    public String getMasterCATletName()

Returns the name of the CATlet to which this command is associated

See Also:
com.dassault_systemes.catweb.base.catlet.ICATlet#getCATletName()

getMasterViewer

    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

Return:
com.dassault_systemes.catweb.base.catlet.view.ViewInterface

getName

    public String getName()

Returns the name of this command as defined inside its beaninfo


getStartingLabel

    public String getStartingLabel()

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


initBean

    public final void initBean()

initilializes the command's bean properties


initialize

    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.


isDeletable

    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.

Return:
true by default

isValid

    public boolean isValid()

Returns the command validity. Default implementation returns always true.

Return:
true by default

removeCommandListener

    public void removeCommandListener(CommandListener list)

Removes the specified listener so that it no longer receives command events from this command.

Parameters:
list
- The CommandListener to remove.

removePropertyChangeListener

    public void removePropertyChangeListener(PropertyChangeListener l)

Removes the specified listener so that it no longer receives property change events from this command.

Parameters:
l
- The PropertyChangeListener to remove.

resume

    public void resume()

Resumes the command


runCommand

    public void runCommand()

method called to instantiate interactively the command Used by Portal and not by Enovia


setActivationMode

    public void setActivationMode(int mode)

Sets the activation mode of this CATlet

Parameters:
mode
- The activation mode of the command
See Also:
com.dassault_systemes.catweb.base.catlet.command.Command#EXCLUSIVE_MODE
com.dassault_systemes.catweb.base.catlet.command.Command#SHARED_MODE

setMasterCATlet

    public void setMasterCATlet(ICATlet catlet)

Sets the CATlet to which this command is associated

Parameters:
catlet
- the ICATlet instance to which this command is associated
See Also:
com.dassault_systemes.catweb.base.catlet.ICATlet

setMasterCATletName

    public void setMasterCATletName(String name)

Sets the name of the CATlet to which this command is associated

Parameters:
name
- The name of the associated CATlet.
See Also:
com.dassault_systemes.catweb.base.catlet.ICATlet#getCATletName()

setMasterViewer

    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

Parameters:
viewer
- the ViewInterface instance to which this command is associated

setModel

    public void setModel(Model mdl)

Sets the Command model. May a model of the MasterCATlet Used by Portal and not by Enovia


setStartingLabel

    public void setStartingLabel(String startingLabel)

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

Parameters:
startingLabel
- The string label to set.

setView

    public void setView(ViewInterface view)

Sets the Command model. May a view of the MasterCATlet Used by Portal and not by Enovia


start

    public abstract void start()

Starts the command


stop

    public abstract void stop()

Stops the command


suspend

    public void suspend()

Suspends the command



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