NextApp Echo3
v3.0.b4

nextapp.echo.app
Class Component

java.lang.Object
  extended by nextapp.echo.app.Component
All Implemented Interfaces:
java.io.Serializable, RenderIdSupport
Direct Known Subclasses:
AbstractButton, AbstractListComponent, Column, Composite, ContentPane, Grid, Label, Row, SplitPane, Table, TextComponent, Window, WindowPane

public abstract class Component
extends java.lang.Object
implements RenderIdSupport, java.io.Serializable

A representation of an Echo component. This is an abstract base class from which all Echo components are derived.

A hierarchy of Component objects is used to represent the state of an application's user interface. A Component may have a single parent Component and may contain zero or more child Components. Certain Components may limit the number or type(s) of children which may be added to them, and may even establish requirements for what type(s) of parent Components they may be added to. In the event that an application attempts to add a child Component to a parent Component in spite of these requirements, an IllegalChildException is thrown.

Properties and Styles

The state of a single Component is represented by its properties. Properties can be categorized into two types: "style" and "non-style". Style properties are generally used to represent the "look-and-feel" of a Component--information such as colors, fonts, location, and borders. "Non-style" properties are generally used to represent non-stylistic information such as data models, selection models, and locale.

"Style Properties" have a special definition because they may be stored in Style or StyleSheet objects instead of as properties of a specific Component instance. Property values contained in a relevant Style or StyleSheet will be used for rendering when the property values are not specified by a Component itself. Style properties are identified by the presence of a public static constant name in a Component implementation with the prefix PROPERTY_. In the base Component class itself there are several examples of style properties, such as PROPERTY_BACKGROUND,PROPERTY_FONT and PROPERTY_LAYOUT_DATA. The rendering application container will use the Component.getRenderProperty() and Component.getRenderIndexedProperty() to retrieve the values of stylistic properties, in order that their values might be obtained from the Component's shared Style or the ApplicationInstance's StyleSheet in the event they are not directly set in the Component.

A Component implementation should not store the values of style properties as instance variables. Rather, the values of style properties should be stored in the local Style instance, by way of the set() method. The get() method may be used to obtain the value of such properties. Only style properties should be stored using these methods; properties such as models should never be stored using the get()/set() interface.

Events

Many Components will provide the capability to register EventListeners to notify interested parties when various state changes occur. The base Component class provides an EventListenerList as a convenient and memory efficient means of storing such listeners. The internal EventListenerList may be obtained using the getEventListenerList() method. The EventListenerList is lazy-created and will only be instantiated on the first invocation of the getEventListenerList() method. If the intent is only to inquire about the state of event listeners without necessarily forcing instantiation of an EventListenerList, the hasEventListenerList() should be queried prior to invoking getEventListenerList().

See Also:
Serialized Form

Field Summary
static java.lang.String CHILD_VISIBLE_CHANGED_PROPERTY
          Property change event name for immediate children being made visible/invisible.
static java.lang.String CHILDREN_CHANGED_PROPERTY
          Property change event name for immediate children being added/removed.
static java.lang.String ENABLED_CHANGED_PROPERTY
          Property change event name for enabled state changes.
static java.lang.String FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY
          Deprecated.  
static java.lang.String FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY
          Property change event name for focus traversal participation changes.
static java.lang.String LAYOUT_DIRECTION_CHANGED_PROPERTY
          Property change event name for layout direction changes.
static java.lang.String LOCALE_CHANGED_PROPERTY
          Property change event name for locale changes.
static java.lang.String PROPERTY_BACKGROUND
           
static java.lang.String PROPERTY_FONT
           
static java.lang.String PROPERTY_FOREGROUND
           
static java.lang.String PROPERTY_LAYOUT_DATA
           
static java.lang.String STYLE_CHANGED_PROPERTY
          Property change event name for referenced Style changes.
static java.lang.String STYLE_NAME_CHANGED_PROPERTY
          Property change event name for named Style changes.
