|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.ui.texteditor.AbstractDocumentProvider
org.eclipse.ui.editors.text.StorageDocumentProvider
org.eclipse.ui.editors.text.FileDocumentProvider
org.eclipse.xtext.ui.editor.model.XtextDocumentProvider
public class XtextDocumentProvider
| Nested Class Summary | |
|---|---|
class |
XtextDocumentProvider.UnchangedElementListener
|
| Nested classes/interfaces inherited from class org.eclipse.ui.editors.text.FileDocumentProvider |
|---|
org.eclipse.ui.editors.text.FileDocumentProvider.FileInfo, org.eclipse.ui.editors.text.FileDocumentProvider.FileSynchronizer, org.eclipse.ui.editors.text.FileDocumentProvider.SafeChange |
| Nested classes/interfaces inherited from class org.eclipse.ui.editors.text.StorageDocumentProvider |
|---|
org.eclipse.ui.editors.text.StorageDocumentProvider.StorageInfo |
| Nested classes/interfaces inherited from class org.eclipse.ui.texteditor.AbstractDocumentProvider |
|---|
org.eclipse.ui.texteditor.AbstractDocumentProvider.DocumentProviderOperation, org.eclipse.ui.texteditor.AbstractDocumentProvider.ElementInfo |
| Field Summary |
|---|
| Fields inherited from class org.eclipse.ui.editors.text.StorageDocumentProvider |
|---|
DEFAULT_FILE_SIZE |
| Fields inherited from class org.eclipse.ui.texteditor.AbstractDocumentProvider |
|---|
PR10806_UC5_ENABLED, PR14469_ENABLED, STATUS_ERROR, STATUS_OK |
| Constructor Summary | |
|---|---|
XtextDocumentProvider()
|
|
| Method Summary | |
|---|---|
protected void |
addUnchangedElementListeners(java.lang.Object element,
org.eclipse.ui.texteditor.AbstractDocumentProvider.ElementInfo info)
Called on initial creation and when the dirty state of the element changes to false. |
protected org.eclipse.jface.text.source.IAnnotationModel |
createAnnotationModel(java.lang.Object element)
Creates an annotation model for the given element. |
protected org.eclipse.jface.text.IDocument |
createDocument(java.lang.Object element)
Creates the document for the given element. |
protected org.eclipse.ui.texteditor.AbstractDocumentProvider.ElementInfo |
createElementInfo(java.lang.Object element)
Creates a new element info object for the given element. |
protected XtextDocument |
createEmptyDocument()
Factory method for creating empty documents. |
protected void |
disposeElementInfo(java.lang.Object element,
org.eclipse.ui.texteditor.AbstractDocumentProvider.ElementInfo info)
Disposes of the given element info object. |
java.lang.String |
getEncoding(java.lang.Object element)
Returns the character encoding for the given element, or null if the element is not managed by this provider. |
IResourceForEditorInputFactory |
getResourceForEditorInputFactory()
|
boolean |
isDeleted(java.lang.Object element)
Returns whether the given element has been deleted. |
boolean |
isSynchronized(java.lang.Object element)
Returns whether the information provided for the given element is in sync with the element. |
protected void |
loadResource(XtextResource resource,
java.lang.String document,
java.lang.String encoding)
|
protected void |
removeUnchangedElementListeners(java.lang.Object element,
org.eclipse.ui.texteditor.AbstractDocumentProvider.ElementInfo info)
Called when the given element gets dirty. |
protected boolean |
setDocumentContent(org.eclipse.jface.text.IDocument document,
org.eclipse.ui.IEditorInput editorInput,
java.lang.String encoding)
Initializes the given document from the given editor input using the given character encoding. |
void |
setResourceForEditorInputFactory(IResourceForEditorInputFactory resourceForEditorInputFactory)
|
| Methods inherited from class org.eclipse.ui.editors.text.FileDocumentProvider |
|---|
cacheEncodingState, checkSynchronizationState, computeModificationStamp, doResetDocument, doSaveDocument, doSynchronize, doValidateState, getContentType, getElementInfo, getModificationStamp, getOperationRunner, getPersistedEncoding, getResetRule, getSaveRule, getSynchronizationStamp, getSynchronizeRule, getValidateStateRule, handleElementContentChanged, handleElementDeleted, handleElementMoved, isModifiable, persistEncoding, readUTF8BOM, refreshFile, refreshFile, setDocumentContent |
| Methods inherited from class org.eclipse.ui.editors.text.StorageDocumentProvider |
|---|
doUpdateStateCache, getDefaultEncoding, handleCoreException, isNotSynchronizedException, isReadOnly, setDocumentContent, setDocumentContent, setEncoding, setupDocument, updateCache |
| Methods inherited from class org.eclipse.ui.texteditor.AbstractDocumentProvider |
|---|
aboutToChange, addElementStateListener, canSaveDocument, changed, connect, connected, disconnect, disconnected, executeOperation, fireElementContentAboutToBeReplaced, fireElementContentReplaced, fireElementDeleted, fireElementDirtyStateChanged, fireElementMoved, fireElementStateChangeFailed, fireElementStateChanging, fireElementStateValidationChanged, getAnnotationModel, getConnectedElements, getDocument, getProgressMonitor, getStatus, invalidatesState, isStateValidated, mustSaveDocument, removeElementStateListener, resetDocument, saveDocument, setCanSaveDocument, setProgressMonitor, synchronize, updateStateCache, validateState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XtextDocumentProvider()
| Method Detail |
|---|
protected XtextDocument createEmptyDocument()
org.eclipse.ui.editors.text.StorageDocumentProvider
createEmptyDocument in class org.eclipse.ui.editors.text.StorageDocumentProvider
protected org.eclipse.jface.text.IDocument createDocument(java.lang.Object element)
throws org.eclipse.core.runtime.CoreException
org.eclipse.ui.texteditor.AbstractDocumentProviderSubclasses must implement this method.
createDocument in class org.eclipse.ui.editors.text.StorageDocumentProviderelement - the element
org.eclipse.core.runtime.CoreException - if the document could not be createdpublic boolean isDeleted(java.lang.Object element)
org.eclipse.ui.texteditor.IDocumentProvider
isDeleted in interface org.eclipse.ui.texteditor.IDocumentProviderisDeleted in class org.eclipse.ui.editors.text.FileDocumentProviderelement - the element
true if the element has been deleted
protected boolean setDocumentContent(org.eclipse.jface.text.IDocument document,
org.eclipse.ui.IEditorInput editorInput,
java.lang.String encoding)
throws org.eclipse.core.runtime.CoreException
org.eclipse.ui.editors.text.StorageDocumentProvider
setDocumentContent in class org.eclipse.ui.editors.text.FileDocumentProviderdocument - the document to be initializededitorInput - the input from which to derive the content of the documentencoding - the character encoding used to read the editor input
true if the document content could be set, false otherwise
org.eclipse.core.runtime.CoreException - if the given editor input cannot be accessed
protected void disposeElementInfo(java.lang.Object element,
org.eclipse.ui.texteditor.AbstractDocumentProvider.ElementInfo info)
org.eclipse.ui.texteditor.AbstractDocumentProvider
This method is called when an element info is disposed. The
AbstractDocumentProvider implementation of this
method does nothing. Subclasses may reimplement.
disposeElementInfo in class org.eclipse.ui.editors.text.FileDocumentProviderelement - the elementinfo - the element info object
protected void loadResource(XtextResource resource,
java.lang.String document,
java.lang.String encoding)
throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
protected org.eclipse.ui.texteditor.AbstractDocumentProvider.ElementInfo createElementInfo(java.lang.Object element)
throws org.eclipse.core.runtime.CoreException
org.eclipse.ui.texteditor.AbstractDocumentProvider
This method is called from connect when an element info needs
to be created. The AbstractDocumentProvider implementation
of this method returns a new element info object whose document and
annotation model are the values of createDocument(element)
and createAnnotationModel(element), respectively. Subclasses
may override.
createElementInfo in class org.eclipse.ui.editors.text.FileDocumentProviderelement - the element
org.eclipse.core.runtime.CoreException - if the document or annotation model could not be created
protected void addUnchangedElementListeners(java.lang.Object element,
org.eclipse.ui.texteditor.AbstractDocumentProvider.ElementInfo info)
org.eclipse.ui.texteditor.AbstractDocumentProviderfalse. Adds all listeners which must be
active as long as the element is not dirty. This method is called
before fireElementDirtyStateChanged or
fireElementContentReplaced is called.
Subclasses may extend.
addUnchangedElementListeners in class org.eclipse.ui.texteditor.AbstractDocumentProviderelement - the elementinfo - the element info object
protected void removeUnchangedElementListeners(java.lang.Object element,
org.eclipse.ui.texteditor.AbstractDocumentProvider.ElementInfo info)
org.eclipse.ui.texteditor.AbstractDocumentProviderfireElementDirtyStateChanged
or fireElementContentReplaced is called.
Subclasses may extend.
removeUnchangedElementListeners in class org.eclipse.ui.texteditor.AbstractDocumentProviderelement - the elementinfo - the element info object
protected org.eclipse.jface.text.source.IAnnotationModel createAnnotationModel(java.lang.Object element)
throws org.eclipse.core.runtime.CoreException
org.eclipse.ui.texteditor.AbstractDocumentProviderSubclasses must implement this method.
createAnnotationModel in class org.eclipse.ui.editors.text.FileDocumentProviderelement - the element
null if none
org.eclipse.core.runtime.CoreException - if the annotation model could not be createdpublic void setResourceForEditorInputFactory(IResourceForEditorInputFactory resourceForEditorInputFactory)
public IResourceForEditorInputFactory getResourceForEditorInputFactory()
public java.lang.String getEncoding(java.lang.Object element)
org.eclipse.ui.editors.text.IStorageDocumentProvidernull if the element is not managed by this provider.
getEncoding in interface org.eclipse.ui.editors.text.IStorageDocumentProvidergetEncoding in class org.eclipse.ui.editors.text.StorageDocumentProviderelement - the element
public boolean isSynchronized(java.lang.Object element)
org.eclipse.ui.texteditor.IDocumentProviderExtension3
isSynchronized in interface org.eclipse.ui.texteditor.IDocumentProviderExtension3isSynchronized in class org.eclipse.ui.editors.text.FileDocumentProviderelement - the element
true if the information is in sync with the element, false otherwise
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||