Package org.apache.uima.caseditor.editor
Class CasDocumentProvider
java.lang.Object
org.apache.uima.caseditor.editor.CasDocumentProvider
- Direct Known Subclasses:
DefaultCasDocumentProvider
Provides the
ICasDocument for the
AnnotationEditor.
Note: This document provider is still experimental and its API might change without any notice,
even on a revision release!-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classThe Class ElementInfo. -
Field Summary
FieldsModifier and TypeFieldDescriptionThe methodcreateDocument(Object)put error status objects for the given element in this map, if something with document creation goes wrong.static final intError status code to indicate that a type system is not available. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElementStateListener(org.eclipse.ui.texteditor.IElementStateListener listener) Adds the element state listener.protected abstract ICasDocumentcreateDocument(Object element) Creates the a newAnnotationDocumentfrom the givenIEditorInputelement.protected CasDocumentProvider.ElementInfocreateElementInfo(Object element) Creates the element info.abstract org.eclipse.swt.widgets.CompositecreateTypeSystemSelectorForm(ICasEditor editor, org.eclipse.swt.widgets.Composite parent, org.eclipse.core.runtime.IStatus status) Creates the type system selector form.protected voiddisposeElementInfo(Object element, CasDocumentProvider.ElementInfo info) Dispose element info.protected abstract voiddoSaveDocument(org.eclipse.core.runtime.IProgressMonitor monitor, Object element, ICasDocument document, boolean overwrite) Do save document.protected voidfireElementChanged(Object element) Fire element changed.protected voidfireElementDeleted(Object element) Fire element deleted.protected voidfireElementDirtyStateChanged(Object element, boolean isDirty) Fire element dirty state changed.abstract org.eclipse.jface.preference.IPreferenceStoregetSessionPreferenceStore(Object element) Retrieves the session preference store.org.eclipse.core.runtime.IStatusGets the status.abstract org.eclipse.jface.preference.IPreferenceStoregetTypeSystemPreferenceStore(Object element) Retrieves the persistent per type system preference store.voidremoveElementStateListener(org.eclipse.ui.texteditor.IElementStateListener listener) Removes the element state listener.abstract voidsaveTypeSystemPreferenceStore(Object element) Save type system preference store.
-
Field Details
-
TYPE_SYSTEM_NOT_AVAILABLE_STATUS_CODE
public static final int TYPE_SYSTEM_NOT_AVAILABLE_STATUS_CODEError status code to indicate that a type system is not available.- See Also:
-
elementErrorStatus
The methodcreateDocument(Object)put error status objects for the given element in this map, if something with document creation goes wrong. The methodgetStatus(Object)can then retrieve and return the status.
-
-
Constructor Details
-
CasDocumentProvider
public CasDocumentProvider()
-
-
Method Details
-
createElementInfo
Creates the element info.- Parameters:
element- the element- Returns:
- the element info
-
disposeElementInfo
Dispose element info.- Parameters:
element- the elementinfo- the info
-
createDocument
protected abstract ICasDocument createDocument(Object element) throws org.eclipse.core.runtime.CoreException Creates the a newAnnotationDocumentfrom the givenIEditorInputelement. For all other elements null is returned.- Parameters:
element- the element- Returns:
- the i cas document
- Throws:
org.eclipse.core.runtime.CoreException- the core exception
-
doSaveDocument
protected abstract void doSaveDocument(org.eclipse.core.runtime.IProgressMonitor monitor, Object element, ICasDocument document, boolean overwrite) throws org.eclipse.core.runtime.CoreException Do save document.- Parameters:
monitor- the monitorelement- the elementdocument- the documentoverwrite- the overwrite- Throws:
org.eclipse.core.runtime.CoreException- the core exception
-
getStatus
Gets the status.- Parameters:
element- the element- Returns:
- the status
-
getTypeSystemPreferenceStore
public abstract org.eclipse.jface.preference.IPreferenceStore getTypeSystemPreferenceStore(Object element) Retrieves the persistent per type system preference store. This store is usually saved in relation to the type system, e.g. an ide plugin could save a preference file next to the type system file.- Parameters:
element- the element- Returns:
- the preference store or null if it cannot be retrieved, e.g no document was created for the input.
-
saveTypeSystemPreferenceStore
Save type system preference store.- Parameters:
element- the element
-
getSessionPreferenceStore
public abstract org.eclipse.jface.preference.IPreferenceStore getSessionPreferenceStore(Object element) Retrieves the session preference store. This preference store is used to store session data which should be used to initialize a freshly opened editor.- Parameters:
element- the element- Returns:
- the session preference store
-
createTypeSystemSelectorForm
public abstract org.eclipse.swt.widgets.Composite createTypeSystemSelectorForm(ICasEditor editor, org.eclipse.swt.widgets.Composite parent, org.eclipse.core.runtime.IStatus status) Creates the type system selector form.- Parameters:
editor- the editorparent- the parentstatus- the status- Returns:
- the composite
-
addElementStateListener
public void addElementStateListener(org.eclipse.ui.texteditor.IElementStateListener listener) Adds the element state listener.- Parameters:
listener- the listener
-
removeElementStateListener
public void removeElementStateListener(org.eclipse.ui.texteditor.IElementStateListener listener) Removes the element state listener.- Parameters:
listener- the listener
-
fireElementDeleted
Fire element deleted.- Parameters:
element- the element
-
fireElementChanged
Fire element changed.- Parameters:
element- the element
-
fireElementDirtyStateChanged
Fire element dirty state changed.- Parameters:
element- the elementisDirty- the is dirty
-