org.wings
Class STextField

java.lang.Object
  extended by org.wings.SComponent
      extended by org.wings.STextComponent
          extended by org.wings.STextField
All Implemented Interfaces:
Serializable, Cloneable, EventListener, SDocumentListener, LowLevelEventListener, Renderable
Direct Known Subclasses:
SFormattedTextField, SPasswordField, XSuggest

public class STextField
extends STextComponent

Single-lined input component for text input which requires a surrounding SForm element.

Author:
Armin Haaf
See Also:
Serialized Form

Field Summary
protected  String actionCommand
          default action command to fire
protected  int columns
          maximum columns shown
protected  int maxColumns
          maximum columns allowed
 
Fields inherited from class org.wings.SComponent
DONE_RENDERING, dynamicStyles, enabled, propertyChangeSupport, SELECTOR_ALL, START_RENDERING, visible, WHEN_FOCUSED_OR_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_FRAME
 
Constructor Summary
STextField()
           
STextField(String text)
           
 
Method Summary
 void addActionListener(ActionListener listener)
          Adds an ActionListener to the button.
protected  void fireActionEvent()
          Notify all listeners that have registered as ActionListeners if the selected item has changed
protected  void fireActionPerformed(ActionEvent event)
          Fire an ActionEvent at each registered listener.
 void fireFinalEvents()
          Internal event trigger used by CGs.
 String getActionCommand()
          Returns the action commnand that is included in the event sent to action listeners.
 ActionListener[] getActionListeners()
          Returns an array of all the ActionListeners added to this AbstractButton with addActionListener().
 int getColumns()
          Returns the number of columns of the TextField.
 int getMaxColumns()
           
 void removeActionListener(ActionListener listener)
          Removes the supplied Listener from teh listener list
 void setActionCommand(String command)
          Sets the action commnand that should be included in the event sent to action listeners.
 void setCG(TextFieldCG cg)
           
 void setColumns(int c)
          Sets the number of columns of the TextField.
 void setMaxColumns(int mc)
           
 
Methods inherited from class org.wings.STextComponent
addDocumentListener, append, changedUpdate, fireIntermediateEvents, getDocument, getDocumentListeners, getText, insertUpdate, isEditable, isEpochCheckEnabled, processLowLevelEvent, removeDocumentListener, removeUpdate, setDocument, setEditable, setEpochCheckEnabled, setText
 
Methods inherited from class org.wings.SComponent
addComponentListener, addDynamicStyle, addEventListener, addNotify, addParentFrameListener, addPropertyChangeListener, addPropertyChangeListener, addRenderListener, addScriptListener, addStyle, clone, fireComponentChangeEvent, fireKeyEvents, fireRenderEvent, getActionMap, getBackground, getBorder, getCG, getClientProperty, getComponentPopupMenu, getDynamicStyle, getDynamicStyles, getFocusTraversalIndex, getFont, getForeground, getHorizontalAlignment, getInputMap, getInputMap, getListenerCount, getListenerList, getListeners, getLowLevelEventId, getName, getParent, getParentFrame, getPreferredSize, getRequestURL, getResidesInForm, getScriptListenerList, getScriptListeners, getSession, getShowAsFormComponent, getStyle, getToolTipText, getVerticalAlignment, invite, isDifferent, isEnabled, isFocusOwner, isRecursivelyVisible, isReloadForced, isUpdatePossible, isVisible, paramString, processComponentEvent, processKeyEvents, putClientProperty, reload, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, removeComponentListener, removeDynamicStyle, removeEventListener, removeNotify, removeParentFrameListener, removePropertyChangeListener, removePropertyChangeListener, removeRenderListener, removeScriptListener, removeStyle, requestFocus, scrollRectToVisible, setActionMap, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setBackground, setBorder, setCG, setComponentPopupMenu, setDynamicStyles, setEnabled, setFocusTraversalIndex, setFont, setForeground, setHorizontalAlignment, setInputMap, setInputMap, setName, setNameRaw, setParent, setParentFrame, setPreferredSize, setReloadForced, setShowAsFormComponent, setStyle, setToolTipText, setVerticalAlignment, setVisible, toString, update, updateCG, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.wings.LowLevelEventListener
getLowLevelEventId, getName, isEnabled
 

Field Detail

columns

protected int columns
maximum columns shown


maxColumns

protected int maxColumns
maximum columns allowed


actionCommand

protected String actionCommand
default action command to fire

Constructor Detail

STextField

public STextField()

STextField

public STextField(String text)
Method Detail

setColumns

public void setColumns(int c)
Sets the number of columns of the TextField.

Parameters:
c - the number of columns

getColumns

public int getColumns()
Returns the number of columns of the TextField.

Returns:
the number of columns

setMaxColumns

public void setMaxColumns(int mc)

getMaxColumns

public int getMaxColumns()

setCG

public void setCG(TextFieldCG cg)

setActionCommand

public void setActionCommand(String command)
Sets the action commnand that should be included in the event sent to action listeners.

Parameters:
command - a string containing the "command" that is sent to action listeners. The same listener can then do different things depending on the command it receives.

getActionCommand

public String getActionCommand()
Returns the action commnand that is included in the event sent to action listeners.

Returns:
the string containing the "command" that is sent to action listeners.

addActionListener

public void addActionListener(ActionListener listener)
Adds an ActionListener to the button.

Parameters:
listener - the ActionListener to be added

removeActionListener

public void removeActionListener(ActionListener listener)
Removes the supplied Listener from teh listener list


getActionListeners

public ActionListener[] getActionListeners()
Returns an array of all the ActionListeners added to this AbstractButton with addActionListener().

Returns:
all of the ActionListeners added or an empty array if no listeners have been added

fireActionPerformed

protected void fireActionPerformed(ActionEvent event)
Fire an ActionEvent at each registered listener.

Parameters:
event - the supplied ActionEvent

fireActionEvent

protected void fireActionEvent()
Notify all listeners that have registered as ActionListeners if the selected item has changed

See Also:
EventListenerList

fireFinalEvents

public void fireFinalEvents()
Description copied from class: SComponent
Internal event trigger used by CGs. This Method is called internal and should not be called directly

Specified by:
fireFinalEvents in interface LowLevelEventListener
Overrides:
fireFinalEvents in class STextComponent


wingS Swings ;-)