org.argouml.uml.ui
Class ActionRemoveFromModel

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--org.argouml.uml.ui.UMLAction
              |
              +--org.argouml.uml.ui.UMLChangeAction
                    |
                    +--org.argouml.uml.ui.ActionRemoveFromModel
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable

public class ActionRemoveFromModel
extends UMLChangeAction

Action for removing (moving to trash) objects from the model. Objects can be: - Modelelements (NSUML) - Diagrams (argodiagram and it's children) The root model and the last diagram in the project can not be removed. The reason for this is to prevent problems updating the detailspane and the navpane. Besides that, it is not possible to make a new root model.

See Also:
Serialized Form

Field Summary
static ActionRemoveFromModel SINGLETON
           
 
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
  ActionRemoveFromModel()
           
protected ActionRemoveFromModel(boolean global)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          Moves the selected target to the trash bin.
protected  java.lang.Object[] getTargets()
           
 boolean shouldBeEnabled()
          Only disabled when nothing is selected.
static boolean sureRemove(java.lang.Object target)
          A utility method that asks the user if he is sure to remove the selected target.
 
Methods inherited from class org.argouml.uml.ui.UMLAction
getMnemonic, getShortcut, isEnabled, markNeedsSave, stripJunk, updateEnabled, updateEnabled
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLETON

public static ActionRemoveFromModel SINGLETON
Constructor Detail

ActionRemoveFromModel

public ActionRemoveFromModel()

ActionRemoveFromModel

protected ActionRemoveFromModel(boolean global)
Method Detail

shouldBeEnabled

public boolean shouldBeEnabled()
Only disabled when nothing is selected. Necessary to use since this option works via the menu too. A user cannot delete the last diagram. A user cannot delete the root model.

Overrides:
shouldBeEnabled in class UMLAction
See Also:
UMLAction.shouldBeEnabled()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Moves the selected target to the trash bin. Moves the selected target after the remove to the parent of the selected target (that is: the next level up in the navpane). In case of a diagram the selected target will be the next diagram in the list with diagrams.

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

sureRemove

public static boolean sureRemove(java.lang.Object target)
A utility method that asks the user if he is sure to remove the selected target.

Parameters:
target -
Returns:
boolean

getTargets

protected java.lang.Object[] getTargets()


ArgoUML © 1996-2003 (20040229)ArgoUML Project HomeArgoUML Cookbook