|
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.SharedDocumentAdapter
public abstract class 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 ISharedDocumentAdapter.getDocumentKey(Object)
and the appropriate provider and calls ISharedDocumentAdapter.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 ISharedDocumentAdapterprovider - 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 ISharedDocumentAdapterprovider - 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 ISharedDocumentAdapterelement - the element being queried for a shared document
nullISharedDocumentAdapter.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
CoreExceptionpublic void disconnect(Object element)
ISharedDocumentAdapterISharedDocumentAdapter.getDocumentKey(Object)
and the appropriate provider and calls ISharedDocumentAdapter.disconnect(IDocumentProvider, IEditorInput).
disconnect in interface ISharedDocumentAdapterelement - the element that was used to previously connect to a documentIDocumentProvider.disconnect(Object)
|
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.