GATE
Version 3.1-2270

gate.gui
Class ParameterDisjunction

java.lang.Object
  extended by gate.gui.ParameterDisjunction
All Implemented Interfaces:
CreoleListener, EventListener

public class ParameterDisjunction
extends Object
implements CreoleListener

Represents a list of Parameters which are alternative to each other. This class only gives access to one of those parameters ot any one moment. The currently accessible (selected) parameter can be changed using the setSelectedIndex(int) method.


Constructor Summary
ParameterDisjunction(Resource resource, List parameters)
          Creation from a resources and a list of names.
 
Method Summary
 void cleanup()
           
 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
 String getComment()
          returns the comment for the curently selected parameter.
 String getName()
          returns the name of the curently selected parameter.
 String[] getNames()
          Returns the names of the parameters in this disjunction.
 Parameter getParameter()
           
 Parameter[] getParameters()
           
 String getType()
          returns the type for the curently selected parameter.
 Object getValue()
           
 Boolean isRequired()
          is the currently selected parameter required?
 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 setSelectedIndex(int index)
          Sets the currently selected parameter for this disjunction.
 void setValue(Object value)
           
 int size()
          gets the number of parameters in this disjunction.
protected  void updateValues(Resource res)
          Called when a resource has been unloaded from the system; If any of the parameters has this resource as value then the value will be deleted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterDisjunction

public ParameterDisjunction(Resource resource,
                            List parameters)
Creation from a resources and a list of names. The initial values of the parameters will be read from the resource. If any of these values is null than the default value will be used. After initialisation the values will be cached inside this object; any changes made to these values will not affect the actual values on the resource.

Parameters:
resource - the resource these parameters belong to.
parameters - a list containing the parameters in this paramater d isjunction; each element is a Parameter.
Method Detail

setSelectedIndex

public void setSelectedIndex(int index)
Sets the currently selected parameter for this disjunction.


size

public int size()
gets the number of parameters in this disjunction.


isRequired

public Boolean isRequired()
is the currently selected parameter required?


getName

public String getName()
returns the name of the curently selected parameter.


getComment

public String getComment()
returns the comment for the curently selected parameter.


getType

public String getType()
returns the type for the curently selected parameter.


getNames

public String[] getNames()
Returns the names of the parameters in this disjunction.


setValue

public void setValue(Object value)

getValue

public Object getValue()

getParameters

public Parameter[] getParameters()

getParameter

public Parameter getParameter()

cleanup

public void cleanup()

updateValues

protected void updateValues(Resource res)
Called when a resource has been unloaded from the system; If any of the parameters has this resource as value then the value will be deleted. If the resource is null then an attempt will be made to reinitialise the null values.


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

GATE
Version 3.1-2270