Decision Center API

ilog.webui.dhtml.components
Class IlxWTextField

java.lang.Object
  extended by ilog.webui.dhtml.IlxWContainer
      extended by ilog.webui.dhtml.IlxWComponent
          extended by ilog.webui.dhtml.components.IlxWLabelWrapper
              extended by ilog.webui.dhtml.components.IlxWTextField
All Implemented Interfaces:
ilog.webui.dhtml.IlxWConstants, ilog.webui.dhtml.IlxWCSSModelProvider, ilog.webui.dhtml.IlxWDependencyProvider, ilog.webui.dhtml.IlxWJSObject, Serializable

public class IlxWTextField
extends ilog.webui.dhtml.components.IlxWLabelWrapper

A text field component. This component is rendered as an <input type="text"> HTML element.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.webui.dhtml.IlxWComponent
IlxWComponent.DynamicStyleMap
 
Field Summary
 
Fields inherited from class ilog.webui.dhtml.components.IlxWLabelWrapper
cssDescriptor, cssModel, label
 
Fields inherited from class ilog.webui.dhtml.IlxWContainer
listenerList
 
Constructor Summary
IlxWTextField()
          Constructs an empty text field.
IlxWTextField(int columns)
          Constructs a text field with the given number of columns and no text.
IlxWTextField(String text)
          Constructs a text field with the given text.
IlxWTextField(String text, int columns)
          Constructs a text field with the given text and number of columns.
 
Method Summary
 void addActionListener(ActionListener l)
          Adds the specified action listener to receive action events from this text field.
protected  void fireActionPerformed()
          Notifies all listeners that have registered interest for notification on this event type.
 IlxWAction getAction()
          Gets the action to perform when the user enter some text in the text field.
 int getColumns()
           
 String getEmptyText()
          Gets the text to display when no text has been set on this text field.
 String getMenuClass()
           
 String getMenuItemSelectedClass()
           
 String getMenuItemUnSelectedClass()
           
 IlxWAction getOnKeyPressAction()
          Gets the action that will be called when a key is pressed in the input field representing this textfield.
 String getText()
          Gets the text of this text field.
protected  IlxWCSSRuleset getUserAgentRules()
          Gets the "user-agent" CSS rules.
 void notifyDependencies(IlxWPort port)
           
protected  void printComponent(IlxWPort port)
          Prints the HTML code that will display the graphical representation of this component.
 void removeActionListener(ActionListener l)
          Removes the specified action listener so that it no longer receives action events from this text field.
 void setAction(IlxWAction onChangeAction)
           
 void setColumns(int columns)
           
 void setEmptyText(String emptyText)
          Sets the text to display when no text has been set on this text field.
 void setMenuClass(String menuClass)
           
 void setMenuItemSelectedClass(String menuItemSelectedClass)
           
 void setMenuItemUnSelectedClass(String menuItemUnSelectedClass)
           
 void setOnKeyPressAction(IlxWAction onKeyPressAction)
          Sets the action that will be called when a key is pressed in the input field representing this textfield.
 void setText(String text)
          sets the text of this text field.
 
Methods inherited from class ilog.webui.dhtml.components.IlxWLabelWrapper
getCSSModel, getIconPath, getIcoPath, getLabel, setIconPath
 
Methods inherited from class ilog.webui.dhtml.IlxWComponent
addPropertyChangeListener, addPropertyChangeListener, detach, doPrint, firePropertyChange, firePropertyChange, getName, getRealHtmlTagName, getStyle, invalidate, isInvalidated, print, removePropertyChangeListener, removePropertyChangeListener, setName, validate
 
Methods inherited from class ilog.webui.dhtml.IlxWContainer
add, add, getAttribute, getAttributeNames, getComponent, getComponentCount, getComponentNamed, getComponents, getManager, getParent, indexOf, isAncestorOf, remove, remove, removeAll, removeAttribute, setAttribute, setAuthorRules, setFinalizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlxWTextField

public IlxWTextField()
Constructs an empty text field.


IlxWTextField

public IlxWTextField(int columns)
Constructs a text field with the given number of columns and no text.


