NextApp Echo
App Container 1.1.4

nextapp.echoservlet
Class ComponentPeer

java.lang.Object
  extended bynextapp.echoservlet.ComponentPeer
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AbstractButtonUI, AbstractPaneUI, ColumnUI, ContainerUI, FillerUI, GridCellUI, GridUI, LabelUI, ListBoxUI, PanelUI, RowUI, SelectFieldUI, TableHeaderUI, TableUI, TextComponentUI, WindowUI

public abstract class ComponentPeer
extends java.lang.Object
implements java.io.Serializable

The base class from which all component peers are derived.

See Also:
Serialized Form

Constructor Summary
ComponentPeer()
          Creates a new ComponentPeer.
 
Method Summary
 void addAncillaryService(Service service)
          Adds an ancillary service to this ComponentPeer.
 Id generateId()
           
 nextapp.echo.Color getBackground()
          Returns the background color in which the component will be rendered.
protected  int getChildCount()
          Returns the number of visible child components contained in this component.
protected  ComponentPeer[] getChildren()
          Returns the peers for all of the referenced component's visible children.
 nextapp.echo.Component getComponent()
          Returns the component that is handled by this peer.
 java.lang.String getFocusedElementId()
           
 nextapp.echo.Font getFont()
          Returns the font in which the component will be rendered.
 nextapp.echo.Color getForeground()
          Returns the foreground color in which the component will be rendered.
 Id getId()
          Returns the Id by which this peer is identified on the client.
 InstancePeer getInstancePeer()
          Returns the InstancePeer with which this peer is associated.
protected  ComponentPeer getParent()
          Returns the peer of the associated component's component.
protected  ComponentPeer getPeer(nextapp.echo.Component component)
          Returns the peer of the specified component.
 int getTabIndex()
          Returns the tab index of the component, recursively querying parent components for the information if the tab index of a component is not set.
 void redraw()
          Requests that the component be redrawn on the client.
protected  void registered()
          Called when the component is registered.
 void removeAncillaryService(Service service)
          Removes an ancillary service from this ComponentPeer.
 void render(RenderingContext rc, Element parent)
          A method that should be overridden for the ComponentPeer to produce HTML output.
protected  void unregistered()
          Called when the component is unregistered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentPeer

public ComponentPeer()
Creates a new ComponentPeer.

Method Detail

addAncillaryService

public void addAncillaryService(Service service)
Adds an ancillary service to this ComponentPeer. Ancillary services will be registered for the life of the ComponentPeer and automatically removed when it is unregistered. An ancillary service should be used by ONLY one peer, as the peer will register and unregister it from the ServiceRegistry as required.

Parameters:
service - The ancillary service to be added.

getBackground

public nextapp.echo.Color getBackground()
Returns the background color in which the component will be rendered. The color will be determined by examining the represented component and then its ancestors until a background color can be determined.

Returns:
The background color in which the component will be rendered.

generateId

public Id generateId()

getChildCount

protected int getChildCount()
Returns the number of visible child components contained in this component.

Returns:
The number of visible child components.

getChildren

protected ComponentPeer[] getChildren()
Returns the peers for all of the referenced component's visible children.

Returns:
The peers of all visible child components of this peer's represented component.

getComponent

public nextapp.echo.Component getComponent()
Returns the component that is handled by this peer.

Returns:
The component that is handled by this peer.

getFocusedElementId

public java.lang.String getFocusedElementId()

getFont

public nextapp.echo.Font getFont()
Returns the font in which the component will be rendered. The font will be determined by examining the represented component and then its ancestors until a font can be determined.

Returns:
The font in which the component will be rendered.

getForeground

public nextapp.echo.Color getForeground()
Returns the foreground color in which the component will be rendered. The color will be determined by examining the represented component and then its ancestors until a foreground color can be determined.

Returns:
The foreground color in which the component will be rendered.

getId

public Id getId()
Returns the Id by which this peer is identified on the client.

Returns:
The Id by which this peer is identified on the client.

getInstancePeer

public InstancePeer getInstancePeer()
Returns the InstancePeer with which this peer is associated. If the peer is unregistered, null will be returned.

Returns:
The InstancePeer with which this peer is associated.

getParent

protected ComponentPeer getParent()
Returns the peer of the associated component's component.

Returns:
The peer of the associated component's component.

getPeer

protected ComponentPeer getPeer(nextapp.echo.Component component)
Returns the peer of the specified component.

Parameters:
component - The component whose peer is to be returned.
Returns:
The peer of the specified component.

getTabIndex

public int getTabIndex()
Returns the tab index of the component, recursively querying parent components for the information if the tab index of a component is not set.

Returns:
The tab index with which the component should be rendered.

redraw

public void redraw()
Requests that the component be redrawn on the client.


registered

protected void registered()
Called when the component is registered. This method should be overridden if necessary.


removeAncillaryService

public void removeAncillaryService(Service service)
Removes an ancillary service from this ComponentPeer. Ancillary services will be registered for the life of the ComponentPeer and automatically removed when it is unregistered. An ancillary service should be used by ONLY one peer, as the peer will register and unregister it from the ServiceRegistry as required.

Parameters:
service - The ancillary service to be removed.

render

public void render(RenderingContext rc,
                   Element parent)
A method that should be overridden for the ComponentPeer to produce HTML output.

Parameters:
rc - A rendering context provided by the Connection.
parent - The element that will contain content rendered by this ComponentPeer.

unregistered

protected void unregistered()
Called when the component is unregistered. This method should be overridden if necessary.


NextApp Echo
App Container 1.1.4