org.argouml.uml.ui
Class AbstractActionAddModelElement

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byorg.argouml.uml.ui.UMLAction
          extended byorg.argouml.uml.ui.UMLChangeAction
              extended byorg.argouml.uml.ui.AbstractActionAddModelElement
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable
Direct Known Subclasses:
ActionAddAssociationSpecification, ActionAddClassifierRoleBase, ActionAddExtendExtensionPoint, ActionAddInstanceClassifier, ActionAddMessagePredecessor

public abstract class AbstractActionAddModelElement
extends UMLChangeAction

Abstract action that is the parent to all add actions that add the modelelements via the UMLAddDialog.

Since:
Oct 2, 2002
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.AbstractAction
 
Field Summary
private  boolean _exclusive
           
private  boolean _multiSelect
           
private  java.lang.Object _target
           
 
Fields inherited from class org.argouml.uml.ui.UMLAction
cat, HAS_ICON, NO_ICON
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
protected AbstractActionAddModelElement()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Perform the work the action is supposed to do.
protected abstract  void doIt(java.util.Vector selected)
          The action that has to be done by Argouml after the user clicks ok in the UMLAddDialog.
protected abstract  java.util.Vector getChoices()
          Returns the choices the user has in the UMLAddDialog.
protected abstract  java.lang.String getDialogTitle()
          Returns the title of the dialog.
protected abstract  java.util.Vector getSelected()
          The modelelements allready selected BEFORE the dialog is shown.
protected  java.lang.Object getTarget()
          Returns the target.
 boolean isEnabled()
           
 boolean isExclusive()
          Returns the exclusive.
 boolean isMultiSelect()
          Returns the multiSelect.
 void setExclusive(boolean exclusive)
          Sets the exclusive.
 void setMultiSelect(boolean multiSelect)
          Sets the multiSelect.
 void setTarget(java.lang.Object target)
          Sets the target.
 
Methods inherited from class org.argouml.uml.ui.UMLAction
getMnemonic, getShortcut, getValue, markNeedsSave, putValue, shouldBeEnabled, stripJunk, updateEnabled, updateEnabled
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_target

private java.lang.Object _target

_multiSelect

private boolean _multiSelect

_exclusive

private boolean _exclusive
Constructor Detail

AbstractActionAddModelElement

protected AbstractActionAddModelElement()
Method Detail

getTarget

protected java.lang.Object getTarget()
Returns the target.

Returns:
MModelElement

setTarget

public void setTarget(java.lang.Object target)
Sets the target.

Parameters:
target - The target to set

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Description copied from class: UMLAction
Perform the work the action is supposed to do.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class UMLChangeAction
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

getChoices

protected abstract java.util.Vector getChoices()
Returns the choices the user has in the UMLAddDialog. The choices are depicted on the left side of the UMLAddDialog (sorry Arabic users) and can be moved via the buttons on the dialog to the right side. On the right side are the selected modelelements.

Returns:
Vector

getSelected

protected abstract java.util.Vector getSelected()
The modelelements allready selected BEFORE the dialog is shown.

Returns:
Vector

getDialogTitle

protected abstract java.lang.String getDialogTitle()
Returns the title of the dialog.

Returns:
String

doIt

protected abstract void doIt(java.util.Vector selected)
The action that has to be done by Argouml after the user clicks ok in the UMLAddDialog.

Parameters:
selected - The choices the user has selected in the UMLAddDialog

isExclusive

public boolean isExclusive()
Returns the exclusive.

Returns:
boolean

isMultiSelect

public boolean isMultiSelect()
Returns the multiSelect.

Returns:
boolean

setExclusive

public void setExclusive(boolean exclusive)
Sets the exclusive.

Parameters:
exclusive - The exclusive to set

setMultiSelect

public void setMultiSelect(boolean multiSelect)
Sets the multiSelect.

Parameters:
multiSelect - The multiSelect to set

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface javax.swing.Action
Overrides:
isEnabled in class UMLAction
See Also:
Action.isEnabled()


ArgoUML © 1996-2004 (20040316)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook