gate.gui
Class NameBearerHandle

java.lang.Object
  extended by gate.gui.NameBearerHandle
All Implemented Interfaces:
CreoleListener, ProgressListener, StatusListener, Handle, EventListener

public class NameBearerHandle
extends Object
implements Handle, StatusListener, ProgressListener, CreoleListener

Class used to store the GUI information about an open entity (resource, controller, datastore). Such information will include icon to be used for tree components, popup menu for right click events, large and small views, etc.


Field Summary
protected  List<ActionsPublisher> actionPublishers
          Stores all the action providers for this resource.
protected  CorpusFillerComponent corpusFiller
          Component used to select the options for corpus populating
protected  SingleConcatenatedFileInputDialog scfInputDialog
           
protected  List<XJMenuItem> staticPopupItems
          A list of menu items that constitute the static part of the popup.
protected  boolean viewsBuilt
           
 
Constructor Summary
NameBearerHandle(NameBearer target, Window window)
           
 
Method Summary
 void addProgressListener(ProgressListener l)
           
 void addStatusListener(StatusListener l)
           
protected  void buildStaticPopupItems()
           
protected  void buildViews()
           
 void cleanup()
          Releases the memory, removes the listeners, cleans up.
 void datastoreClosed(CreoleEvent e)
          Called when a DataStore has been closed
 void datastoreCreated(CreoleEvent e)
          Called when a DataStore has been created
 void datastoreOpened(CreoleEvent e)
          Called when a DataStore has been opened
protected  void fireProcessFinished()
           
protected  void fireProgressChanged(int e)
           
protected  void fireStatusChanged(String e)
           
 Action getCloseAction()
           
 Action getCloseRecursivelyAction()
           
 Icon getIcon()
           
 JComponent getLargeView()
          Returns the large view for this resource.
 JPopupMenu getPopup()
           
 JComponent getSmallView()
          Returns a GUI component to be used as a small viewer/editor, e.g.
 Object getTarget()
           
 String getTitle()
           
 String getTooltipText()
           
 Window getWindow()
          Returns the top level GUI component that is a parent to all other GUI components
 void processFinished()
          Called when the process is finished.
 void progressChanged(int e)
          Called when the progress has changed
 void removeProgressListener(ProgressListener l)
           
 void removeStatusListener(StatusListener l)
           
 void removeViews()
          A call to this method will cause the handle to destroy all the views built for the target resource.
 void resourceLoaded(CreoleEvent e)
          Called when a new Resource has been loaded into the system
 void resourceRenamed(Resource resource, String oldName, String newName)
          Called when the creole register has renamed a resource.1
 void resourceUnloaded(CreoleEvent e)
          Called when a Resource has been removed from the system
 void setIcon(Icon icon)
           
 void setTooltipText(String text)
           
 void statusChanged(String e)
          Calleed when there a new status message.
 String toString()
           
 boolean viewsBuilt()
          Returns true if the views have already been built for this handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

actionPublishers

protected List<ActionsPublisher> actionPublishers
Stores all the action providers for this resource. They will be questioned when the getPopup() method is called.


staticPopupItems

protected List<XJMenuItem> staticPopupItems
A list of menu items that constitute the static part of the popup. Null values are used for separators.


viewsBuilt

protected boolean viewsBuilt

corpusFiller

protected CorpusFillerComponent corpusFiller
Component used to select the options for corpus populating


scfInputDialog

protected SingleConcatenatedFileInputDialog scfInputDialog
Constructor Detail

NameBearerHandle

public NameBearerHandle(NameBearer target,
                        Window window)
Method Detail

getIcon

public Icon getIcon()
Specified by:
getIcon in interface Handle

setIcon

public void setIcon(Icon icon)

getTitle

public String getTitle()
Specified by:
getTitle in interface Handle

viewsBuilt

public boolean viewsBuilt()
Returns true if the views have already been built for this handle.

Specified by:
viewsBuilt in interface Handle
Returns:
a boolean value.

getSmallView

public JComponent getSmallView()
Returns a GUI component to be used as a small viewer/editor, e.g. below the main tree in the Gate GUI for the selected resource

Specified by:
getSmallView in interface Handle

getLargeView

public JComponent getLargeView()
Returns the large view for this resource. This view will go into the main display area.

Specified by:
getLargeView in interface Handle

getPopup

public JPopupMenu getPopup()
Specified by:
getPopup in interface Handle

getTooltipText

public String getTooltipText()
Specified by:
getTooltipText in interface Handle

setTooltipText

public void setTooltipText(String text)

getTarget

public Object getTarget()
Specified by:
getTarget in interface Handle

getCloseAction

public Action getCloseAction()

getCloseRecursivelyAction

public Action getCloseRecursivelyAction()

buildStaticPopupItems

protected void buildStaticPopupItems()

buildViews

protected void buildViews()

toString

public String toString()
Overrides:
toString in class Object

removeProgressListener

public void removeProgressListener(ProgressListener l)

addProgressListener

public void addProgressListener(ProgressListener l)

removeViews

public void removeViews()
Description copied from interface: Handle
A call to this method will cause the handle to destroy all the views built for the target resource.

Specified by:
removeViews in interface Handle

cleanup

public void cleanup()
Releases the memory, removes the listeners, cleans up. Will get called when the target resource is unloaded from the system

Specified by:
cleanup in interface Handle

fireProgressChanged

protected void fireProgressChanged(int e)

fireProcessFinished

protected void fireProcessFinished()

removeStatusListener

public void removeStatusListener(StatusListener l)

addStatusListener

public void addStatusListener(StatusListener l)

fireStatusChanged

protected void fireStatusChanged(String e)

statusChanged

public void statusChanged(String e)
Description copied from interface: StatusListener
Calleed when there a new status message.

Specified by:
statusChanged in interface StatusListener

progressChanged

public void progressChanged(int e)
Description copied from interface: ProgressListener
Called when the progress has changed

Specified by:
progressChanged in interface ProgressListener

processFinished

public void processFinished()
Description copied from interface: ProgressListener
Called when the process is finished.

Specified by:
processFinished in interface ProgressListener

getWindow

public Window getWindow()
Description copied from interface: Handle
Returns the top level GUI component that is a parent to all other GUI components

Specified by:
getWindow in interface Handle

resourceLoaded

public void resourceLoaded(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a new Resource has been loaded into the system

Specified by:
resourceLoaded in interface CreoleListener

resourceUnloaded

public void resourceUnloaded(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a Resource has been removed from the system

Specified by:
resourceUnloaded in interface CreoleListener

resourceRenamed

public void resourceRenamed(Resource resource,
                            String oldName,
                            String newName)
Description copied from interface: CreoleListener
Called when the creole register has renamed a resource.1

Specified by:
resourceRenamed in interface CreoleListener

datastoreOpened

public void datastoreOpened(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a DataStore has been opened

Specified by:
datastoreOpened in interface CreoleListener

datastoreCreated

public void datastoreCreated(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a DataStore has been created

Specified by:
datastoreCreated in interface CreoleListener

datastoreClosed

public void datastoreClosed(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a DataStore has been closed

Specified by:
datastoreClosed in interface CreoleListener