org.eclipse.emf.compare.ui.team
Class AbstractTeamHandler

java.lang.Object
  extended by org.eclipse.emf.compare.ui.team.AbstractTeamHandler
Direct Known Subclasses:
SubversiveTeamHandler

public abstract class AbstractTeamHandler
extends java.lang.Object

This abstract base class will be used to implement team handlers.

A Team Handler basically provides a way to load resources given a compare input created by a given team plug-in.

An example where such an handler is required is the comparison of models issued from XSD schemas by the subversive plug-in : if no specific handler is used, merging differences from those models will not be possible.


Field Summary
protected  org.eclipse.emf.ecore.resource.Resource ancestorResource
          This will hold the ancestor resource.
protected  org.eclipse.emf.ecore.resource.Resource leftResource
          This will hold the left resource.
protected  org.eclipse.emf.ecore.resource.Resource rightResource
          This will hold the right resource.
 
Constructor Summary
AbstractTeamHandler()
           
 
Method Summary
 org.eclipse.emf.ecore.resource.Resource getAncestorResource()
          This will be used by external classes when access to the ancestor resource is needed.
 org.eclipse.emf.ecore.resource.Resource getLeftResource()
          This will be used by external classes when access to the left resource is needed.
 org.eclipse.emf.ecore.resource.Resource getRightResource()
          This will be used by external classes when access to the right resource is needed.
 boolean isLeftRemote()
          This should be overriden to return false if the left loaded resource is local in order to enable the "copy right to left" merging actions.
 boolean isRightRemote()
          This should be overriden to return false if the right loaded resource is local in order to enable the "copy left to right" merging actions.
abstract  boolean loadResources(org.eclipse.compare.structuremergeviewer.ICompareInput input)
          This will load the resources this input holds if possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ancestorResource

protected org.eclipse.emf.ecore.resource.Resource ancestorResource
This will hold the ancestor resource.


leftResource

protected org.eclipse.emf.ecore.resource.Resource leftResource
This will hold the left resource.


rightResource

protected org.eclipse.emf.ecore.resource.Resource rightResource
This will hold the right resource.

Constructor Detail

AbstractTeamHandler

public AbstractTeamHandler()
Method Detail

getAncestorResource

public org.eclipse.emf.ecore.resource.Resource getAncestorResource()
This will be used by external classes when access to the ancestor resource is needed.

Returns:
The ancestor compared resource.

getLeftResource

public org.eclipse.emf.ecore.resource.Resource getLeftResource()
This will be used by external classes when access to the left resource is needed.

Returns:
The left compared resource.

getRightResource

public org.eclipse.emf.ecore.resource.Resource getRightResource()
This will be used by external classes when access to the right resource is needed.

Returns:
The right compared resource.

isLeftRemote

public boolean isLeftRemote()
This should be overriden to return false if the left loaded resource is local in order to enable the "copy right to left" merging actions.

Returns:
true if the left loaded resource is remote, false if is is a local resource.

isRightRemote

public boolean isRightRemote()
This should be overriden to return false if the right loaded resource is local in order to enable the "copy left to right" merging actions.

Returns:
true if the right loaded resource is remote, false if is is a local resource.

loadResources

public abstract boolean loadResources(org.eclipse.compare.structuremergeviewer.ICompareInput input)
                               throws java.io.IOException,
                                      org.eclipse.core.runtime.CoreException
This will load the resources this input holds if possible.

Implementing classes should load all three resources using the fields (left|right|ancestor)Resource. Resources need not be manually unloaded.

If the returned value is false, we'll simply try another team handler.

Parameters:
input - CompareInput which holds the resources to be loaded.
Returns:
true if the given models have been successfully loaded, false otherwise.
Throws:
java.io.IOException - Can be thrown if resource loading fails.
org.eclipse.core.runtime.CoreException - Can be thrown if resource loading fails.

Copyright 2006 IBM Corporation and others.
All Rights Reserved.