|
Eclipse Platform Release 3.3 |
|||||||||||
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
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 ValuesConstructor 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 IDisposable
public 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 IAdaptable
getAdapter
in class DocumentRangeNode
adapter
- the adapter class to look up
null
IAdaptable.getAdapter(Class)
protected void nodeChanged(DocumentRangeNode node)
IStructureCreator.save(IStructureComparator, Object)
when the
contents of a node have changed.
nodeChanged
in class DocumentRangeNode
node
- the changed nodepublic 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 IEditableContent
replace
in class DocumentRangeNode
public Image getImage()
ITypedElement
getImage
in interface ITypedElement
null
if this type of input has no imagepublic String getName()
ITypedElement
getName
in interface ITypedElement
public String getType()
ITypedElement
FOLDER_TYPE
.
The type is used for determining a suitable viewer for this object.
getType
in interface ITypedElement
public boolean isReadOnly()
IEditableContentExtension
isReadOnly
in interface IEditableContentExtension
isReadOnly
in class DocumentRangeNode
public IStatus validateEdit(Shell shell)
IEditableContentExtension
validateEdit
in interface IEditableContentExtension
validateEdit
in class DocumentRangeNode
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.