static java.lang.String VISIBLE_CHANGED_PROPERTY
          Property change event name for visibility changes.
 
Constructor Summary
Component()
          Creates a new Component.
 
Method Summary
 void add(Component c)
          Adds the specified Component as a child of this Component.
 void add(Component c, int n)
          Adds the specified Component as the nth child of this component.
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds a property change listener to this Component.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
          Adds a property change listener to this Component for a specific property.
 void dispose()
          Life-cycle method invoked when the Component is removed from a registered hierarchy.
protected  void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Reports a bound property change to PropertyChangeListeners and to the ApplicationInstance's update management system.
 java.lang.Object get(java.lang.String propertyName)
          Returns the value of the specified property.
 ApplicationInstance getApplicationInstance()
          Returns the ApplicationInstance to which this Component is registered, or null if it is not currently registered.
 Color getBackground()
          Returns the default/base background color of the Component.
 Component getComponent(int n)
          Returns the nth immediate child component.
 Component getComponent(java.lang.String id)
          Recursively searches for the component with the specified id by querying this component and its descendants.
 int getComponentCount()
          Returns the number of immediate child Components.
 Component[] getComponents()
          Returns an array of all immediate child Components.
protected  EventListenerList getEventListenerList()
          Returns the local EventListenerList.
 int getFocusTraversalIndex()
          Deprecated. Not supported.
 Font getFont()
          Returns the default/base font of the component.
 Color getForeground()
          Returns the default/base foreground color of the Component.
 java.lang.String getId()
          Returns the user-defined identifier of the Component.
 java.lang.Object getIndex(java.lang.String propertyName, int propertyIndex)
          Returns the value of the specified indexed property.
 LayoutData getLayoutData()
          Returns the LayoutData object used to describe how this Component should be laid out within its parent container.
 LayoutDirection getLayoutDirection()
          Returns the specific layout direction setting of this component, if any.
 java.util.Locale getLocale()
          Returns the specific locale setting of this component, if any.
 Style getLocalStyle()
          Returns the Style object in which local style properties are stored.
 Component getParent()
          Returns the parent component.
 java.lang.String getRenderId()
          Returns the render id of this component.
 java.lang.Object getRenderIndexedProperty(java.lang.String propertyName, int propertyIndex)
          Determines the "rendered state" of an indexed property.
 java.lang.Object getRenderIndexedProperty(java.lang.String propertyName, int propertyIndex, java.lang.Object defaultValue)
          Determines the "rendered state" of an indexed property.
 java.util.Locale getRenderLocale()
          Returns the rendered Locale of the Component.
 java.lang.Object getRenderProperty(java.lang.String propertyName)
          Determines the "rendered state" of a property.
 java.lang.Object getRenderProperty(java.lang.String propertyName, java.lang.Object defaultValue)
          Determines the "rendered state" of a property.
 Style getStyle()
          Returns the shared Style object assigned to this Component.
 java.lang.String getStyleName()
          Returns the name of the Style in the ApplicationInstance'sStyleSheet from which the renderer will retrieve properties.
 Component getVisibleComponent(int n)
          Returns the nth immediate visible child Component.
 int getVisibleComponentCount()
          Returns the number of visible immediate child Components.
 Component[] getVisibleComponents()
          Returns an array of all visible immediate child Components.
