com.tirsen.angkor.widget
Class TextInput

java.lang.Object
  |
  +--com.tirsen.angkor.Component
        |
        +--com.tirsen.angkor.widget.TextInput
All Implemented Interfaces:
ChangeSource, java.io.Serializable, View

public class TextInput
extends Component
implements ChangeSource

Takes input from user as text.

Has the following functionality:

  • fetches its value from a ValueModel.
  • updates its value to the ValueModel.
  • has a prompt as a TextLabel.
  • has a configurable size.

    Version:
    $Revision: 1.5 $
    Author:
    $Author: tirsen $
    See Also:
    ValueModel, TextLabel, Serialized Form

    Constructor Summary
    TextInput()
               
    TextInput(java.lang.String id)
               
    TextInput(java.lang.String prompt, ValueModel model)
               
    TextInput(ValueModel model)
               
     
    Method Summary
     void addChangeListener(ChangeListener listener)
               
     ValueModel getModel()
               
     boolean isParsing()
              This widget is interested in parsing events.
     void parse(RenderContext context)
              Retrieves the value in the parameter named by Component.getId() and updates the model with this value.
     void removeChangeListener(ChangeListener listener)
               
     void render(RenderContext context)
              Render this view on the given context if the view is visible.
     void setModel(ValueModel model)
               
     void setPassword(boolean password)
               
     void setPrompt(java.lang.String promptText)
              Sets the text of the prompt.
     void setPrompt(TextLabel prompt)
              Set the prompt as a @{link TextLabel} widget.
     void setSize(int size)
               
     void setVisible(boolean visible)
              Specify whether this view is visible or not.
     
    Methods inherited from class com.tirsen.angkor.Component
    allocateUniqueId, getAttribute, getContainer, getId, getRenderContext, getVisibleIndex, isDebugTables, isVisible, setAttribute, setContainer, setId, uniqueId
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    TextInput

    public TextInput(java.lang.String id)

    TextInput

    public TextInput()

    TextInput

    public TextInput(java.lang.String prompt,
                     ValueModel model)

    TextInput

    public TextInput(ValueModel model)
    Method Detail

    addChangeListener

    public void addChangeListener(ChangeListener listener)
    Specified by:
    addChangeListener in interface ChangeSource

    removeChangeListener

    public void removeChangeListener(ChangeListener listener)
    Specified by:
    removeChangeListener in interface ChangeSource

    setSize

    public void setSize(int size)

    setPrompt

    public void setPrompt(TextLabel prompt)
    Set the prompt as a @{link TextLabel} widget. This enables more sofisticated display of a prompt than by using only a String. The prompt is displayed above the input-box.


    setPrompt

    public void setPrompt(java.lang.String promptText)
    Sets the text of the prompt. The prompt is displayed above the input-box.


    setVisible

    public void setVisible(boolean visible)
    Description copied from interface: View
    Specify whether this view is visible or not.

    Specified by:
    setVisible in interface View
    Overrides:
    setVisible in class Component

    setModel

    public void setModel(ValueModel model)

    isParsing

    public boolean isParsing()
    This widget is interested in parsing events.

    Overrides:
    isParsing in class Component
    Returns:
    true

    parse

    public void parse(RenderContext context)
    Retrieves the value in the parameter named by Component.getId() and updates the model with this value. The PropertyEditor specified by the model is used to parse the String into an Object.

    Specified by:
    parse in interface View
    Overrides:
    parse in class Component

    render

    public void render(RenderContext context)
                throws java.io.IOException
    Description copied from interface: View
    Render this view on the given context if the view is visible. Performed during render-phase.

    Specified by:
    render in interface View
    Specified by:
    render in class Component
    java.io.IOException
    See Also:
    View.setVisible(boolean), View.isVisible()

    setPassword

    public void setPassword(boolean password)

    getModel

    public ValueModel getModel()


    Copyright © 2002-2002 . All Rights Reserved.