Class CasDocumentProvider

java.lang.Object
org.apache.uima.caseditor.editor.CasDocumentProvider
Direct Known Subclasses:
DefaultCasDocumentProvider

public abstract class CasDocumentProvider extends Object
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!
  • Field Details

    • TYPE_SYSTEM_NOT_AVAILABLE_STATUS_CODE

      public static final int TYPE_SYSTEM_NOT_AVAILABLE_STATUS_CODE
      Error status code to indicate that a type system is not available.
      See Also:
    • elementErrorStatus

      protected Map<Object,org.eclipse.core.runtime.IStatus> elementErrorStatus
      The method createDocument(Object) put error status objects for the given element in this map, if something with document creation goes wrong. The method getStatus(Object) can then retrieve and return the status.
  • Constructor Details

    • CasDocumentProvider

      public CasDocumentProvider()
  • Method Details

    • createElementInfo

      protected CasDocumentProvider.ElementInfo createElementInfo(Object element)
      Creates the element info.
      Parameters:
      element - the element
      Returns:
      the element info
    • disposeElementInfo

      protected void disposeElementInfo(Object element, CasDocumentProvider.ElementInfo info)
      Dispose element info.
      Parameters:
      element - the element
      info - the info
    • createDocument

      protected abstract ICasDocument createDocument(Object element) throws org.eclipse.core.runtime.CoreException
      Creates the a new AnnotationDocument from the given IEditorInput element. 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 monitor
      element - the element
      document - the document
      overwrite - the overwrite
      Throws:
      org.eclipse.core.runtime.CoreException - the core exception
    • getStatus

      public org.eclipse.core.runtime.IStatus getStatus(Object element)
      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

      public abstract void saveTypeSystemPreferenceStore(Object element)
      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 editor
      parent - the parent
      status - 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

      protected void fireElementDeleted(Object element)
      Fire element deleted.
      Parameters:
      element - the element
    • fireElementChanged

      protected void fireElementChanged(Object element)
      Fire element changed.
      Parameters:
      element - the element
    • fireElementDirtyStateChanged

      protected void fireElementDirtyStateChanged(Object element, boolean isDirty)
      Fire element dirty state changed.
      Parameters:
      element - the element
      isDirty - the is dirty