SilverStream
Application Server 3.5

com.sssw.rt.form
Class AgcTextField

java.lang.Object
 |
 +--java.awt.Component
       |
       +--java.awt.TextComponent
             |
             +--java.awt.TextField
                   |
                   +--com.sssw.rt.atlas.AtTextField
                         |
                         +--com.sssw.rt.form.AgcTextField
All Implemented Interfaces:
AgiControl, AgiHelpInfo, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
AgcPasswordField, AgcValueField

public class AgcTextField
extends com.sssw.rt.atlas.AtTextField
implements AgiControl, AgiHelpInfo

Displays data to, or accepts input from, the user. Can also be bound to a database column. The data type of the TextField control can be customized with the Type property.

The available TextField controls include:

Properties:
Alignment, Background Color, Control Type, Data Column, Data Type, Display Format, Editable, Enabled, Font Name, Font Size, Font Style, Height, Help Page, Left, Max Length, Min Length, Name, Text Color, Tool Tip, Top, Validation Rules, Visible, Width
Events:
focusGained, focusLost, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, textValueChanged, validationFailed, validationTest, valueChanged
See Also:
Serialized Form

Field Summary
static int NO_LIMIT
          Used to remove a limit on the allowed number of characters.
 
Fields inherited from class com.sssw.rt.atlas.AtTextField
ENFORCE_CASE_LOWER, ENFORCE_CASE_NONE, ENFORCE_CASE_UPPER
 
Fields inherited from class java.awt.TextComponent
textListener
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.sssw.rt.form.AgiControl
IMAGE_MODE_CENTERED, IMAGE_MODE_NORMAL, IMAGE_MODE_STRETCH, IMAGE_MODE_TILED
 
Constructor Summary
AgcTextField()
           
 
Method Summary
 Color getBackgroundColor()
          Deprecated. use Component.getBackground().
 boolean getEditable()
          Deprecated. use TextComponent.isEditable().
 boolean getEmptyStringIsNull()
          Returns true if the "value" of any empty text control should be null, instead of the empty String.
 AgoFontIdentifier getFontIdentifier()
          (AgiControl) Get the control's FontIdentifier.
 int getMaxLength()
          Returns the maximum length as an integer.
 int getMinLength()
          Returns the minimum length as an integer.
 Color getTextColor()
          Deprecated. use Component.getBackground().
 void setBackgroundColor(Color backgroundcolor)
          Deprecated. use Component.setBackground(Color).
 void setEmptyStringIsNull(boolean b)
          If set to true, then the value of an empty text control is null, instead of the empty String.
 void setFontIdentifier(AgoFontIdentifier fontidentifier)
          (AgiControl) Set the control's FontIdentifier.
 void setMaxLength(int length)
          Set the maximum length.
 void setMinLength(int length)
          Set the minimum length.
 void setTextColor(Color color)
          Deprecated. use Component.setForeground(Color).
 
Methods inherited from class com.sssw.rt.atlas.AtTextField
deliverMouseEvent, deliverMouseMoveEvent, doAtCommand, enableAtCommands, getEnforceCase, getHelper, getToolTipText, getToolTipText, grabFocus, grabTabstopFocus, isFocusTraversable, isRequestFocusEnabled, preprocessKeyEvent, processEvent, requestFocus, setEnforceCase, setRequestFocusEnabled, setToolTipText
 
Methods inherited from class java.awt.TextField
addActionListener, addNotify, echoCharIsSet, getColumns, getEchoChar, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, minimumSize, minimumSize, paramString, preferredSize, preferredSize, processActionEvent, removeActionListener, setColumns, setEchoChar, setEchoCharacter, setText
 
Methods inherited from class java.awt.TextComponent
addTextListener, getCaretPosition, getSelectedText, getSelectionEnd, getSelectionStart, getText, isEditable, processTextEvent, removeNotify, removeTextListener, select, selectAll, setCaretPosition, setEditable, setSelectionEnd, setSelectionStart
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods implemented from interface com.sssw.rt.form.AgiControl
getBackgroundImage, getBackgroundImageMode, getComponent, getHelpInfo, setBackgroundImage, setBackgroundImageMode, setHelpInfo
 

Field Detail

NO_LIMIT

public static final int NO_LIMIT
Used to remove a limit on the allowed number of characters.
See Also:
AgcTextField.setMaxLength(int), AgcTextField.setMinLength(int)
Constructor Detail

AgcTextField

public AgcTextField()
Method Detail

getEmptyStringIsNull

public boolean getEmptyStringIsNull()
Returns true if the "value" of any empty text control should be null, instead of the empty String. The value is what gets written to the database, for a data-bound control. Default is false. Note that getText() still returns the empty String, regardless of this setting.

setEmptyStringIsNull

public void setEmptyStringIsNull(boolean b)
If set to true, then the value of an empty text control is null, instead of the empty String.

getMaxLength

public int getMaxLength()
Returns the maximum length as an integer.

getMinLength

public int getMinLength()
Returns the minimum length as an integer.

setMaxLength

public void setMaxLength(int length)
Set the maximum length. If the user tries to enter a longer string, a validationFailed event is fired. Use the constant AgcTextField.NO_LIMIT to disable the limit.
Example:

This code sets the maximum number of characters allowed in the text field to 8.

  ControlName1.setMaxLength(8);
 
See Also:
AgcTextField.setMinLength(int)

setMinLength

public void setMinLength(int length)
Set the minimum length. If the user tries to enter a shorter string, a validationFailed event is fired. Use the constant AgcTextField.NO_LIMIT to disable the limit.
Parameters:
length -  
Example:

This code sets the minimum number of characters allowed in the text field to 2.

  ControlName1.setMinLength(2);
 
See Also:
AgcTextField.setMaxLength(int)

getFontIdentifier

public AgoFontIdentifier getFontIdentifier()
(AgiControl) Get the control's FontIdentifier.

setFontIdentifier

public void setFontIdentifier(AgoFontIdentifier fontidentifier)
(AgiControl) Set the control's FontIdentifier.

getBackgroundColor

public Color getBackgroundColor()
Deprecated. use Component.getBackground().

(AgiControl) Get the component background color.

setBackgroundColor

public void setBackgroundColor(Color backgroundcolor)
Deprecated. use Component.setBackground(Color).

(AgiControl) Set the component background color.

getEditable

public boolean getEditable()
Deprecated. use TextComponent.isEditable().

Return true if the text field is editable.

getTextColor

public Color getTextColor()
Deprecated. use Component.getBackground().

Get the text color.

setTextColor

public void setTextColor(Color color)
Deprecated. use Component.setForeground(Color).

Set the text color.

SilverStream
Application Server 3.5