org.eclipse.corona.container.project.ui.builder
Class CollaborationResourceHandler

java.lang.Object
  extended by org.eclipse.corona.container.project.ui.builder.CollaborationResourceHandler
Direct Known Subclasses:
CommitEventHandler, ResourceFileHandler, ResourceFolderHandler, ResourceProjectHandler

public abstract class CollaborationResourceHandler
extends java.lang.Object


Field Summary
protected  org.eclipse.core.resources.IResourceDelta delta
           
protected  int deltaFlags
          Flags that indicate how the resource was changed
protected  int deltaKind
          The kind of change made to the resource
protected  org.eclipse.core.resources.IResource deltaResource
          Resource that was change
protected  boolean m_bCollaborationProject
          Flag that indicates if resource contained in a Corona Collaboration project
protected  ProjectEvent projectEvent
           
 
Constructor Summary
CollaborationResourceHandler(ICollaborationEventAdmin eventAdmin)
          Class constructor performs basic intializatio of the class instance.
 
Method Summary
protected  void buildEvent(org.eclipse.core.resources.IResource fileResource, java.lang.String eventType)
          Build the event properties required for a file event.
 java.lang.String getProjectGuid(org.eclipse.core.resources.IProject project)
          Gets a guid of project.
 void initProjectEvent(org.eclipse.core.resources.IProject project, java.lang.String eventType)
          Initializie the collaboration ProjectEvent
 void postEvent()
           
protected abstract  boolean processResourceChange()
          This method MUST be implemented by sub classes to process the folderresource change.
 boolean processResourceChange(org.eclipse.core.resources.IResourceDelta delta)
          Process the file resource change.
 void processResourceCommit(org.eclipse.core.resources.IResource resource)
           
 void processResourceCommit(org.eclipse.team.core.subscribers.ISubscriberChangeEvent delta)
           
 java.lang.String resourceIPathToURI(org.eclipse.core.runtime.IPath ipath)
          Convert the resource path to a URI
 void sendEvent()
          Send a Collaboration Event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delta

protected org.eclipse.core.resources.IResourceDelta delta

deltaResource

protected org.eclipse.core.resources.IResource deltaResource
Resource that was change


deltaKind

protected int deltaKind
The kind of change made to the resource


deltaFlags

protected int deltaFlags
Flags that indicate how the resource was changed


m_bCollaborationProject

protected boolean m_bCollaborationProject
Flag that indicates if resource contained in a Corona Collaboration project


projectEvent

protected ProjectEvent projectEvent
Constructor Detail

CollaborationResourceHandler

public CollaborationResourceHandler(ICollaborationEventAdmin eventAdmin)
Class constructor performs basic intializatio of the class instance.

Method Detail

buildEvent

protected void buildEvent(org.eclipse.core.resources.IResource fileResource,
                          java.lang.String eventType)
                   throws CoronaException
Build the event properties required for a file event.

Parameters:
eventType - Type of event properties to be built.
userProps - Additional user properties for the event.
Throws:
CoronaException - when initProjectEvent(IProject, String) method failes to initialize ProjectEvent.

processResourceChange

public boolean processResourceChange(org.eclipse.core.resources.IResourceDelta delta)
Process the file resource change.

Parameters:
delta - An IResourceDelta instance that describes the changes made to the project resource.

processResourceCommit

public void processResourceCommit(org.eclipse.team.core.subscribers.ISubscriberChangeEvent delta)

processResourceCommit

public void processResourceCommit(org.eclipse.core.resources.IResource resource)

processResourceChange

protected abstract boolean processResourceChange()
This method MUST be implemented by sub classes to process the folderresource change. The change can be determined by a combination of the m_ResourceDeltaKind and m_ResourceDeltaFlags fields. The method is called while the resource tree is locked, therefore changes to the resource may not be possible.


resourceIPathToURI

public java.lang.String resourceIPathToURI(org.eclipse.core.runtime.IPath ipath)
Convert the resource path to a URI

Parameters:
ipath - Path to the resource to be converted.
Returns:
The URI of the specified path.

initProjectEvent

public void initProjectEvent(org.eclipse.core.resources.IProject project,
                             java.lang.String eventType)
                      throws CoronaException
Initializie the collaboration ProjectEvent

Parameters:
project - The project connected with the event.
eventType -
userProps -
Throws:
CoronaException - when ProjectContextContainer cannot be found for given project.

getProjectGuid

public java.lang.String getProjectGuid(org.eclipse.core.resources.IProject project)
Gets a guid of project. The GUID can be later used to match projects among different workspaces. Current implementation takes versioning system identifier as a GUID.

Parameters:
project - The project for which the guid is required.
Returns:
The GUID or null if operation fails.

postEvent

public void postEvent()
See Also:
ICollaborationEventAdmin.postEvent(CollaborationEvent)

sendEvent

public void sendEvent()
Send a Collaboration Event.

See Also:
ICollaborationEventAdmin.sendEvent(CollaborationEvent)

Copyright 2006 IBM Corporation and others.
All Rights Reserved.