org.jwarp.flow.form.model
Interface IComponent

All Known Subinterfaces:
IContainer, IField, IForm, INavigation, IScreen, ISelectorModel, IStateModel, ITableModel
All Known Implementing Classes:
Component

public interface IComponent

A generic JWeb container object is a component that can contain other element components.

Components added to a container are tracked in a list. The order of the list will define the components' front-to-back stacking order within the container. If no index is specified when adding a component to a container, it will be added to the end of the list (and hence to the bottom of the stacking order).

Version:
1.0, 02/01/01
Author:
Anatole Tresch
See Also:
Container

Method Summary
 void addComponentListener(IComponentListener l)
          Adds the specified container listener to receive container events from this container.
 java.lang.String getDescription()
          Get a description for the model.
 java.lang.String getFullName()
          Get the full qualified name of the component.
 int getID()
          Return the model's id.
 java.util.Iterator getListeners(java.lang.Class listenerType)
          Return an array of all the listeners that were added to the Container with addXXXListener(), where XXX is the name of the listenerType argument.
 java.util.Locale getLocale()
          Gets the locale of this component.
 java.lang.String getName()
          Get the model's type name.
 IContainer getParent()
          Get the parents component (if any)
 org.jdom.Element getXMLTree()
          Get the actual XML result.
 void handleEvent(ComponentEvent event)
          Handles the events.
 boolean isEnabled()
          Returns if the action is currently enabled
 void removeComponentListener(IComponentListener l)
          Removes the specified container listener so it no longer receives container events from this container.
 void setEnabled(boolean val)
          Sets the action's enabled property
 void setFlowData(IFlowData data)
          Set the flow data.
 void setLocale(java.util.Locale l)
          Sets the locale of this component.
 

Method Detail

getID

public int getID()
Return the model's id. This is an internal id used for referncing concrete model implementations.
Returns:
The model's id

getName

public java.lang.String getName()
Get the model's type name. This name is used for referencing the model by the event dispatcher.
Returns:
The model's name (together with the models type).

getFullName

public java.lang.String getFullName()
Get the full qualified name of the component. This name is the sum of all names of its supercomponents seperated by a dot followed by the components name itself.
Returns:
The fully qualified component name

getParent

public IContainer getParent()
Get the parents component (if any)
Returns:
The parent

getDescription

public java.lang.String getDescription()
Get a description for the model.
Returns:
A description

setFlowData

public void setFlowData(IFlowData data)
                 throws FormInitException
Set the flow data. This merges the actual data (XML tree) into the current component. The resulting component is then an abstract form that will be mapped to a concrete implementation thru the mapping service. This abstract version can be get through the getXMLTree method.
Parameters:
data - The flow data
Throws:
FormInitException - If the component could be initialised

isEnabled

public boolean isEnabled()
Returns if the action is currently enabled
Returns:
true If the action is enabled

setEnabled

public void setEnabled(boolean val)
Sets the action's enabled property
Parameters:
val - The enabled value

getLocale

public java.util.Locale getLocale()
Gets the locale of this component.
Returns:
This component's locale. If this component does not have a locale, the locale of its parent is returned.
Throws:
IllegalComponentStateException - If the Component does not have its own locale and has not yet been added to a containment hierarchy such that the locale can be determined from the containing parent.
See Also:
setLocale(java.util.Locale)

setLocale

public void setLocale(java.util.Locale l)
Sets the locale of this component.
Parameters:
l - The locale to become this component's locale.
See Also:
getLocale()

handleEvent

public void handleEvent(ComponentEvent event)
Handles the events.
Parameters:
event - The event to be handled

addComponentListener

public void addComponentListener(IComponentListener l)
Adds the specified container listener to receive container events from this container.
Parameters:
l - the container listener

removeComponentListener

public void removeComponentListener(IComponentListener l)
Removes the specified container listener so it no longer receives container events from this container. If l is null, no exception is thrown and no action is performed.
Parameters:
l - the container listener

getListeners

public java.util.Iterator getListeners(java.lang.Class listenerType)
Return an array of all the listeners that were added to the Container with addXXXListener(), where XXX is the name of the listenerType argument. For example, to get all of the ContainerListener(s) for the given Container c, one would write:
 ContainerListener[] cls = (ContainerListener[])(c.getListeners(ContainerListener.class))
 
If no such listener list exists, then an empty array is returned.
Parameters:
listenerType - Type of listeners requested
Returns:
all of the listeners of the specified type supported by this container
Since:
1.3

getXMLTree

public org.jdom.Element getXMLTree()
                            throws FormInitException
Get the actual XML result.
Returns:
The valid XML tree for this object
Throws:
FormInitException - If the component is not initialised with any neded data

©   O R C A   S y s t e m s