Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nextapp.echo2.app
Class Component

    java.lang.Object
      nextapp.echo2.app.Component

All Implemented Interfaces:
  java.io.Serializable, RenderIdSupport

Direct Known Subclasses:
  AbstractButton, AbstractListComponent, ChartDisplay, Column, ComponentEx, ContentPane, DirectHtml, ExternalEventMonitor, Grid, Label, Row, SplitPane, Table, TextComponent, UploadSelect, 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 `Component`s. Certain `Component`s 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 `Component`s 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 `setProperty()` method. The `getProperty()` 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 `getProperty()`/`setProperty()` interface.

### Events

Many `Component`s will provide the capability to register `EventListener`s 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` | `CHILDREN_CHANGED_PROPERTY`
`static java.lang.String` | `ENABLED_CHANGED_PROPERTY`
`static java.lang.String` | `FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY`
`static java.lang.String` | `FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY`
`static java.lang.String` | `LAYOUT_DIRECTION_CHANGED_PROPERTY`
`static java.lang.String` | `LOCALE_CHANGED_PROPERTY`
`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`
`static java.lang.String` | `STYLE_NAME_CHANGED_PROPERTY`
`static java.lang.String` | `VISIBLE_CHANGED_PROPERTY`

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 `n`th child of this component.
`void` | `addPropertyChangeListener(java.beans.PropertyChangeListener l)` Adds a property change listener to this component.
`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 `PropertyChangeListener`s and to the `ApplicationInstance`'s update management system.
`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 `n`th 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 `Component`s.
`Component[]` | `getComponents()` Returns an array of all immediate child `Component`s.
`protected EventListenerList` | `getEventListenerList()` Returns the local `EventListenerList`.
`int` | `getFocusTraversalIndex()` Returns the focus traversal (tab) index of the component.
`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` | `getIndexedProperty(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.
`Component` | `getParent()` Returns the parent component.
`java.lang.Object` | `getProperty(java.lang.String propertyName)` Returns the value of the specified property.
`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.
`LayoutDirection` | `getRenderLayoutDirection()` Returns the rendered `LayoutDirection` of the `Component`.
`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`'s`StyleSheet` from which the renderer will retrieve properties.
`Component` | `getVisibleComponent(int n)` Returns the `n`th immediate visible child `Component`.
`int` | `getVisibleComponentCount()` Returns the number of visible immediate child `Component`s.
`Component[]` | `getVisibleComponents()` Returns an array of all visible immediate child `Component`s.
`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 `n`th index.
`void` | `removeAll()` Removes all child `Component`s.
`void` | `removePropertyChangeListener(java.beans.PropertyChangeListener l)` Removes a property change listener from this `Component`.
`void` | `setBackground(Color newValue)` Sets the default background color of the `Component`.
`void` | `setEnabled(boolean newValue)` Sets the enabled state of the `Component`.
`void` | `setFocusTraversalIndex(int newValue)` Sets the focus traversal (tab) index of the component.
`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` | `setIndexedProperty(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` | `setProperty(java.lang.String propertyName, java.lang.Object newValue)` Sets a generic property of the `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

### CHILDREN_CHANGED_PROPERTY

    public static final java.lang.String CHILDREN_CHANGED_PROPERTY

See Also:
  Constant Field Values

### ENABLED_CHANGED_PROPERTY

    public static final java.lang.String ENABLED_CHANGED_PROPERTY

See Also:
  Constant Field Values

### FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY

    public static final java.lang.String FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY

See Also:
  Constant Field Values

### FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY

    public static final java.lang.String FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY

See Also:
  Constant Field Values

### LAYOUT_DIRECTION_CHANGED_PROPERTY

    public static final java.lang.String LAYOUT_DIRECTION_CHANGED_PROPERTY

See Also:
  Constant Field Values

### LOCALE_CHANGED_PROPERTY

    public static final java.lang.String LOCALE_CHANGED_PROPERTY

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

### STYLE_CHANGED_PROPERTY

    public static final java.lang.String STYLE_CHANGED_PROPERTY

See Also:
  Constant Field Values

### STYLE_NAME_CHANGED_PROPERTY

    public static final java.lang.String STYLE_NAME_CHANGED_PROPERTY

See Also:
  Constant Field Values

### VISIBLE_CHANGED_PROPERTY

    public static final java.lang.String VISIBLE_CHANGED_PROPERTY

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 `n`th child of this component. All component-add operations use this method to add components. `Component`s that require notification of all child additions should override this method (making sure to call the superclass' implementation).

  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

### 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 `PropertyChangeListener`s 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

### 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 `n`th 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 `renderId`s.

  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 `Component`s.

  Returns:
    the number of immediate child `Component`s

### getComponents

    public final Component[] getComponents()

  Returns an array of all immediate child `Component`s.

  Returns:
    an array of all immediate child `Component`s

### 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()

  Returns the focus traversal (tab) index of the component. Components with numerically lower indices will be focused before components with numerically higher indices. The value 0 has special meaning, in that components with a value of 0 will be focused last. The default value is 0.

  Returns:
    the focus traversal index, a value between 0 and 32767

### 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

### getIndexedProperty

    public final java.lang.Object getIndexedProperty(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`
  See Also:
    `getRenderLayoutDirection()`

### 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`
  See Also:
    `getRenderLocale()`

### getParent

    public final Component getParent()

  Returns the parent component.

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

### getProperty

    public final java.lang.Object getProperty(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

### 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

### getRenderLayoutDirection

    public final LayoutDirection getRenderLayoutDirection()

  Returns the rendered `LayoutDirection` of the `Component`.

  Returns:
    the layout direction of this component

### 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 `Locale`s set, the `ApplicationInstance`'s locale will be returned. In the event that no locale information is available from the ancestral hierarchy of `Component`s 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 `Component`s. 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`'s`StyleSheet` 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 `n`th 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 `Component`s.

  Returns:
    the number of visible immediate child `Component`s

### getVisibleComponents

    public final Component[] getVisibleComponents()

  Returns an array of all visible immediate child `Component`s.

  Returns:
    an array of all visible immediate child `Component`s

### 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`. Disabled`Component`s 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. Disabled`Component`s 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()`.

  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 `Component`s. `Component`s 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 `n`th 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 `Component`s.

### removePropertyChangeListener

    public void removePropertyChangeListener(java.beans.PropertyChangeListener l)

  Removes a property change listener from this `Component`.

  Parameters:
    `l` - the listener to be removed

### setBackground

    public void setBackground(Color newValue)

  Sets the default background color of the `Component`.

  Parameters:
    `newValue` - the new background `Color`

### 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)

  Sets the focus traversal (tab) index of the component.

  Parameters:
    `newValue` - the new focus traversal index
  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

### setIndexedProperty

    public void setIndexedProperty(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:
    `getIndexedProperty(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()`

### setProperty

    public void setProperty(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:
    `getProperty(java.lang.String)`

### 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`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD