Eclipse Platform
2.1

org.eclipse.core.resources.team
Class TeamHook

java.lang.Object
  |
  +--org.eclipse.core.resources.team.TeamHook

public abstract class TeamHook
extends Object

A general hook class for operations that team providers may be interested in participating in. Implementors of the hook should provide a concrete subclass, and override any methods they are interested in.

This class is intended to be subclassed by the team component in conjunction with the org.eclipse.core.resources.teamHook standard extension point. Individual team providers may also subclass this class. It is not intended to be subclassed by other clients. The methods defined on this class are called from within the implementations of workspace API methods and must not be invoked directly by clients.

Since:
2.1

Constructor Summary
protected TeamHook()
          Creates a new team hook.
 
Method Summary
 IStatus validateCreateLink(IFile file, int updateFlags, IPath location)
          Validates whether a particular attempt at link creation is allowed.
 IStatus validateCreateLink(IFolder folder, int updateFlags, IPath location)
          Validates whether a particular attempt at link creation is allowed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TeamHook

protected TeamHook()
Creates a new team hook. Default constructor for use by subclasses and the resources plugin only.
Method Detail

validateCreateLink

public IStatus validateCreateLink(IFile file,
                                  int updateFlags,
                                  IPath location)
Validates whether a particular attempt at link creation is allowed. This gives team providers an opportunity to hook into the beginning of the implementation of IFile.createLink.

The implementation of this method runs "below" the resources API and is therefore very restricted in what resource API method it can call. The list of useable methods includes most resource operations that read but do not update the resource tree; resource operations that modify resources and trigger deltas must not be called from within the dynamic scope of the invocation of this method.

This method should be overridden by subclasses that want to control what links are created. The default implementation of this method allows all links to be created.

Parameters:
file - the file to be linked
updateFlags - bit-wise or of update flag constants (only ALLOW_MISSING_LOCAL is relevant here)
location - a file system path where the file should be linked
Returns:
a status object with code IStatus.OK if linking is allowed, otherwise a status object with severity IStatus.ERROR indicating why the creation is not allowed.
See Also:
IResource.ALLOW_MISSING_LOCAL

validateCreateLink

public IStatus validateCreateLink(IFolder folder,
                                  int updateFlags,
                                  IPath location)
Validates whether a particular attempt at link creation is allowed. This gives team providers an opportunity to hook into the beginning of the implementation of IFolder.createLink.

The implementation of this method runs "below" the resources API and is therefore very restricted in what resource API method it can call. The list of useable methods includes most resource operations that read but do not update the resource tree; resource operations that modify resources and trigger deltas must not be called from within the dynamic scope of the invocation of this method.

This method should be overridden by subclasses that want to control what links are created. The default implementation of this method allows all links to be created.

Parameters:
folder - the file to be linked
updateFlags - bit-wise or of update flag constants (only ALLOW_MISSING_LOCAL is relevant here)
location - a file system path where the folder should be linked
Returns:
a status object with code IStatus.OK if linking is allowed, otherwise a status object with severity IStatus.ERROR indicating why the creation is not allowed.
See Also:
IResource.ALLOW_MISSING_LOCAL

Eclipse Platform
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.