Interface IStructureCreator2
-
- All Superinterfaces:
IStructureCreator
- All Known Implementing Classes:
StructureCreator
public interface IStructureCreator2 extends IStructureCreator
An extension to theIStructureCreatorinterface that supports the use of shared documents.This interface is not intended to be implemented by clients. Client should instead subclass
StructureCreator.- Since:
- 3.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ITypedElementcreateElement(Object element, Object input, IProgressMonitor monitor)Creates the single node specified by path from the given input object.IStructureComparatorcreateStructure(Object input, IProgressMonitor monitor)Creates a tree structure consisting ofIStructureComparators from the given object and returns its root object.voiddestroy(Object object)Release any resources associated with the given object.-
Methods inherited from interface org.eclipse.compare.structuremergeviewer.IStructureCreator
getContents, getName, getStructure, locate, save
-
-
-
-
Method Detail
-
createStructure
IStructureComparator createStructure(Object input, IProgressMonitor monitor) throws CoreException
Creates a tree structure consisting ofIStructureComparators from the given object and returns its root object. Implementing this method typically involves parsing the input object. In case of an error (e.g. a parsing error) the valuenullis returned.This method is equivalent to
IStructureCreator.getStructure(Object)with the exception that thedestroy(Object)method must be called with the returned comparator as a parameter when the comparator is no longer needed. This is done to allow structure creators to make use of shared resources such a file buffer.Also, the node returned from this method should adapt to an
ISharedDocumentAdapterif the provided input has a shared document adapter and it is being used by the this creator. The convenience classSharedDocumentAdapterWrapperis provided to allow the creator to wrap the adapter of the input so that the proper key can be returned.- Parameters:
input- the object from which to create the tree ofIStructureComparatormonitor- a progress monitor ornullif progress and cancelation is not required- Returns:
- the root node of the structure or
nullin case of error - Throws:
CoreException- See Also:
IStructureCreator.getStructure(Object),destroy(Object)
-
createElement
ITypedElement createElement(Object element, Object input, IProgressMonitor monitor) throws CoreException
Creates the single node specified by path from the given input object. This method is equivalent toIStructureCreator.locate(Object, Object)with the exception that thedestroy(Object)method must be called with the returned element as a parameter when the element is no longer needed. This is done to allow structure creators to make use of shared resources such a file buffer.- Parameters:
element- specifies a sub object within the input objectinput- the object from which to create theITypedElementmonitor- a progress monitor ornullif progress is not desired- Returns:
- the single node specified by
pathornull - Throws:
CoreException- if an error occurs while parsing the input- See Also:
IStructureCreator.locate(Object, Object),destroy(Object)
-
destroy
void destroy(Object object)
Release any resources associated with the given object. This method must be called for objects returned from eithercreateStructure(Object, IProgressMonitor)orcreateElement(Object, Object, IProgressMonitor).- Parameters:
object- the object to be destroyed- See Also:
createElement(Object, Object, IProgressMonitor),createStructure(Object, IProgressMonitor)
-
-