|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.compare.structuremergeviewer.DocumentRangeNode
org.eclipse.compare.structuremergeviewer.StructureRootNode
public class StructureRootNode
A node that acts as the root of the tree returned from a StructureCreator.
This node performs the following tasks tasks:
ISharedDocumentAdapter that provides the proper
document key (@see getAdapter(Class)).IStructureCreator.save(IStructureComparator, Object)
when nodeChanged(DocumentRangeNode) is called.IDisposable provided in the constructor when
dispose() is called.This class may be subclassed by clients.
| Field Summary | |
|---|---|
static String |
ROOT_ID
The string constant (value "root") that is used as the id of the root node. |
static int |
ROOT_TYPE
The integer constant (value 0) that is used as the type code of the root node. |
| Fields inherited from interface org.eclipse.compare.ITypedElement |
|---|
FOLDER_TYPE, TEXT_TYPE, UNKNOWN_TYPE |
| Fields inherited from interface org.eclipse.compare.contentmergeviewer.IDocumentRange |
|---|
RANGE_CATEGORY |
| Constructor Summary | |
|---|---|
StructureRootNode(IDocument document,
Object input,
StructureCreator creator,
ISharedDocumentAdapter adapter)
Create the structure root node. |
|
| Method Summary | |
|---|---|
void |
dispose()
Disposes of this service. |
Object |
getAdapter(Class adapter)
Override IAdaptable.getAdapter(Class) in order to provide
an ISharedDocumentAdapter that provides the proper look up key based
on the input from which this structure node was created. |
Image |
getImage()
Returns an image for this object. |
String |
getName()
Returns the name of this object. |
String |
getType()
Returns the type of this object. |
boolean |
isReadOnly()
Return whether the typed element being displayed is read-only. a read-only element will require a call to validateEdit before the element can be modified on disk. |
protected void |
nodeChanged(DocumentRangeNode node)
Override in order to invoke IStructureCreator.save(IStructureComparator, Object) when the
contents of a node have changed. |
ITypedElement |
replace(ITypedElement child,
ITypedElement other)
This method is called on a parent to add or remove a child, or to copy the contents of a child. |
IStatus |
validateEdit(Shell shell)
If the element is read-only, this method should be called to attempt to make it writable. |
| Methods inherited from class org.eclipse.compare.structuremergeviewer.DocumentRangeNode |
|---|
addChild, equals, getAppendPosition, getCharset, getChildren, getContents, getDocument, getId, getParentNode, getRange, getTypeCode, hashCode, internalSetContents, isEditable, setAppendPosition, setContent, setId, setLength |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ROOT_TYPE
0) that is used as the type code of the root node.
DocumentRangeNode.getTypeCode(),
Constant Field Valuespublic static final String ROOT_ID
"root") that is used as the id of the root node.
DocumentRangeNode.getId(),
Constant Field Values| Constructor Detail |
|---|
public StructureRootNode(IDocument document,
Object input,
StructureCreator creator,
ISharedDocumentAdapter adapter)
document - the documentinput - the input associated with the documentcreator - the structure creator that is creating the nodeadapter - the shared document adapter from which the document was obtained or null
if the document was not obtained from an ISharedDocumentAdapter| Method Detail |
|---|
public void dispose()
IDisposable
dispose in interface IDisposablepublic Object getAdapter(Class adapter)
IAdaptable.getAdapter(Class) in order to provide
an ISharedDocumentAdapter that provides the proper look up key based
on the input from which this structure node was created.
getAdapter in interface IAdaptablegetAdapter in class DocumentRangeNodeadapter - the adapter class to look up
nullIAdaptable.getAdapter(Class)protected void nodeChanged(DocumentRangeNode node)
IStructureCreator.save(IStructureComparator, Object) when the
contents of a node have changed.
nodeChanged in class DocumentRangeNodenode - the changed node
public ITypedElement replace(ITypedElement child,
ITypedElement other)
IEditableContent| add: | dest == null | src != null |
| remove: | dest != null | src == null |
| copy: | dest != null | src != null |
replace in interface IEditableContentreplace in class DocumentRangeNodechild - the existing child of this object to be replaced; if null a new child can be added.other - the new child to be added or replaced; if null an existing child can be removed.
destpublic Image getImage()
ITypedElement
getImage in interface ITypedElementnull if this type of input has no imagepublic String getName()
ITypedElement
getName in interface ITypedElementpublic String getType()
ITypedElementFOLDER_TYPE.
The type is used for determining a suitable viewer for this object.
getType in interface ITypedElementpublic boolean isReadOnly()
IEditableContentExtension
isReadOnly in interface IEditableContentExtensionisReadOnly in class DocumentRangeNodepublic IStatus validateEdit(Shell shell)
IEditableContentExtension
validateEdit in interface IEditableContentExtensionvalidateEdit in class DocumentRangeNodeshell - a shell used to prompt the user if required.
OK if things are fine,
otherwise a status describing reasons why modifying the given files is not
reasonable. A status with a severity of CANCEL is returned
if the validation was canceled, indicating the edit should not proceed.
|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.