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
int EXCLUSIVE_MODE
int SHARED_MODE
int STARTED
int STOPPED
int SUSPENDED
int RESUMED
int currentState
ViewInterface[] views
Model[] models
Model temporaryModel
String masterCATletName
String startingLabel
int activationMode
PropertyChangeSupport support

Constructor Summary
Command()

Method Summary
void initialize()
void doCleanup()
void setMasterCATlet(ICATlet catlet)
ICATlet getMasterCATlet()
void setMasterViewer(ViewInterface viewer)
ViewInterface getMasterViewer()
void initBean()
void doStart()
void doStop()
void doSuspend()
void doResume()
void suspend()
void resume()
void start()
void stop()
void setModel(Model mdl)
void setView(ViewInterface view)
void runCommand()
void addCommandListener(CommandListener list)
void removeCommandListener(CommandListener list)
void fireCommandEvent(CommandEvent evt)
void addPropertyChangeListener(PropertyChangeListener l)
void removePropertyChangeListener(PropertyChangeListener l)
void firePropertyChangeEvent(PropertyChangeEvent evt)
void setMasterCATletName(String name)
String getMasterCATletName()
String getStartingLabel()
void setStartingLabel(String startingLabel)
boolean isValid()
String getName()
int getActivationMode()
void setActivationMode(int mode)
boolean isDeletable()
BeanInfo getCommandBeanInfo()
int getHelpID()


Field Detail

EXCLUSIVE_MODE

    int EXCLUSIVE_MODE
these fields define the activation mode of the command


SHARED_MODE

    int SHARED_MODE


STARTED

    int STARTED
these fields define the state of the command


STOPPED

    int STOPPED


SUSPENDED

    int SUSPENDED


RESUMED

    int RESUMED


currentState

    int currentState
Contains the current state of the command


views

    ViewInterface[] views
Views for this command


models

    Model[] models
Models for this command


temporaryModel

    Model temporaryModel


masterCATletName

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


startingLabel

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


activationMode

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


support

    PropertyChangeSupport support
A usefull support for propertyChangeEvent management


Constructor Detail

Command

    Command()

Default constructor


Method Detail

initialize

    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.


doCleanup

    void doCleanup()

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


setMasterCATlet

    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

getMasterCATlet

    ICATlet getMasterCATlet()

Returns the CATlet to which this command is associated

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

setMasterViewer

    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

getMasterViewer

    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

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

initBean

    void initBean()

initilializes the command's bean properties


doStart

    void doStart()

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


doStop

    void doStop()

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


doSuspend

    void doSuspend()

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


doResume

    void doResume()

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


suspend

    void suspend()

Suspends the command


resume

    void resume()

Resumes the command


start

    void start()

Starts the command


stop

    void stop()

Stops the command


setModel

    void setModel(Model mdl)

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


setView

    void setView(ViewInterface view)

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


runCommand

    void runCommand()

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


addCommandListener

    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.

removeCommandListener

    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.

fireCommandEvent

    void fireCommandEvent(CommandEvent evt)

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

Parameters:
evt
- The CommandEvent to fire.

addPropertyChangeListener

    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.

removePropertyChangeListener

    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.

firePropertyChangeEvent

    void firePropertyChangeEvent(PropertyChangeEvent evt)

Fires the specified property change event.

Parameters:
evt
- The PropertyChangeEvent to fire.

setMasterCATletName

    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()

getMasterCATletName

    String getMasterCATletName()

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

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

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 string label to set.

isValid

    boolean isValid()

Returns the command validity. Default implementation returns always true.

Returns:
true by default

getName

    String getName()

Returns the name of this command as defined inside its beaninfo


getActivationMode

    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

setActivationMode

    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

isDeletable

    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.

Returns:
true by default

getCommandBeanInfo

    BeanInfo getCommandBeanInfo()

Returns the BeanInfo of this command


getHelpID

    int getHelpID()

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



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