protected  boolean hasEventListenerList()
          Determines if a local EventListenerList exists.
 int indexOf(Component c)
          Determines the index of the given Component within the children of this Component.
 void init()
          Life-cycle method invoked when the Component is added to a registered hierarchy.
 boolean isAncestorOf(Component c)
          Determines if this Component is or is an ancestor of the specified Component.
 boolean isEnabled()
          Determines the enabled state of this Component.
 boolean isFocusTraversalParticipant()
          Determines if the Component participates in (tab) focus traversal.
 boolean isRegistered()
          Determines if the Component is registered to an ApplicationInstance.
 boolean isRenderEnabled()
          Determines whether this Component should be rendered with an enabled state.
 boolean isRenderVisible()
          Determines if the Component and all of its parents are visible.
 boolean isValidChild(Component child)
          Determines if a given Component is valid to be added as a child to this Component.
 boolean isValidParent(Component parent)
          Determines if this Component is valid to be added as a child of the given parent Component.
 boolean isVisible()
          Returns the visibility state of this Component.
 void processInput(java.lang.String inputName, java.lang.Object inputValue)
          Processes client input specific to the Component received from the UpdateManager.
 void remove(Component c)
          Removes the specified child Component from this Component.
 void remove(int n)
          Removes the Component at the nth index.
 void removeAll()
          Removes all child Components.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes a property change listener from this Component.
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
          Removes a property change listener from this Component for a specific property.
 void set(java.lang.String propertyName, java.lang.Object newValue)
          Sets a generic property of the Component.
 void setBackground(Color newValue)
          Sets the default background color of the Component.
 void setComponents(Component[] components)
          Sets the child components for this container, removing any existing children.
 void setEnabled(boolean newValue)
          Sets the enabled state of the Component.
 void setFocusTraversalIndex(int newValue)
          Deprecated. Not supported.
 void setFocusTraversalParticipant(boolean newValue)
          Sets whether the component participates in the focus traversal order (tab order).
 void setFont(Font newValue)
          Sets the default text font of the Component.
 void setForeground(Color newValue)
          Sets the default foreground color of the Component.
 void setId(java.lang.String id)
          Sets a user-defined identifier for this Component.
 void setIndex(java.lang.String propertyName, int propertyIndex, java.lang.Object newValue)
          Sets a generic indexed property of the Component.
 void setLayoutData(LayoutData newValue)
          Sets the LayoutData of this Component.
 void setLayoutDirection(LayoutDirection newValue)
          Sets the LayoutDirection of this Component, describing whether content is rendered left-to-right or right-to-left.
 void setLocale(java.util.Locale newValue)
          Sets the locale of the Component.
 void setRenderId(java.lang.String renderId)
          Sets a custom render identifier for this Component.
 void setStyle(Style newValue)
          Sets the shared style of the Component.
 void setStyleName(java.lang.String newValue)
          Sets the name of the style to use from the ApplicationInstance-defined StyleSheet.
 void setVisible(boolean newValue)
          Sets the visibility state of this Component.
 void validate()
          A life-cycle method invoked before the component is rendered to ensure it is in a valid state.
 boolean verifyInput(java.lang.String inputName, java.lang.Object inputValue)
          Invoked by the ClientUpdateManager on each component in the hierarchy whose processInput() method will layer be invoked in the current transaction.
 int visibleIndexOf(Component c)
          Determines the index of the given Component within the visible children of this Component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHILD_VISIBLE_CHANGED_PROPERTY

public static final java.lang.String CHILD_VISIBLE_CHANGED_PROPERTY
Property change event name for immediate children being made visible/invisible. When used, the newValue of the event will represent a child made visible, OR the oldValue will represent a child made invisible.

See Also:
Constant Field Values

CHILDREN_CHANGED_PROPERTY

public static final java.lang.String CHILDREN_CHANGED_PROPERTY
Property change event name for immediate children being added/removed. When used, the newValue of the event will represent an added child, OR the oldValue will represent a removed child.

See Also:
Constant Field Values

ENABLED_CHANGED_PROPERTY

public static final java.lang.String ENABLED_CHANGED_PROPERTY
Property change event name for enabled state changes.

See Also:
Constant Field Values

FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY

public static final java.lang.String FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY
Deprecated. 
See Also:
Constant Field Values

FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY

public static final java.lang.String FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY
Property change event name for focus traversal participation changes.

See Also:
Constant Field Values

LAYOUT_DIRECTION_CHANGED_PROPERTY