IlxWTextField

public IlxWTextField(String text)
Constructs a text field with the given text. The number of columns is not set and is determined by the text length.


IlxWTextField

public IlxWTextField(String text,
                     int columns)
Constructs a text field with the given text and number of columns.

Method Detail

getColumns

public int getColumns()
Returns:
The number of columns.

setColumns

public void setColumns(int columns)
Parameters:
columns - The number of columns.

setText

public void setText(String text)
sets the text of this text field.

Overrides:
setText in class ilog.webui.dhtml.components.IlxWLabelWrapper
Parameters:
text - the displayed text

getText

public String getText()
Gets the text of this text field.

Overrides:
getText in class ilog.webui.dhtml.components.IlxWLabelWrapper
Returns:
The displayed text.

setEmptyText

public void setEmptyText(String emptyText)
Sets the text to display when no text has been set on this text field.

Parameters:
emptyText - The displayed text when no text has been set.

getEmptyText

public String getEmptyText()
Gets the text to display when no text has been set on this text field.

Returns:
The displayed text when no text has been set.

setAction

public void setAction(IlxWAction onChangeAction)
Parameters:
onChangeAction - the action to perform when the user enter some text in the text field.

getAction

public IlxWAction getAction()
Gets the action to perform when the user enter some text in the text field. By default, if setAction has no been called on this component, the action is a Java action which calls the fireActionPerformed() method.

Returns:
The associated action.

getOnKeyPressAction

public IlxWAction getOnKeyPressAction()
Gets the action that will be called when a key is pressed in the input field representing this textfield.

Returns:
the action. Null by default.

setOnKeyPressAction

public void setOnKeyPressAction(IlxWAction onKeyPressAction)
Sets the action that will be called when a key is pressed in the input field representing this textfield.

Parameters:
onKeyPressAction - an action.

getMenuItemUnSelectedClass

public String getMenuItemUnSelectedClass()

getMenuItemSelectedClass

public String getMenuItemSelectedClass()

setMenuItemSelectedClass

public void setMenuItemSelectedClass(String menuItemSelectedClass)

setMenuItemUnSelectedClass

public void setMenuItemUnSelectedClass(String menuItemUnSelectedClass)

getMenuClass

public String getMenuClass()

setMenuClass

public void setMenuClass(String menuClass)

printComponent

protected void printComponent(IlxWPort port)
                       throws IOException
Description copied from class: IlxWComponent
Prints the HTML code that will display the graphical representation of this component. This method is called by the IlxWComponent.print(ilog.webui.dhtml.IlxWPort) method.

Overrides:
printComponent in class ilog.webui.dhtml.components.IlxWLabelWrapper
Throws:
IOException
Parameters:
port - The port on which the component will be printed.
See Also:
IlxWComponent.print(ilog.webui.dhtml.IlxWPort)

addActionListener

public void addActionListener(ActionListener l)
Adds the specified action listener to receive action events from this text field.

Parameters:
l - the action listener

removeActionListener

public void removeActionListener(ActionListener l)
Removes the specified action listener so that it no longer receives action events from this text field.

Parameters:
l - the action listener

fireActionPerformed

protected void fireActionPerformed()
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method. The listener list is processed in last to first order.

See Also:
EventListenerList

getUserAgentRules

protected IlxWCSSRuleset getUserAgentRules()
Description copied from class: IlxWContainer
Gets the "user-agent" CSS rules.
User agent rules are a set of CSS rules which will apply by default to each instance of this container. They may be completed or overridden by the author rules, set via the setAuthorRules method.

This method returns null by default but is intended to be redefined by subclasses.

Overrides:
getUserAgentRules in class IlxWContainer
Returns:
a CSS ruleset.
See Also:
IlxWContainer.setAuthorRules(ilog.webui.dhtml.IlxWCSSRuleset)

notifyDependencies

public void notifyDependencies(IlxWPort port)
Specified by:
notifyDependencies in interface ilog.webui.dhtml.IlxWDependencyProvider
Overrides:
notifyDependencies in class IlxWComponent

Decision Center API

© Copyright IBM Corp. 1987, 2013