de.uni_paderborn.fujaba.coobra.actions
Class PasteAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byde.uni_paderborn.fujaba.coobra.actions.PasteAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, de.tu_bs.coobra.CopyManager.CopyChangeCallbackInterface, java.util.EventListener, java.io.Serializable

public class PasteAction
extends javax.swing.AbstractAction
implements de.tu_bs.coobra.CopyManager.CopyChangeCallbackInterface

Paste some ASGElements via CoObRA

Version:
$Revision: 1.11 $
Author:
$Author: zuendorf $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.AbstractAction
 
Field Summary
private  CopyAction.CopyData copyData
          data for copying
private  de.tu_bs.coobra.CopyManager copyManager
          No comment provided by developer, please add a comment to improve documentation.
private  java.util.Map newNames
          map for new object name (ASGElement, "newName")
 
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
PasteAction()
          Defines an Action object with a default description string and default icon.
PasteAction(CopyAction.CopyData copyData)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Invoked when the action occurs.
private  boolean askForAttrNames(FElement pasteTarget)
          display a dialog to enter a new name for all copied methods
private  boolean askForClassNames()
          display a dialog to enter a new name for all methods when pasting into a not copied class
private  boolean askForMethodNames(FElement pasteTarget)
          display a dialog to enter a new name for all copied methods
 CopyAction.CopyData getCopyData()
           
private  boolean isNameOk(java.lang.String newName, FAttr attr, FElement pasteTarget)
          checks wether the name for an attribute is unique and not empty
private  boolean isNameOk(java.lang.String newName, FMethod method, FElement pasteTarget)
          checks wether the name for a method is unique and not empty
 java.util.List paste(FElement pasteTarget)
          No comment provided by developer, please add a comment to improve documentation.
 java.util.List paste(FElement pasteTarget, boolean doUpdateDisplay)
          No comment provided by developer, please add a comment to improve documentation.
 void reviewCopiedChange(de.tu_bs.coobra.MutableObjectChange change)
          called upon copy of each ObjectChange to provide an ability to alter the copied data
 
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
 

Field Detail

newNames

private java.util.Map newNames
map for new object name (ASGElement, "newName")


copyData

private CopyAction.CopyData copyData
data for copying


copyManager

private de.tu_bs.coobra.CopyManager copyManager
No comment provided by developer, please add a comment to improve documentation.

Constructor Detail

PasteAction

public PasteAction()
Defines an Action object with a default description string and default icon.


PasteAction

public PasteAction(CopyAction.CopyData copyData)
Parameters:
copyData - what data to use for pasting
Method Detail

getCopyData

public CopyAction.CopyData getCopyData()
Returns:
the data for copying the objects

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Invoked when the action occurs.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - event that caused the action

paste

public java.util.List paste(FElement pasteTarget)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
pasteTarget - No description provided
Returns:
No description provided

paste

public java.util.List paste(FElement pasteTarget,
                            boolean doUpdateDisplay)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
pasteTarget - No description provided
doUpdateDisplay - No description provided
Returns:
No description provided

askForAttrNames

private boolean askForAttrNames(FElement pasteTarget)
display a dialog to enter a new name for all copied methods

Parameters:
pasteTarget - No description provided
Returns:
false when user clicked cancel

isNameOk

private boolean isNameOk(java.lang.String newName,
                         FAttr attr,
                         FElement pasteTarget)
checks wether the name for an attribute is unique and not empty

Parameters:
newName - name to be checked
attr - attr that will get the name
pasteTarget - No description provided
Returns:
true when ok

askForMethodNames

private boolean askForMethodNames(FElement pasteTarget)
display a dialog to enter a new name for all copied methods

Parameters:
pasteTarget - No description provided
Returns:
false when user clicked cancel

isNameOk

private boolean isNameOk(java.lang.String newName,
                         FMethod method,
                         FElement pasteTarget)
checks wether the name for a method is unique and not empty

Parameters:
newName - name to be checked
method - method that will get the name
pasteTarget - No description provided
Returns:
true when ok

askForClassNames

private boolean askForClassNames()
display a dialog to enter a new name for all methods when pasting into a not copied class

Returns:
false when the user clicked cancel

reviewCopiedChange

public void reviewCopiedChange(de.tu_bs.coobra.MutableObjectChange change)
called upon copy of each ObjectChange to provide an ability to alter the copied data

Specified by:
reviewCopiedChange in interface de.tu_bs.coobra.CopyManager.CopyChangeCallbackInterface
Parameters:
change - values of the copied ObjectChange