public static final java.lang.String LAYOUT_DIRECTION_CHANGED_PROPERTY
Property change event name for layout direction changes.

See Also:
Constant Field Values

LOCALE_CHANGED_PROPERTY

public static final java.lang.String LOCALE_CHANGED_PROPERTY
Property change event name for locale changes.

See Also:
Constant Field Values

STYLE_CHANGED_PROPERTY

public static final java.lang.String STYLE_CHANGED_PROPERTY
Property change event name for referenced Style changes.

See Also:
Constant Field Values

STYLE_NAME_CHANGED_PROPERTY

public static final java.lang.String STYLE_NAME_CHANGED_PROPERTY
Property change event name for named Style changes.

See Also:
Constant Field Values

VISIBLE_CHANGED_PROPERTY

public static final java.lang.String VISIBLE_CHANGED_PROPERTY
Property change event name for visibility changes.

See Also:
Constant Field Values

PROPERTY_BACKGROUND

public static final java.lang.String PROPERTY_BACKGROUND
See Also:
Constant Field Values

PROPERTY_FONT

public static final java.lang.String PROPERTY_FONT
See Also:
Constant Field Values

PROPERTY_FOREGROUND

public static final java.lang.String PROPERTY_FOREGROUND
See Also:
Constant Field Values

PROPERTY_LAYOUT_DATA

public static final java.lang.String PROPERTY_LAYOUT_DATA
See Also:
Constant Field Values
Constructor Detail

Component

public Component()
Creates a new Component.

Method Detail

add

public void add(Component c)
Adds the specified Component as a child of this Component. The child will be added at the greatest index.

Parameters:
c - the child Component to add

add

public void add(Component c,
                int n)
         throws IllegalChildException
Adds the specified Component as the nth child of this component. All component-add operations use this method to add components. Components that require notification of all child additions should override this method (making sure to call the superclass' implementation). If the child component currently has a parent in another hierarchy, it will automatically be removed from that hierarchy before being added to this component. This behavior will also occur if the child component is currently a child of this component.

Parameters:
c - the child component to add
n - the index at which to add the child component, or -1 to add the component at the end
Throws:
IllegalChildException - if the child is not allowed to be added to this component, because it is either not valid for the component's state or is of an invalid type

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a property change listener to this Component.

Parameters:
l - the listener to add

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener l)
Adds a property change listener to this Component for a specific property.

Parameters:
propertyName - the name of the property for which to listen
l - the listener to add

dispose

public void dispose()
Life-cycle method invoked when the Component is removed from a registered hierarchy. Implementations should always invoke super.dispose(). Modifications to the component hierarchy are not allowed within this method.


firePropertyChange

protected void firePropertyChange(java.lang.String propertyName,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)
Reports a bound property change to PropertyChangeListeners and to the ApplicationInstance's update management system.

Parameters:
propertyName - the name of the changed property
oldValue - the previous value of the property
newValue - the present value of the property

get

public final java.lang.Object get(java.lang.String propertyName)
Returns the value of the specified property. This method is generally used only internally by a Component, however there are exceptions. The more specific getXXX() methods to retrieve property values from a Component whenever possible. See the class-level documentation for a more detailed explanation of the use of this method.

Parameters:
propertyName - the property name
Returns:
the property value

getApplicationInstance

public ApplicationInstance getApplicationInstance()
Returns the ApplicationInstance to which this Component is registered, or null if it is not currently registered.

Returns:
the application instance

getBackground

public Color getBackground()
Returns the default/base background color of the Component. This property may not be relevant to certain components, though even in such cases may be useful for setting a default for children.

Returns:
the background color

getComponent

public final Component getComponent(int n)
Returns the nth immediate child component.

Parameters:
n - the index of the Component to retrieve
Returns:
the Component at index n
Throws:
java.lang.IndexOutOfBoundsException - when the index is invalid

getComponent

public final Component getComponent(java.lang.String id)
Recursively searches for the component with the specified id by querying this component and its descendants. The id value is that retrieved and set via the getId() and setId() methods. This method is in no way related to renderIds.

