NextApp Echo3
v3.0.rc1

nextapp.echo.webcontainer.sync.component
Class TextComponentPeer

java.lang.Object
  extended by nextapp.echo.webcontainer.AbstractComponentSynchronizePeer
      extended by nextapp.echo.webcontainer.sync.component.TextComponentPeer
All Implemented Interfaces:
ComponentSynchronizePeer
Direct Known Subclasses:
PasswordFieldPeer, TextAreaPeer, TextFieldPeer

public class TextComponentPeer
extends AbstractComponentSynchronizePeer

Base synchronization peer for TextComponents.


Nested Class Summary
 
Nested classes/interfaces inherited from class nextapp.echo.webcontainer.AbstractComponentSynchronizePeer
AbstractComponentSynchronizePeer.EventPeer
 
Field Summary
static java.lang.String INPUT_CHANGE
          Input property name for text change events.
static java.lang.String PROPERTY_SYNC_DELAY
          The time in milliseconds after which the server will be notified of changes to a text component.
static java.lang.String PROPERTY_SYNC_INITIAL_DELAY
          The time in milliseconds after which the server will first be notified of changes to a text component.
static java.lang.String PROPERTY_SYNC_MODE
          The mode in which the server should be synchronized in response to changes to a text component's value.
static int SYNC_ON_ACTION
          Constant for PROPERTY_SYNC_MODE indicating that the server should be notified of text changes only after an action event is fired.
static int SYNC_ON_CHANGE
          Constant for PROPERTY_SYNC_MODE indicating that the server should be notified of text changes after each change.
 
Constructor Summary
TextComponentPeer()
          Default constructor.
 
Method Summary
 java.lang.String getClientComponentType(boolean mode)
          Returns the remote client component type name.
 java.lang.Class getComponentClass()
          Returns the (most basic) supported component class.
 java.lang.Class getInputPropertyClass(java.lang.String propertyName)
          Returns null.
 java.lang.Object getOutputProperty(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, java.lang.String propertyName, int propertyIndex)
          Returns any property from the local style of the Component.
 void init(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component)
          Invokes the init() methods of peers of required component classes (added via addRequiredComponentClass()).
 void storeInputProperty(nextapp.echo.app.util.Context context, nextapp.echo.app.Component component, java.lang.String propertyName, int propertyIndex, java.lang.Object newValue)
          Does nothing.
 
Methods inherited from class nextapp.echo.webcontainer.AbstractComponentSynchronizePeer
addEvent, addOutputProperty, addOutputProperty, addRequiredComponentClass, getEventDataClass, getEventTypes, getOutputPropertyIndices, getOutputPropertyMethodName, getOutputPropertyNames, getUpdatedOutputPropertyNames, hasListeners, hasUpdatedListeners, isOutputPropertyIndexed, isOutputPropertyReferenced, processEvent, setOutputPropertyReferenced
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYNC_ON_ACTION

public static final int SYNC_ON_ACTION
Constant for PROPERTY_SYNC_MODE indicating that the server should be notified of text changes only after an action event is fired. EXPERIMENTAL, for testing purposes only, do not use.

See Also:
Constant Field Values

SYNC_ON_CHANGE

public static final int SYNC_ON_CHANGE
Constant for PROPERTY_SYNC_MODE indicating that the server should be notified of text changes after each change. The PROPERTY_SYNC_DELAY and PROPERTY_SYNC_INITIAL_DELAY properties may be used to configure the amount of inactivity after which change events are fired. EXPERIMENTAL, for testing purposes only, do not use.

See Also:
Constant Field Values

PROPERTY_SYNC_MODE

public static final java.lang.String PROPERTY_SYNC_MODE
The mode in which the server should be synchronized in response to changes to a text component's value. One of the following values: EXPERIMENTAL, for testing purposes only, do not use.

See Also:
Constant Field Values

PROPERTY_SYNC_DELAY

public static final java.lang.String PROPERTY_SYNC_DELAY
The time in milliseconds after which the server will be notified of changes to a text component. This value is used only when the synchronization mode is set to SYNC_ON_CHANGE. The default value is 250ms. EXPERIMENTAL, for testing purposes only, do not use.

See Also:
Constant Field Values

PROPERTY_SYNC_INITIAL_DELAY

