gate.creole
Interface AnnotationVisualResource

All Superinterfaces:
FeatureBearer, NameBearer, Resource, Serializable, VisualResource
All Known Subinterfaces:
OwnedAnnotationEditor
All Known Implementing Classes:
AnnotationEditor, SchemaAnnotationEditor, SchemaAnnotationEditor, SyntaxTreeViewer, UnrestrictedAnnotationEditor

public interface AnnotationVisualResource
extends VisualResource

Visual Resources that display and/or edit annotations. This type of resources can be used to either display or edit existing annotations or to create new annotations.


Method Summary
 void cancelAction()
          Called by the GUI when the user has pressed the "Cancel" button.
 boolean canDisplayAnnotationType(String annotationType)
          Checks whether this viewer/editor can handle a specific annotation type.
 void editAnnotation(Annotation ann, AnnotationSet set)
          Changes the annotation currently being edited.
 boolean editingFinished()
          Checks whether the annotation currently being edited can be considered complete.
 Annotation getAnnotationCurrentlyEdited()
           
 AnnotationSet getAnnotationSetCurrentlyEdited()
           
 boolean isActive()
          Checks whether the annotation editor is active (shown on screen and ready to edit annotations.
 void okAction()
          Called by the GUI when the user has pressed the "OK" button.
 boolean supportsCancel()
          Checks whether this editor supports the cancel option
 
Methods inherited from interface gate.VisualResource
setHandle, setTarget
 
Methods inherited from interface gate.Resource
cleanup, getParameterValue, init, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Method Detail

okAction

void okAction()
              throws GateException
Called by the GUI when the user has pressed the "OK" button. This should trigger the saving of the newly created annotation(s)

Throws:
GateException

cancelAction

void cancelAction()
                  throws GateException
Called by the GUI when the user has pressed the "Cancel" button. This should trigger cleaning up action, if the editor has done any changes to the annotation sets or document or annotation

Throws:
GateException

supportsCancel

boolean supportsCancel()
Checks whether this editor supports the cancel option

Returns:
true iff this editor can rollback changes.

canDisplayAnnotationType

boolean canDisplayAnnotationType(String annotationType)
Checks whether this viewer/editor can handle a specific annotation type. If the annotation type provided is null, then the check is whether the viewer/editor can handle any arbitrary annotation.


editAnnotation

void editAnnotation(Annotation ann,
                    AnnotationSet set)
Changes the annotation currently being edited.

Parameters:
ann - the new annotation.
set - the set to which the new annotation belongs.

editingFinished

boolean editingFinished()
Checks whether the annotation currently being edited can be considered complete.

Returns:
true iff the editor has finished editing the current annotation. This might return false for instance when the current annotation does not yet comply with the schema and the editor implementation is designed to enforce schemas.

isActive

boolean isActive()
Checks whether the annotation editor is active (shown on screen and ready to edit annotations.

Returns:
true iff the editor is active.

getAnnotationCurrentlyEdited

Annotation getAnnotationCurrentlyEdited()
Returns:
the annotation currently edited

getAnnotationSetCurrentlyEdited

AnnotationSet getAnnotationSetCurrentlyEdited()
Returns:
the annotation set currently edited