TPTP 4.3.0 Testing Tools Project
Public API Specification

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

java.lang.Object
  extended byorg.eclipse.hyades.test.ui.navigator.FileProxyNode
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IProxy, IProxyNode, IProxyNodeRenamer

public abstract class FileProxyNode
extends java.lang.Object
implements IProxyNode, IProxyNodeRenamer

File proxy node. This class is dedicated to wrap physical file into proxy

Since:
3.2

Constructor Summary
FileProxyNode(org.eclipse.core.resources.IFile file)
          Constructor to create a proxy from a physical file.
 
Method Summary
 java.lang.Object getAdapter(java.lang.Class adapter)
          This proxy is adaptable in IResource if it has been placed instead of a file.
 org.eclipse.core.resources.IFile getFile()
          Return the associated file
 java.lang.String getIdentifier()
          A file proxy node is by definition a root level node, its identifier is empty.
 org.eclipse.swt.graphics.Image getImage()
          Returns the icon of the proxy, by default, the standard eclipse file icon is used.
 java.lang.Object getParent()
          Returns the parent object of this node.
 java.lang.String getText()
          Retruns the name of the file as the name of the proxy node.
 org.eclipse.core.resources.IResource getUnderlyingResource()
          The underlying resource of a file proxy node is the file itself.
 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.
 
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
 

Constructor Detail

FileProxyNode

public FileProxyNode(org.eclipse.core.resources.IFile file)
Constructor to create a proxy from a physical file.

Parameters:
file - a physical file
Method Detail

getText

public java.lang.String getText()
Retruns the name of the file as the name of the proxy node.

Specified by:
getText in interface IProxyNode
Returns:
the text label of the proxy node.

getImage

public org.eclipse.swt.graphics.Image getImage()
Returns the icon of the proxy, by default, the standard eclipse file icon is used.

Specified by:
getImage in interface IProxyNode
Returns:
the icon of the proxy.

getParent

public java.lang.Object getParent()
Description copied from interface: IProxyNode
Returns the parent object of this node.

Specified by:
getParent in interface IProxyNode
Returns:
the parent of this node.
See Also:
IProxyNode.getParent()

getFile

public org.eclipse.core.resources.IFile getFile()
Return the associated file

Returns:
the associated file

getIdentifier

public java.lang.String getIdentifier()
A file proxy node is by definition a root level node, its identifier is empty.

Specified by:
getIdentifier in interface IProxy
Returns:
an empty string.

getUnderlyingResource

public org.eclipse.core.resources.IResource getUnderlyingResource()
The underlying resource of a file proxy node is the file itself.

Specified by:
getUnderlyingResource in interface IProxy
Returns:
the file itself.

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
This proxy is adaptable in IResource if it has been placed instead of a file.

Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable

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