Parameters:
id - the user-defined id of the component to be retrieved
Returns:
the component with the specified id, if it either is this component or is a descendant of it, or null otherwise

getComponentCount

public final int getComponentCount()
Returns the number of immediate child Components.

Returns:
the number of immediate child Components

getComponents

public final Component[] getComponents()
Returns an array of all immediate child Components.

Returns:
an array of all immediate child Components

getEventListenerList

protected EventListenerList getEventListenerList()
Returns the local EventListenerList. The listener list is lazily created; invoking this method will create the EventListenerList if required.

Returns:
the listener list

getFocusTraversalIndex

public final int getFocusTraversalIndex()
Deprecated. Not supported.


getFont

public Font getFont()
Returns the default/base font of the component. This property may not be relevant to certain components, though even in such cases may be useful for setting a default for children.

Returns:
the font

getForeground

public Color getForeground()
Returns the default/base foreground color of the Component. This property may not be relevant to certain components, though even in such cases may be useful for setting a default for children.

Returns:
the foreground color

getId

public java.lang.String getId()
Returns the user-defined identifier of the Component. Note that the user defined identifier has no relation to the renderId.

Returns:
the user-defined identifier

getIndex

public final java.lang.Object getIndex(java.lang.String propertyName,
                                       int propertyIndex)
Returns the value of the specified indexed property. This method is generally used only internally by a Component, however there are exceptions. The more specific getXXX() methods to retrieve property values from a Component whenever possible. See the class-level documentation for a more detailed explanation of the use of this method.

Parameters:
propertyName - the property name
propertyIndex - the property index
Returns:
the property value

getLayoutData

public LayoutData getLayoutData()
Returns the LayoutData object used to describe how this Component should be laid out within its parent container.

Returns:
the layout data, or null if unset
See Also:
LayoutData

getLayoutDirection

public LayoutDirection getLayoutDirection()
Returns the specific layout direction setting of this component, if any. This method will return null unless a LayoutDirection is specifically set on this Component.

Returns:
the layout direction property of this Component

getLocale

public java.util.Locale getLocale()
Returns the specific locale setting of this component, if any. This method will return null unless a Locale is specifically set on this Component.

Returns:
the locale property of this Component

getLocalStyle

public Style getLocalStyle()
Returns the Style object in which local style properties are stored. Access to this object is provided solely for the purpose of allowing the enabling the application container to render the state of the component to a client.

Returns:
the local Style

getParent

public final Component getParent()
Returns the parent component.

Returns:
the parent component, or null if this component has no parent

getRenderId

public java.lang.String getRenderId()
Returns the render id of this component. This id is only guaranteed to be unique within the ApplicationInstance to which this component is registered. This method returns null in the event that the component is not registered to an ApplicationInstance.

Specified by:
getRenderId in interface RenderIdSupport
Returns:
the ApplicationInstance-wide unique id of this component
See Also:
RenderIdSupport.getRenderId()

getRenderIndexedProperty

public final java.lang.Object getRenderIndexedProperty(java.lang.String propertyName,
                                                       int propertyIndex)
Determines the "rendered state" of an indexed property. The rendered state is determined by first determining if the given property is locally set on this Component, and returning it in that case. If the property state is not set locally, the shared Style assigned to this component will be queried for the property value. If the property state is not set in the shared Style, the StyleSheet of the ApplicationInstance to which this Component is registered will be queried for the property value. In the event the property is not set in any of these resources, null is returned.

The application container will invoke this method rather than individual property getter methods to determine the state of properties when rendering.

Parameters:
propertyName - the name of the property
Returns:
the rendered property value

getRenderIndexedProperty

public final java.lang.Object getRenderIndexedProperty(java.lang.String propertyName,
                                                       int propertyIndex,
                                                       java.lang.Object defaultValue)
