TPTP 4.3.0 Testing Tools Project
Public API Specification

org.eclipse.hyades.test.ui.navigator
Class CMNNamedElementProxyNode

java.lang.Object
  extended byorg.eclipse.hyades.test.ui.navigator.EObjectProxyNode
      extended byorg.eclipse.hyades.test.ui.navigator.CMNNamedElementProxyNode
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IProxy, IProxyNode, IProxyNodeRenamer
Direct Known Subclasses:
TypedElementProxyNode

public abstract class CMNNamedElementProxyNode
extends EObjectProxyNode
implements IProxyNodeRenamer

Since:

Constructor Summary
CMNNamedElementProxyNode(org.eclipse.emf.ecore.EObject eObject, java.lang.Object parent)
          Constructor
CMNNamedElementProxyNode(org.eclipse.ui.IMemento memento, java.lang.Object parent)
          Constructor used to load an already built proxy.
 
Method Summary
 java.lang.Object getAdapter(java.lang.Class adapter)
          For performance reason, EObjectProxyNode instances are not, by default, adaptable in EObject.
 java.lang.String getText()
          Returns the name of the named element given in the constructor.
 boolean isApplicableFor()
          Returns whether this renamer is applicable for the adapted proxy or not.
 boolean performRename(java.lang.String newName)
          Performs the actual rename task on proxy node and referenced object.
 RenamerUIStatus performUserInteraction(java.lang.String oldName)
          Performs the GUI interaction in order to get the new name.
protected  void setName(java.lang.String name)
          Setter for name.
 
Methods inherited from class org.eclipse.hyades.test.ui.navigator.EObjectProxyNode
getEObject, getIdentifier, getOriginatorURI, getParent, getUnderlyingResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.hyades.test.ui.navigator.IProxyNode
getChildren, getImage
 

Constructor Detail

CMNNamedElementProxyNode

public CMNNamedElementProxyNode(org.eclipse.ui.IMemento memento,
                                java.lang.Object parent)
Constructor used to load an already built proxy.

Parameters:
memento - the saved content of the proxy.
parent - the parent node of this proxy.

CMNNamedElementProxyNode

public CMNNamedElementProxyNode(org.eclipse.emf.ecore.EObject eObject,
                                java.lang.Object parent)
Constructor

Parameters:
eObject - the EMF named object to convert, the first argument should be a descendant of CMNNamedElement.
parent - its parent node.
Method Detail

getText

public java.lang.String getText()
Returns the name of the named element given in the constructor. This name is used as the text shown in the navigator.

Specified by:
getText in interface IProxyNode
Returns:
the name of the proxy.

setName

protected void setName(java.lang.String name)
Setter for name. Normally name is derived directly from the name of the CMNNamedElement, but in some cases it is useful to overload this behavior, for instance to decorate the given name with extra information.

Parameters:
name - the new name of the proxy.

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Description copied from class: EObjectProxyNode
For performance reason, EObjectProxyNode instances are not, by default, adaptable in EObject. Adaptation is delagated to the plateform adpater manager.

Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class EObjectProxyNode
See Also:
IAdaptable.getAdapter(java.lang.Class)

isApplicableFor

public boolean isApplicableFor()
Description copied from interface: IProxyNodeRenamer
Returns whether this renamer is applicable for the adapted proxy or not.

Specified by:
isApplicableFor in interface IProxyNodeRenamer
Returns:
true if rename can be done and false otherwise.
See Also:
IProxyNodeRenamer.isApplicableFor()

performRename

public boolean performRename(java.lang.String newName)
Description copied from interface: IProxyNodeRenamer
Performs the actual rename task on proxy node and referenced object.

Specified by:
performRename in interface IProxyNodeRenamer
Parameters:
newName - the new name of the proxy node.
Returns:
boolean whether test navigator should be refreshed after the rename is applied.
See Also:
IProxyNodeRenamer.performRename(java.lang.String)

performUserInteraction

public RenamerUIStatus performUserInteraction(java.lang.String oldName)
Description copied from interface: IProxyNodeRenamer
Performs the GUI interaction in order to get the new name. This method allows extenders to provide a specific GUI to retrieve the the new name (e.g. own dialog), but they can use the default behavior as well.

Specified by:
performUserInteraction in interface IProxyNodeRenamer
Parameters:
oldName - the string containing the current name before renaming.
Returns:
One instance of the the following subclasses of RenamerUIStatus class:
  • org.eclipse.hyades.test.ui.navigator.actions.RenamerUIOk: this means that rename action calls a specific GUI in order to get the new name and this GUI ends properly. The new name can be accessed through the RenameUIOK.getNewName(),
  • org.eclipse.hyades.test.ui.navigator.actions.RenamerUICancel: this means that rename action calls a specific GUI in order to get the new name and this GUI has been aborted by user. There is no new name set and the action needs to be aborted.
  • org.eclipse.hyades.test.ui.navigator.actions.RenamerUIInlineEditor: this means that rename action uses the default inline editor in order to get the new name. The name is internaly passed to the method IProxyNodeRenamer.performRename(String newName)
See Also:
IProxyNodeRenamer.performUserInteraction(java.lang.String)

TPTP 4.3.0 Testing Tools Project
Public API Specification