|
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.SharedDocumentAdapter
An implementation of ISharedDocumentAdapter
that provides default behavior for the
methods of that interface.
Clients may subclass this class.
Constructor Summary | |
---|---|
SharedDocumentAdapter()
|
Method Summary | |
---|---|
void |
connect(IDocumentProvider provider,
IEditorInput documentKey)
Connect the given element to its document provider. |
void |
disconnect(IDocumentProvider provider,
IEditorInput documentKey)
Disconnect the element from the document provider. |
void |
disconnect(Object element)
A helper disconnect method that looks up the appropriate key (using getDocumentKey(Object)
and the appropriate provider and calls disconnect(IDocumentProvider, IEditorInput) . |
IEditorInput |
getDocumentKey(Object element)
Default implementation of getDocumentKey(Object) that returns a
FileEditorInput for the element if the element adapts to IFile . |
static IDocumentProvider |
getDocumentProvider(IEditorInput input)
Return the document provider for the given editor input. |
protected void |
saveDocument(IDocumentProvider provider,
IEditorInput documentKey,
IDocument document,
boolean overwrite,
IProgressMonitor monitor)
A helper method to save a document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.compare.ISharedDocumentAdapter |
---|
flushDocument |
Constructor Detail |
public SharedDocumentAdapter()
Method Detail |
public static IDocumentProvider getDocumentProvider(IEditorInput input)
input
- the editor input
public void connect(IDocumentProvider provider, IEditorInput documentKey) throws CoreException
ISharedDocumentAdapter
connect
in interface ISharedDocumentAdapter
provider
- the document providerdocumentKey
- the element's key returned from ISharedDocumentAdapter.getDocumentKey(Object)
CoreException
- if connection was not possibleIDocumentProvider.connect(Object)
public void disconnect(IDocumentProvider provider, IEditorInput documentKey)
ISharedDocumentAdapter
disconnect
in interface ISharedDocumentAdapter
provider
- the document providerdocumentKey
- the element's key returned from ISharedDocumentAdapter.getDocumentKey(Object)
IDocumentProvider.disconnect(Object)
public IEditorInput getDocumentKey(Object element)
getDocumentKey(Object)
that returns a
FileEditorInput
for the element if the element adapts to IFile
.
getDocumentKey
in interface ISharedDocumentAdapter
element
- the element being queried for a shared document
null
ISharedDocumentAdapter.getDocumentKey(java.lang.Object)
protected void saveDocument(IDocumentProvider provider, IEditorInput documentKey, IDocument document, boolean overwrite, IProgressMonitor monitor) throws CoreException
provider
- the document providerdocumentKey
- the document keydocument
- the documentoverwrite
- indicates whether overwrite should be performed
while saving the given element if necessarymonitor
- a progress monitor
CoreException
public void disconnect(Object element)
ISharedDocumentAdapter
ISharedDocumentAdapter.getDocumentKey(Object)
and the appropriate provider and calls ISharedDocumentAdapter.disconnect(IDocumentProvider, IEditorInput)
.
disconnect
in interface ISharedDocumentAdapter
element
- the element that was used to previously connect to a documentIDocumentProvider.disconnect(Object)
|
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.