## gate.creole
Interface AnnotationVisualResource

All Superinterfaces:
  FeatureBearer, NameBearer, Resource, Serializable, VisualResource

All Known Implementing Classes:
  UnrestrictedAnnotationEditor, SchemaAnnotationEditor, SyntaxTreeViewer

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` `okAction()` Called by the GUI when the user has pressed the "OK" button.
`void` `setAnnotation(Annotation ann)` Used when the viewer/editor has to display/edit an existing annotation
`void` `setSpan(Long startOffset, Long endOffset, String annotationType)` Used when the viewer has to create new annotations.
`void` `setTarget(Object target)` Called by the GUI when this viewer/editor has to initialise itself for a specific annotation or text span.

Methods inherited from interface gate.VisualResource
`setHandle`

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

### setTarget

    public void setTarget(Object target)

  Called by the GUI when this viewer/editor has to initialise itself for a specific annotation or text span.
  Specified by:
    `setTarget` in interface `VisualResource`
  Parameters:
    `target` - the object which will always be a `AnnotationSet`

### setAnnotation

    public void setAnnotation(Annotation ann)

  Used when the viewer/editor has to display/edit an existing annotation
  Parameters:
    `ann` - the annotation to be displayed or edited

### setSpan

    public void setSpan(Long startOffset,
                        Long endOffset,
                        String annotationType)

  Used when the viewer has to create new annotations.
  Parameters:
    `startOffset` - the start offset of the span covered by the new annotation(s)
    `endOffset` - the end offset of the span covered by the new annotation(s)

### okAction

    public 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)

### cancelAction

    public 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

### canDisplayAnnotationType

    public boolean canDisplayAnnotationType(String annotationType)

  Checks whether this viewer/editor can handle a specific annotation type.