Determines the "rendered state" of an indexed property. The rendered state is determined by first determining if the given property is locally set on this Component, and returning it in that case. If the property state is not set locally, the shared Style assigned to this component will be queried for the property value. If the property state is not set in the shared Style, the StyleSheet of the ApplicationInstance to which this Component is registered will be queried for the property value. In the event the property is not set in any of these resources, defaultValue is returned.

Parameters:
propertyName - the name of the property
defaultValue - the value to be returned if the property is not set
Returns:
the property state

getRenderLocale

public final java.util.Locale getRenderLocale()
Returns the rendered Locale of the Component. If this Component does not itself specify a locale, its ancestors will be queried recursively until a Component providing a Locale is found. If no ancestors have Locales set, the ApplicationInstance's locale will be returned. In the event that no locale information is available from the ancestral hierarchy of Components and no ApplicationInstance is registered, null is returned.

Returns:
the locale for this component

getRenderProperty

public final java.lang.Object getRenderProperty(java.lang.String propertyName)
Determines the "rendered state" of a property. The rendered state is determined by first determining if the given property is locally set on this Component, and returning it in that case. If the property state is not set locally, the shared Style assigned to this component will be queried for the property value. If the property state is not set in the shared Style, the StyleSheet of the ApplicationInstance to which this Component is registered will be queried for the property value. In the event the property is not set in any of these resources, null is returned.

The application container will invoke this method rather than individual property getter methods to determine the state of properties when rendering.

Parameters:
propertyName - the name of the property
Returns:
the rendered property value

getRenderProperty

public final java.lang.Object getRenderProperty(java.lang.String propertyName,
                                                java.lang.Object defaultValue)
Determines the "rendered state" of a property. The rendered state is determined by first determining if the given property is locally set on this Component, and returning it in that case. If the property state is not set locally, the shared Style assigned to this component will be queried for the property value. If the property state is not set in the shared Style, the StyleSheet of the ApplicationInstance to which this Component is registered will be queried for the property value. In the event the property is not set in any of these resources, defaultValue is returned.

Parameters:
propertyName - the name of the property
defaultValue - the value to be returned if the property is not set
Returns:
the property state

getStyle

public final Style getStyle()
Returns the shared Style object assigned to this Component. As its name implies, the shared Style may be shared amongst multiple Components. Style properties will be rendered from the specified Style when they are not specified locally in the Component itself.

Returns:
the shared Style

getStyleName

public final java.lang.String getStyleName()
Returns the name of the Style in the ApplicationInstance'sStyleSheet from which the renderer will retrieve properties. The renderer will only query the StyleSheet when properties are not specified directly by the Component or by the Component's shared Style.

Returns:
the style name

getVisibleComponent

public final Component getVisibleComponent(int n)
Returns the nth immediate visible child Component.

Parameters:
n - the index of the Component to retrieve
Returns:
the Component at index n
Throws:
java.lang.IndexOutOfBoundsException - when the index is invalid

getVisibleComponentCount

public final int getVisibleComponentCount()
Returns the number of visible immediate child Components.

Returns:
the number of visible immediate child Components

getVisibleComponents

public final Component[] getVisibleComponents()
Returns an array of all visible immediate child Components.

Returns:
an array of all visible immediate child Components

hasEventListenerList

protected boolean hasEventListenerList()
Determines if a local EventListenerList exists. If no listener list exists, it can be assured that there are thus no listeners registered to it. This method should be invoked by event firing code prior to invoking getListenerList() to avoid unnecessary creation of an EventListenerList in response to their query.

Returns:
true if a local EventListenerList exists

indexOf

public final int indexOf(Component c)
Determines the index of the given Component within the children of this Component. If the given Component is not a child, -1 is returned.

Parameters:
c - the Component to analyze
Returns:
the index of the specified Component amongst the children of this Component

init

public void init()
Life-cycle method invoked when the Component is added to a registered hierarchy. Implementations should always invoke super.init(). Modifications to the component hierarchy are not allowed within this method.


