org.argouml.uml.ui
Class ActionRemoveFromModel
java.lang.Object
javax.swing.AbstractAction
org.argouml.uml.ui.UMLAction
org.argouml.uml.ui.ActionRemoveFromModel
- All Implemented Interfaces:
- Action, ActionListener, Cloneable, EventListener, Serializable
- public class ActionRemoveFromModel
- extends UMLAction
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
ActionRemoveFromModel
public ActionRemoveFromModel()
- Constructor.
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
- Returns:
- true if the action should be available.
- See Also:
UMLAction.shouldBeEnabled()
actionPerformed
public void actionPerformed(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 ActionListener
- Overrides:
actionPerformed
in class UMLAction
- See Also:
ActionListener.actionPerformed(ActionEvent)
getNewTarget
private Object getNewTarget(Object target)
- Gets the object that should be target after the given target is
deleted from the model.
- Parameters:
target
- the target to delete
- Returns:
- The object.
sureRemove
public static boolean sureRemove(Object target)
- A utility method that asks the user if he is sure to remove the selected
target.
- Parameters:
target
- the object that will be removed
- Returns:
- boolean
sureRemoveModelElement
public static boolean sureRemoveModelElement(Object me)
- An utility method that asks the user if he is sure to remove a selected
modelement.
- Parameters:
me
- the modelelement that may be removed
- Returns:
- boolean
- See Also:
sureRemove(Object)
getTargets
protected Object[] getTargets()
- Returns:
- the complete array of targets