TPTP 4.3.0 Testing Tools Project
Public API Specification

org.eclipse.hyades.test.ui.navigator
Interface IFileProxyManager


public interface IFileProxyManager

Manager for proxies built from file. This interface is not intended to be implemented by client.

Since:
4.0

Method Summary
 void cacheProxy(org.eclipse.core.resources.IFile file, IProxyNode proxy)
          Put the specified proxy in the cache so further calls to getProxy(IFile, Object) return in an efficient way the same cached proxy.
 IProxyNode findProxyByID(IProxyNode proxy, java.lang.String uid)
          Returns the proxy which has the given uid.
 IProxyNode getCorrespondingProxy(java.lang.Object object)
          Retrieves the node associated to the given object.
 IProxyNode getCorrespondingProxy(java.lang.String fileName, java.lang.String identifier)
          Retrieves the node using its underlying resource and its identifier.
 java.lang.Object getParent(IProxyNode proxy)
          Returns the parent of the given proxy node.
 IProxyNode getProxy(org.eclipse.core.resources.IFile file, java.lang.Object parent)
          Returns the proxy node corresponding to the given file.
 boolean isaCachedFile(org.eclipse.core.resources.IFile file)
          Returns whether the given file is already in the local proxy data base.
 IProxyNode uncacheProxy(org.eclipse.core.resources.IFile file)
          Removes the proxy entry associated to the given file.
 IProxyNode updateProxy(org.eclipse.core.resources.IFile file, java.lang.Object parent)
          Computes a new proxy using registered file proxy factories.
 

Method Detail

getProxy

public IProxyNode getProxy(org.eclipse.core.resources.IFile file,
                           java.lang.Object parent)
Returns the proxy node corresponding to the given file. The returned proxy is not automatically cached. If the caller intends to call this method with the same arguments, it should put the returned proxy in cache using cacheProxy().

Parameters:
file - the file to convert
parent - the parent of the proxy node in case of creation. This parameter may be null. In this case, this method will only return a proxy node already cached. If this parameter is not null, this method may instantiate the proxy it is not already cached and ensures that the returned proxy has parent as a parent.
Returns:
the IProxyNode matching with the given file or null if no factory can handle this file

cacheProxy

public void cacheProxy(org.eclipse.core.resources.IFile file,
                       IProxyNode proxy)
Put the specified proxy in the cache so further calls to getProxy(IFile, Object) return in an efficient way the same cached proxy.

Parameters:
file -

isaCachedFile

public boolean isaCachedFile(org.eclipse.core.resources.IFile file)
Returns whether the given file is already in the local proxy data base.

Parameters:
file -
Returns:
true if the given file exists as proxy and false otherwise

uncacheProxy

public IProxyNode uncacheProxy(org.eclipse.core.resources.IFile file)
Removes the proxy entry associated to the given file.

Parameters:
file -

getCorrespondingProxy

public IProxyNode getCorrespondingProxy(java.lang.Object object)
Retrieves the node associated to the given object. This parameter is adapted to a IProxy in order to retrieve the node representing it.

Parameters:
object - An object adaptable to IProxy.
Returns:
the proxy associated to the given object or null if such proxy node does not exist.

getCorrespondingProxy

public IProxyNode getCorrespondingProxy(java.lang.String fileName,
                                        java.lang.String identifier)
Retrieves the node using its underlying resource and its identifier.

Parameters:
fileName - name of the underlying resource of the searched proxy
identifier - identifier of the searched proxy
Returns:
a proxy node or null if not found.

findProxyByID

public IProxyNode findProxyByID(IProxyNode proxy,
                                java.lang.String uid)
Returns the proxy which has the given uid. This search starts from the given proxy node and cross its complete sub tree of proxies.

Parameters:
proxy - root of the proxy tree where the search is done.
uid - the uid of the searched proxy.
Returns:
a proxy node which has the given uid or null if there is no such proxy found in the complete given tree of proxy.

updateProxy

public IProxyNode updateProxy(org.eclipse.core.resources.IFile file,
                              java.lang.Object parent)
Computes a new proxy using registered file proxy factories. This method updates the cached proxy for the given file

Parameters:
file - the file from which the proxy is derived.
parent - the parent node to pass to the factory.
Returns:
the proxy associated to the given file.

getParent

public java.lang.Object getParent(IProxyNode proxy)
Returns the parent of the given proxy node.

Parameters:
proxy - a proxy node
Returns:
the parent of the given proxy node or null if this proxy node has not been cached.
Since:
4.2

TPTP 4.3.0 Testing Tools Project
Public API Specification