isAncestorOf

public final boolean isAncestorOf(Component c)
Determines if this Component is or is an ancestor of the specified Component.

Parameters:
c - the Component to test for ancestry
Returns:
true if this Component is an ancestor of the specified Component

isEnabled

public final boolean isEnabled()
Determines the enabled state of this Component. DisabledComponents are not eligible to receive user input. The application container may render disabled components with an altered appearance.

Returns:
true if the component is enabled
See Also:
verifyInput(java.lang.String, java.lang.Object)

isFocusTraversalParticipant

public boolean isFocusTraversalParticipant()
Determines if the Component participates in (tab) focus traversal.

Returns:
true if the Component participates in focus traversal

isRegistered

public final boolean isRegistered()
Determines if the Component is registered to an ApplicationInstance.

Returns:
true if the Component is registered to an ApplicationInstance

isRenderEnabled

public final boolean isRenderEnabled()
Determines whether this Component should be rendered with an enabled state. DisabledComponents are not eligible to receive user input. The application container may render disabled components with an altered appearance.

Returns:
true if the component should be rendered enabled.

isRenderVisible

public final boolean isRenderVisible()
Determines if the Component and all of its parents are visible.

Returns:
true if the Component is recursively visible

isValidChild

public boolean isValidChild(Component child)
Determines if a given Component is valid to be added as a child to this Component. Default implementation always returns true, may be overridden to provide specific behavior.

Parameters:
child - the Component to evaluate as a child
Returns:
true if the Component is a valid child

isValidParent

public boolean isValidParent(Component parent)
Determines if this Component is valid to be added as a child of the given parent Component. Default implementation always returns true, may be overridden to provide specific behavior.

Parameters:
parent - the Component to evaluate as a parent
Returns:
true if the Component is a valid parent

isVisible

public final boolean isVisible()
Returns the visibility state of this Component. Non-visible components will not be seen by the rendering application container, and will not be rendered in any fashion on the user interface. Rendering Application Containers should ensure that no information about the state of an invisible component is provided to the user interface for security purposes.

Returns:
the visibility state of this Component

processInput

public void processInput(java.lang.String inputName,
                         java.lang.Object inputValue)
Processes client input specific to the Component received from the UpdateManager. Derivative implementations should take care to invoke super.processInput(). Security note: Because input to this method is likely from a remote client, it should be treated as potentially hostile. All input to this method should be carefully verified. For example, directly invoking set() method with the provided input would constitute a security hole.

Parameters:
inputName - the name of the input
inputValue - the value of the input
See Also:
UpdateManager

remove

public void remove(Component c)
Removes the specified child Component from this Component.

All Component remove operations use this method to remove Components. Components that require notification of all child removals should override this method (while ensuring to call the superclass' implementation).

Parameters:
c - the child Component to remove

remove

public void remove(int n)
Removes the Component at the nth index.

Parameters:
n - the index of the child Component to remove
Throws:
java.lang.IndexOutOfBoundsException - if the index is not valid

removeAll

public void removeAll()
Removes all child Components.


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a property change listener from this Component.

Parameters:
l - the listener to be removed

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener l)
Removes a property change listener from this Component for a specific property.

Parameters:
propertyName - the name of the property for which to listen
l - the listener to be removed

set

public void set(java.lang.String propertyName,
                java.lang.Object newValue)
Sets a generic property of the Component. The value will be stored in this Component's local style.

Parameters:
propertyName - the name of the property
newValue - the value of the property
See Also:
get(java.lang.String)

setBackground

public void setBackground(Color newValue)
Sets the default background color of the Component.

Parameters:
newValue - the new background Color

setComponents

public void setComponents(Component[] components)
Sets the child components for this container, removing any existing children.

Parameters:
components - the child components for this container.

setEnabled

public void setEnabled(boolean newValue)
Sets the enabled state of the Component.

Parameters:
newValue - the new state
See Also:
isEnabled()