public static final java.lang.String PROPERTY_SYNC_INITIAL_DELAY
The time in milliseconds after which the server will first be notified of changes to a text component. This value is used only when the synchronization mode is set to SYNC_ON_CHANGE. The default value is 0ms, such that the first change to a text component will immediately notify the server. EXPERIMENTAL, for testing purposes only, do not use.

See Also:
Constant Field Values

INPUT_CHANGE

public static final java.lang.String INPUT_CHANGE
Input property name for text change events.

See Also:
Constant Field Values
Constructor Detail

TextComponentPeer

public TextComponentPeer()
Default constructor.

Method Detail

getClientComponentType

public java.lang.String getClientComponentType(boolean mode)
Description copied from interface: ComponentSynchronizePeer
Returns the remote client component type name.

Parameters:
mode - a boolean flag indicating whether a component name (true) or style name (false) is being rendered
Returns:
the client component type name
See Also:
ComponentSynchronizePeer.getClientComponentType(boolean)

getComponentClass

public java.lang.Class getComponentClass()
Description copied from class: AbstractComponentSynchronizePeer
Returns the (most basic) supported component class.

Specified by:
getComponentClass in interface ComponentSynchronizePeer
Specified by:
getComponentClass in class AbstractComponentSynchronizePeer
Returns:
the (most basic) supported component class
See Also:
ComponentSynchronizePeer.getComponentClass()

getInputPropertyClass

public java.lang.Class getInputPropertyClass(java.lang.String propertyName)
Description copied from class: AbstractComponentSynchronizePeer
Returns null. Implementations receiving input properties should override.

Specified by:
getInputPropertyClass in interface ComponentSynchronizePeer
Overrides:
getInputPropertyClass in class AbstractComponentSynchronizePeer
Parameters:
propertyName - the name of the property
Returns:
the property Class
See Also:
AbstractComponentSynchronizePeer.getInputPropertyClass(java.lang.String)

getOutputProperty

public java.lang.Object getOutputProperty(nextapp.echo.app.util.Context context,
                                          nextapp.echo.app.Component component,
                                          java.lang.String propertyName,
                                          int propertyIndex)
Description copied from class: AbstractComponentSynchronizePeer
Returns any property from the local style of the Component. Implementations should override if they wish to support additional properties.

Specified by:
getOutputProperty in interface ComponentSynchronizePeer
Overrides:
getOutputProperty in class AbstractComponentSynchronizePeer
Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the Component being rendered
propertyName - the name of the property being rendered
propertyIndex - the property index (only relevant for indexed properties, -1 will be provided for non-indexed properties)
Returns:
the property value
See Also:
AbstractComponentSynchronizePeer.getOutputProperty( nextapp.echo.app.util.Context, nextapp.echo.app.Component, java.lang.String, int)

init

public void init(nextapp.echo.app.util.Context context,
                 nextapp.echo.app.Component component)
Description copied from class: AbstractComponentSynchronizePeer
Invokes the init() methods of peers of required component classes (added via addRequiredComponentClass()). Implementations requiring initialization should override this method and invoke the super-implementation out of convention (even if they do not presently have any dependencies on other components).

Specified by:
init in interface ComponentSynchronizePeer
Overrides:
init in class AbstractComponentSynchronizePeer
Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ServerMessage
component - the component being rendered
See Also:
ComponentSynchronizePeer.init(nextapp.echo.app.util.Context, Component)

storeInputProperty

public void storeInputProperty(nextapp.echo.app.util.Context context,
                               nextapp.echo.app.Component component,
                               java.lang.String propertyName,
                               int propertyIndex,
                               java.lang.Object newValue)
Description copied from class: AbstractComponentSynchronizePeer
Does nothing. Implementations that receive input from the client should override this method.

Specified by:
storeInputProperty in interface ComponentSynchronizePeer
Overrides:
storeInputProperty in class AbstractComponentSynchronizePeer
Parameters:
context - the relevant Context, provides standard contextual information described in class description, in addition to the following:
  • ClientMessage
  • ClientUpdateManager
component - the updated Component
propertyName - the name of the property
propertyIndex - the index of the property (or -1 in the typical case of a non-indexed property)
newValue - the new value of the property
See Also:
ComponentSynchronizePeer.storeInputProperty(Context, Component, String, int, Object)

NextApp Echo3
v3.0.rc1