echopoint.ui
Class TextFieldUI

java.lang.Object
  extended by nextapp.echoservlet.AbstractComponentPeer
      extended by nextapp.echoservlet.ui.TextComponentUI
          extended by nextapp.echoservlet.ui.TextFieldUI
              extended by echopoint.ui.TextFieldUI
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, ClientActionProducer, ClientInputProducer, ComponentPeer
Direct Known Subclasses:
AbstractDateFieldUI, ClientDatePickerUI, ComboBoxUI, NumberFormatFieldUI, SpinFieldUI

public class TextFieldUI
extends TextFieldUI

TextFieldUI is the peer for the echopoint.TextField

Its has support for the new Validation classes as well as modularises the creation of the INPUT element.

See Also:
Serialized Form

Field Summary
protected  ToolTipPopUpSupportHelper toolTipHelper
          a ToolTipPopUpSupportHelper available to subclasses
 
Fields inherited from class nextapp.echoservlet.ui.TextFieldUI
SERVICE_TEXT_FIELD_SCRIPT
 
Fields inherited from class nextapp.echoservlet.ui.TextComponentUI
renderedActive
 
Fields inherited from interface nextapp.echoservlet.ComponentPeer
IGNORE_PROPERTY_CHANGE
 
Constructor Summary
TextFieldUI()
           
 
Method Summary
protected  java.lang.String generateOnBlurJavaScript(RenderingContext rc)
          Called to return the onblur script that saves the state of the TextField and also performs client side validation.
protected  java.lang.String generateOnChangeJavaScript(RenderingContext rc)
          Called to return the onchange script that saves the state of the TextField and also performs client side validation.
protected  ComponentStyle getStyle()
          Returns a ComponentStyle object suitable for this component.
protected  TextField getTextField()
          A helper method to get the TextField safelt instead of via (TextField) getComponent().
protected  Element getTextInput(RenderingContext rc, TextField textField, java.lang.String styleClassName)
          Called to return the HTML element that will be used as the visiual representation of the TextField.
static void register()
          Registers the Component with its peer bindings
 void registered()
          Called when the component is registered.
 void render(RenderingContext rc, Element parent)
          A method that should be overridden for the ComponentPeer to produce HTML output.
 void unregistered()
          Called when the component is unregistered.
 
Methods inherited from class nextapp.echoservlet.ui.TextFieldUI
clientAction
 
Methods inherited from class nextapp.echoservlet.ui.TextComponentUI
clientInput, propertyChange
 
Methods inherited from class nextapp.echoservlet.AbstractComponentPeer
addAncillaryService, generateId, getCalculatedBackground, getCalculatedFont, getCalculatedForeground, getChildCount, getChildren, getComponent, getFocusedElementId, getId, getInstancePeer, getParentComponentPeer, getPeer, redraw, registerAncillaryServices, removeAncillaryService, setComponent, setId, setInstancePeer, unregisterAncillaryServices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nextapp.echoservlet.ClientInputProducer
getId
 

Field Detail

toolTipHelper

protected ToolTipPopUpSupportHelper toolTipHelper
a ToolTipPopUpSupportHelper available to subclasses

Constructor Detail

TextFieldUI

public TextFieldUI()
Method Detail

registered

public void registered()
Description copied from class: AbstractComponentPeer
Called when the component is registered. This method should be overridden if necessary.

Specified by:
registered in interface ComponentPeer
Overrides:
registered in class TextComponentUI
See Also:
TextComponentUI.registered()

unregistered

public void unregistered()
Description copied from class: AbstractComponentPeer
Called when the component is unregistered. This method should be overridden if necessary.

Specified by:
unregistered in interface ComponentPeer
Overrides:
unregistered in class TextComponentUI
See Also:
TextComponentUI.unregistered()

register

public static void register()
Registers the Component with its peer bindings


getTextField

protected TextField getTextField()
A helper method to get the TextField safelt instead of via (TextField) getComponent().

Returns:
the TextField associated with this peer.

getStyle

protected ComponentStyle getStyle()
Description copied from class: TextComponentUI
Returns a ComponentStyle object suitable for this component. The style will include attributes for border color and border size if they are necessary.

Overrides:
getStyle in class TextComponentUI
Returns:
A ComponentStyle for the text component.
See Also:
TextComponentUI.getStyle()

getTextInput

protected Element getTextInput(RenderingContext rc,
                               TextField textField,
                               java.lang.String styleClassName)
Called to return the HTML element that will be used as the visiual representation of the TextField.

This default version returns a "input type=text" element that an id="getId()". It morphs into a "input type=password" if the field is indeed a PasswordField.

It also adds a tooltip support to the element.

Parameters:
rc - - ther renderind context in play
textField - -the textfield component
styleClassName - - the componentn style name to use
Returns:
the HTML element representing the textfield

generateOnBlurJavaScript

protected java.lang.String generateOnBlurJavaScript(RenderingContext rc)
Called to return the onblur script that saves the state of the TextField and also performs client side validation. It returns a script that ends in a semi colon, ready for chaining with other scripts.

Parameters:
rc - - The rendering
Returns:
the generated on blur script

generateOnChangeJavaScript

protected java.lang.String generateOnChangeJavaScript(RenderingContext rc)
Called to return the onchange script that saves the state of the TextField and also performs client side validation. It returns a script that ends in a semi colon, ready for chaining with other scripts.

Parameters:
rc - - The rendering
Returns:
the generated onchange script

render

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

Specified by:
render in interface ComponentPeer
Overrides:
render in class TextFieldUI
Parameters:
rc - A rendering context provided by the Connection.
parent - The element that will contain content rendered by this ComponentPeer.
See Also:
ComponentPeer.render(RenderingContext, Element)