GATE
Version 3.1-2270

gate.gui.docview
Class AbstractDocumentView

java.lang.Object
  extended by gate.util.AbstractFeatureBearer
      extended by gate.creole.AbstractResource
          extended by gate.gui.docview.AbstractDocumentView
All Implemented Interfaces:
ActionsPublisher, DocumentView, Resource, FeatureBearer, NameBearer, VisualResource, Serializable
Direct Known Subclasses:
AnnotationListView, AnnotationSetsView, CorefEditor, TextualDocumentView

public abstract class AbstractDocumentView
extends AbstractResource
implements DocumentView

A convenience implementation of DocumentView that can be extended by implementers of document views. An implementation of a document view that extends this class will need to provide implementations for the three abstract methods: initGUI(), registerHooks() and unregisterHooks().

See Also:
Serialized Form

Field Summary
protected  boolean active
          Stores the active state of this view.
protected  Document document
          The document this view displays.
protected  boolean guiInitialised
          Has the UI been initialised yet?
protected  Handle handle
          Stores the handle of this view.
protected  DocumentEditor owner
          The DocumentEditor this view is part of.
 
Fields inherited from class gate.creole.AbstractResource
name
 
Fields inherited from class gate.util.AbstractFeatureBearer
features
 
Fields inherited from interface gate.gui.docview.DocumentView
CENTRAL, HORIZONTAL, VERTICAL
 
Constructor Summary
AbstractDocumentView()
           
 
Method Summary
 List getActions()
          Returns a list of Action objects.
 Document getDocument()
          Gets the document this view displays.
protected abstract  void initGUI()
          Implementers should override this method and use it for populating the GUI.
 boolean isActive()
          Returns the active state of this view.
protected abstract  void registerHooks()
          This method will be called whenever the view becomes active.
 void setActive(boolean active)
          Notifies this view that it has become active or inactive.
 void setHandle(Handle handle)
          Used by the main GUI to tell this VR what handle created it.
 void setOwner(DocumentEditor editor)
          Stores the owner of this view into the owner field.
 void setTarget(Object target)
          Stores the target (which should always be a Document) into the document field.
protected abstract  void unregisterHooks()
          This method will be called whenever this view becomes inactive.
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, cleanup, getBeanInfo, getName, getParameterValue, getParameterValue, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gate.gui.docview.DocumentView
getGUI, getType
 
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
 

Field Detail

active

protected boolean active
Stores the active state of this view.


handle

protected Handle handle
Stores the handle of this view.


guiInitialised

protected boolean guiInitialised
Has the UI been initialised yet?


document

protected Document document
The document this view displays.


owner

protected DocumentEditor owner
The DocumentEditor this view is part of.

Constructor Detail

AbstractDocumentView

public AbstractDocumentView()
Method Detail

setActive

public void setActive(boolean active)
Notifies this view that it has become active or inactive. This method will initialise the GUI the first time the view becomes active.

Specified by:
setActive in interface DocumentView
Parameters:
active - a boolean value.

isActive

public boolean isActive()
Returns the active state of this view.

Specified by:
isActive in interface DocumentView
Returns:
a boolean value

getActions

public List getActions()
Description copied from interface: ActionsPublisher
Returns a list of Action objects. This method will be called everytime a menu for this resource needs to be built, thus allowing for dynamic updates to the list of actions. A null value in this list will cause a separator to be created.

Specified by:
getActions in interface ActionsPublisher
Returns:
a List of Actions.

setHandle

public void setHandle(Handle handle)
Description copied from interface: VisualResource
Used by the main GUI to tell this VR what handle created it. The VRs can use this information e.g. to add items to the popup for the resource.

Specified by:
setHandle in interface VisualResource

setTarget

public void setTarget(Object target)
Stores the target (which should always be a Document) into the document field.

Specified by:
setTarget in interface VisualResource
Parameters:
target - the object (be it a Resource, DataStore or whatever) this viewer has to display

getDocument

public Document getDocument()
Gets the document this view displays.

Returns:
a Document

setOwner

public void setOwner(DocumentEditor editor)
Stores the owner of this view into the owner field. The owner is the DocumentEditor this view is part of.

Specified by:
setOwner in interface DocumentView
Parameters:
editor - the DocumentEditor that contains this view.

initGUI

protected abstract void initGUI()
Implementers should override this method and use it for populating the GUI.


registerHooks

protected abstract void registerHooks()
This method will be called whenever the view becomes active. Implementers should use this to add hooks (such as mouse listeners) to the other views as required by their functionality.


unregisterHooks

protected abstract void unregisterHooks()
This method will be called whenever this view becomes inactive. Implementers should use it to unregister whatever hooks they registered in registerHooks().


GATE
Version 3.1-2270