setFocusTraversalIndex

public void setFocusTraversalIndex(int newValue)
Deprecated. Not supported.

See Also:
getFocusTraversalIndex()

setFocusTraversalParticipant

public void setFocusTraversalParticipant(boolean newValue)
Sets whether the component participates in the focus traversal order (tab order).

Parameters:
newValue - true if the component participates in the focus traversal order

setFont

public void setFont(Font newValue)
Sets the default text font of the Component.

Parameters:
newValue - the new Font

setForeground

public void setForeground(Color newValue)
Sets the default foreground color of the Component.

Parameters:
newValue - the new foreground Color

setId

public void setId(java.lang.String id)
Sets a user-defined identifier for this Component.

Parameters:
id - the new identifier

setIndex

public void setIndex(java.lang.String propertyName,
                     int propertyIndex,
                     java.lang.Object newValue)
Sets a generic indexed property of the Component. The value will be stored in this Component's local style.

Parameters:
propertyName - the name of the property
propertyIndex - the index of the property
newValue - the value of the property
See Also:
getIndex(java.lang.String, int)

setLayoutData

public void setLayoutData(LayoutData newValue)
Sets the LayoutData of this Component. A LayoutData implementation describes how this Component is laid out within/interacts with its containing parent Component.

Parameters:
newValue - the new LayoutData
See Also:
LayoutData

setLayoutDirection

public void setLayoutDirection(LayoutDirection newValue)
Sets the LayoutDirection of this Component, describing whether content is rendered left-to-right or right-to-left.

Parameters:
newValue - the new LayoutDirection.

setLocale

public void setLocale(java.util.Locale newValue)
Sets the locale of the Component.

Parameters:
newValue - the new locale
See Also:
getLocale()

setRenderId

public void setRenderId(java.lang.String renderId)
Sets a custom render identifier for this Component. The identifier may be changed without notification if another component is already using it. Identifiers are limited to ASCII alphanumeric values. The first character must be an upper- or lower-case ASCII letter. Underscores and other punctuation characters are not permitted. Use of "TitleCase" or "camelCase" is recommended.

Parameters:
renderId - the new identifier

setStyle

public void setStyle(Style newValue)
Sets the shared style of the Component. Setting the shared style will have no impact on the local stylistic properties of the Component.

Parameters:
newValue - the new shared style
See Also:
getStyle()

setStyleName

public void setStyleName(java.lang.String newValue)
Sets the name of the style to use from the ApplicationInstance-defined StyleSheet. Setting the style name will have no impact on the local stylistic properties of the Component.

Parameters:
newValue - the new style name
See Also:
getStyleName()

setVisible

public void setVisible(boolean newValue)
Sets the visibility state of this Component.

Parameters:
newValue - the new visibility state
See Also:
isVisible()

validate

public void validate()
A life-cycle method invoked before the component is rendered to ensure it is in a valid state. Default implementation is empty. Overriding implementations should ensure to invoke super.validate() out of convention.


verifyInput

public boolean verifyInput(java.lang.String inputName,
                           java.lang.Object inputValue)
Invoked by the ClientUpdateManager on each component in the hierarchy whose processInput() method will layer be invoked in the current transaction. This method should return true if the component will be capable of processing the given input in its current state or false otherwise. This method should not do any of the actual processing work if overridden (any actual processing should be done in the processInput() implementation).

The default implementation verifies that the component is visible, enabled, and not "obscured" by the presence of any modal component. If overriding this method, your implementation should invoke super.verifyInput().

Parameters:
inputName - the name of the input
inputValue - the value of the input
Returns:
true if the input is allowed to be processed by this component in its current state

visibleIndexOf

public final int visibleIndexOf(Component c)
Determines the index of the given Component within the visible children of this Component. If the given Component is not a child, -1 is returned.

Parameters:
c - the Component to analyze
Returns:
the index of the specified Component amongst the visible children of this Component

NextApp Echo3
v3.0.b4