org.argouml.uml.ui
Class ActionPaste

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byorg.argouml.uml.ui.ActionPaste
All Implemented Interfaces:
Action, ActionListener, CaretListener, Cloneable, EventListener, FocusListener, Serializable

public class ActionPaste
extends AbstractAction
implements CaretListener, FocusListener

Action to paste the content of either the GEF clipboard or the system clipboard. The action is enabled if there is content on either clipboard AND either the mouse hovers over the JGraph (the diagram) or the caret in a UMLTextField2 or UMLTextArea2 is enabled.

See Also:
Serialized Form

Field Summary
 
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
ActionPaste()
          Default constructor for action.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Copies some text or a fig.
 void caretUpdate(CaretEvent e)
           
 void focusGained(FocusEvent e)
           
 void focusLost(FocusEvent e)
           
static ActionPaste getInstance()
          Singleton implementation.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionPaste

public ActionPaste()
Default constructor for action. We cannot use UMLChangeAction as a parent for this class since it works with shouldBeEnabled etc. which doesn't give enough control about enabling/disabling this action.

Method Detail

getInstance

public static ActionPaste getInstance()
Singleton implementation.

Returns:
The singleton

actionPerformed

public void actionPerformed(ActionEvent ae)
Copies some text or a fig.

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

focusLost

public void focusLost(FocusEvent e)
Specified by:
focusLost in interface FocusListener
See Also:
FocusListener.focusLost(java.awt.event.FocusEvent)

caretUpdate

public void caretUpdate(CaretEvent e)
Specified by:
caretUpdate in interface CaretListener
See Also:
CaretListener.caretUpdate(javax.swing.event.CaretEvent)

focusGained

public void focusGained(FocusEvent e)
Specified by:
focusGained in interface FocusListener
See Also:
FocusListener.focusGained(java.awt.event.FocusEvent)


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook