All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Components |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sas.awt
Class TextField

    com.sas.awt.TextField

All Implemented Interfaces:
  VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.ComponentInterface, com.sas.lang.StringDataInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, com.sas.PublicClonable, ValidatorInterface, com.sas.ViewDefaultModelInterface, com.sas.ViewInterface, MultipleValueEventSourceInterface, ResizeToFitInterface, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.accessibility.Accessible

Direct Known Subclasses:
  NumericTextField

    public class TextField

implements java.beans.PropertyChangeListener, com.sas.PublicClonable, ResizeToFitInterface, ValidatorInterface, com.sas.ViewDefaultModelInterface, com.sas.lang.StringDataInterface

TextField is a component that can set and display a single line of text. It can be set to not accept keystrokes through the setEditable method. The TextField can be created with a specified number of columns.
Creation:

1. Create a TextField
   `TextField textField1 = new TextField();`
   `textField1.initialize();`
2. Create a TextField with the specified text
   `TextField textField1 = new TextField("text");`
   `textField1.initialize();`
   where text is the text that will appear in the TextField
3. Create a TextField with the specified text and columns
   `TextField textField1 = new TextField("text", columns);`
   `textField1.initialize();`
   where:
   - text is the text that will appear in the textArea
   - columns is an integer that specifies the number of columns
4. Create a TextField with the specified number of columns
   `TextField textField1 = new TextField(columns);`
   `textField1.initialize();`
   where:
   - columns is an integer that specifies the number of columns

Default Size:

- height = 23
- width = 124

Required Interfaces:
TextField requires a model that implements the com.sas.lang.StringDataInterface interface. A default model is automatically created and attached to the TextField when the TextField is initially constructed.
Events:
TextField sends a TextEvent when any change occurs to the displayed text. An ActionEvent is sent when the ENTER key is pressed.
Notes

- TextField implements the com.sas.collection.ContentsChangedListener, com.sas.PublicClonable, com.sas.visuals.ResizeToFitInterface, and com.sas.util.validators.ValidatorInterface interfaces.
- The editable property indicates whether the TextField accepts keystrokes. The initial setting is true which indicates that keystrokes are accepted. If the editable property is set to false, the TextField text can still be modified by using the setText(String) method.
- Setting the resizeToFit property to true will cause the textField to expand or contract depending on the size of the textField text. The resizeToFit property is initially set to false. If the component is managed by a layout manager that uses preferred sizes, the component will behave as if the resizeToFit property has been set to true regardless of the actual value of the resizeToFit property.
- The setEchoCharacter() method is used to specify a character that will be displayed in the TextField instead of the actual character that was entered. This is often used when the user input shouldn't be echoed to the screen (entering a password, as an example). The echoCharacter can be cleared by setting it to '0' (actual text will then be displayed).
- Text can be validated by supplying a validator through the setValidator(validator) method. If the text does not satisfy the criteria in the validator, an appropriate error message can be displayed if an error handler has been set through the setErrorHandler(errorHandler) method. Validators must implement the com.sas.util.validators.ValidationInterface. ErrorHandlers must implement the com.sas.util.errorhandlers.ErrorHandlerInterface.

- Usage Information Specific to a Design-Time Environment
  - If you set the rows in the property sheet, and then choose to change the size of the TextField through some other method (dragging the handles, etc.), you must set the rows property to 0 in the property sheet.
  - For Version 2.0 (XML Generation): Due to the way that the editable property is implemented (in AWT), changing both the backgroundColor and the editable property may not produce the changes intended. If you set the backgroundColor to a color other than the default color, change the editable property to false, and then change the editable property to true, the backgroundColor may not be restored to the color that you selected (results are dependant as to when you actually build the project --.ie if you make the changes WITHOUT building the project, the backgroundColor should be restored correctly. If you build the project after setting the editable propery to false, the backgroundColor will not be restored correctly. You will need to set the backgroundColor to the color that you intended).

  See Also:
    Serialized Form

  Field Summary
  `protected com.sas.util.datamonitors.DataMonitorInterface` | `dataMonitor`
  `protected ErrorHandlerInterface` | `errorHandler`
  `protected boolean` | `inSetTextOnModel`
  `protected boolean` | `isValid`
  `static java.lang.String` | `RB_KEY`
  `protected java.lang.Object` | `setTextOnModelLock`
  `protected ValidationInterface` | `validator`

  Constructor Summary
  `TextField()` Default constructor
  `TextField(int columns)` Create a TextField with the specified columns
  `TextField(java.lang.String text)` Create a TextField with the specified text
  `TextField(java.lang.String text, int columns)` Create a TextField with the specified text and columns

  Method Summary
  `void` | `addNotify()` Notifies the component that it has been added to a container and that the peer should be created.
  `void` | `append(java.lang.String str)` Appends the given text to the end of the string.
  `void` | `attachModel(com.sas.ModelInterface model)` Attaches a model to the component.
  `java.lang.Object` | `clone()` Clones the component
  `java.awt.Dimension` | `computePreferredSize()` Returns the preferred size of the component
  `void` | `delete(int start, int end)` Deletes text from the indicated start to end position.
  `void` | `deselectAll()` Deselects the selected text in the TextField.
  `void` | `detachModel(com.sas.ModelInterface model)` Detaches the current model and attaches the default model if the model is set to null
  `com.sas.util.datamonitors.DataMonitorInterface` | `getDataMonitor()` Returns the dataMonitor
  `static int` | `getDefaultHeight()` Returns the default height for instances of this class
  `static int` | `getDefaultWidth()` Returns the default width for instances of this class
  `ErrorHandlerInterface` | `getErrorHandler()` Returns the errorHandler or null if none is set
  `static com.sas.beans.ExtendedBeanInfo` | `getExtendedBeanInfo()` Returns the ExtendedBeanInfo for this class.
  `java.util.Vector` | `getRequiredInterfaces()` Returns the required interfaces Vector for this component.
  `ValidationInterface` | `getValidator()` Returns the name of the validator or null if none is set
  `protected void` | `handleError()` Internal routine for displaying an error message when text fails the validation rules
  `void` | `insert(java.lang.String str, int pos)` Inserts the specified text at the specified position.
  `boolean` | `isAutoHighlight()` Returns the value of the autoHighlight property.
  `boolean` | `isDefaultModelAttached()` Returns whether the default model is attached.
  `boolean` | `isKeystrokeUpdate()` Returns the value of the keystrokeUpdate property.
  `boolean` | `isResizeToDefaultSize()` Returns the value of the resizeToDefaultSize property.
  `boolean` | `isResizeToFit()` Returns the value of the resizeToFit property.
  `boolean` | `isValid()` Internal routine that checks if a validator is set.
  `protected void` | `processActionEvent(java.awt.event.ActionEvent e)` Processes action events occurring on this component.Subclasses should always call super so that events are delivered to any ActionListeners.
  `protected void` | `processFocusEvent(java.awt.event.FocusEvent e)` Processes focus events occurring on this component.Subclasses should always call super so that events are delivered to any FocusListeners.
  `protected void` | `processKeyEvent(java.awt.event.KeyEvent e)` Processes key events occurring on this component.
  `protected void` | `processMouseEvent(java.awt.event.MouseEvent e)` Processes mouse events occurring on this component.
  `protected void` | `processMouseMotionEvent(java.awt.event.MouseEvent e)` Processes mouse motion events occurring on this component.
  `void` | `propertyChange(java.beans.PropertyChangeEvent event)` Processes a PropertyChangeEvent sent by the model.
  `void` | `refresh()` Sets the text for the AWT TextField component from text obtained from the attached model
  `void` | `refresh(com.sas.ModelInterface Model)` Sets the text for the AWT TextField component from text obtained from the attached model
  `void` | `replaceRange(java.lang.String str, int start, int end)` Replaces text from the indicated start to end position with the new text specified.
  `void` | `select(int selectionStart, int selectionEnd)` Selects the text found between the specified start and end positions.
  `void` | `selectAll()` Selects all the text in the TextField
  `void` | `setAutoHighlight(boolean value)` Sets the specified boolean to indicate whether or not all text in the component will be selected when the component receives focus.
  `void` | `setBounds(int x, int y, int width, int height)` Reshapes the Component to the specified bounding box.
  `void` | `setBounds(java.awt.Rectangle r)` Reshapes the Component to the specified bounding box.
  `void` | `setCaretPosition(int position)` Sets the caret position
  `void` | `setColumns(int columns)` Sets the number of columns for the TextField
  `void` | `setDataMonitor(com.sas.util.datamonitors.DataMonitorInterface dataMonitor)` Sets the Data Monitor.
  `static void` | `setDefaultHeight(int newDefaultHeight)` Sets the default height of the component.
  `void` | `setDefaultValues()` Sets the initial values to the default values.
  `static void` | `setDefaultWidth(int newDefaultWidth)` Sets the default width of the component.
  `void` | `setEchoChar(char echoChar)` Sets the echo character for this TextField.
  `void` | `setEditable(boolean t)` Sets the specified boolean to indicate whether or not the TextField is editable (accepts keystokes).
  `void` | `setErrorHandler(ErrorHandlerInterface errorHandler)` Sets the errorHandler for the textArea.
  `void` | `setFont(java.awt.Font font)` Sets the font to be used by the component for displaying text.
  `void` | `setKeystrokeUpdate(boolean value)` Sets the specified boolean to indicate whether an event is sent whenever a character is typed in the TextField.
  `void` | `setResizeToDefaultSize(boolean resizeState)` Sets the value of the resizeToDefaultSize property.
  `void` | `setResizeToFit(boolean resizeState)` Sets the value of the resizeToFit property.
  `void` | `setSelectionEnd(int selectionEnd)` Sets the selection end to the specified position.
  `void` | `setSelectionStart(int selectionStart)` Sets the selection start to the specified position.
  `void` | `setText(java.lang.String text)` Sets the text of this TextField to the specified text.
  `protected boolean` | `setTextOnModel(java.lang.String text)` Internal routine that checks if a validator is set.
  `void` | `setValidator(ValidationInterface validator)` Sets the validator for the textArea.

  Methods inherited from class com.sas.awt.TextFieldVisualComponent
  `addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachView, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getMinimumSize, getModelInterface, getPreferredSize, getPrePainter, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initialize, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, paint, queryLinks, queryLinks, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBackgroundColor, setBorder, setComponentDescription, setComponentSupportInfo, setEnabled, setFocus, setForegroundColor, setHeight, setHorizontalPosition, setLinkInfo, setModelInterface, setPreferredSize, setPrePainter, setRequiredInterfaces, setTransparent, setVerticalPosition, setViewInterfaceSupportInfo, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, update, validateObject`

  Field Detail

  ### validator

      protected ValidationInterface validator

  ### errorHandler

      protected ErrorHandlerInterface errorHandler

  ### isValid

      protected boolean isValid

  ### setTextOnModelLock

      protected transient java.lang.Object setTextOnModelLock

  ### inSetTextOnModel

      protected transient boolean inSetTextOnModel

  ### dataMonitor

      protected com.sas.util.datamonitors.DataMonitorInterface dataMonitor

  ### RB_KEY

      public static final java.lang.String RB_KEY

  See Also:
    Constant Field Values

  Constructor Detail

  ### TextField

      public TextField()

    Default constructor

  ### TextField

      public TextField(java.lang.String text)

    Create a TextField with the specified text

    Parameters:
      `text` - text

  ### TextField

      public TextField(java.lang.String text,
                       int columns)

    Create a TextField with the specified text and columns

    Parameters:
      `text` - text
      `columns` - number of columns

  ### TextField

      public TextField(int columns)

    Create a TextField with the specified columns

    Parameters:
      `columns` - number of columns

  Method Detail

  ### getDefaultWidth

      public static int getDefaultWidth()

    Returns the default width for instances of this class

    Returns:
      the default width in pixels
    See Also:
      `setDefaultWidth(int)`

  ### setDefaultWidth

      public static void setDefaultWidth(int newDefaultWidth)

    Sets the default width of the component. The default width will be used by webAF when creating this component.

    Parameters:
      `newDefaultWidth` - the new default width in pixels
    See Also:
      `getDefaultWidth()`

  ### getDefaultHeight

      public static int getDefaultHeight()

    Returns the default height for instances of this class

    Returns:
      the default height in pixels
    See Also:
      `setDefaultHeight(int)`

  ### setDefaultHeight

      public static void setDefaultHeight(int newDefaultHeight)

    Sets the default height of the component. The default height will be used by webAF when creating this component.

    Parameters:
      `newDefaultHeight` - the new default height in pixels
    See Also:
      `getDefaultHeight()`

  ### getExtendedBeanInfo

      public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()

    Returns the ExtendedBeanInfo for this class.

    Returns:
      ExtendedBeanInfo for this class

  ### append

      public void append(java.lang.String str)

    Appends the given text to the end of the string. Any text that is currently selected will be deselected.

    Parameters:
      `str` - text to append

  ### addNotify

      public void addNotify()

    Notifies the component that it has been added to a container and that the peer should be created.

    Overrides:
      `addNotify` in class `java.awt.TextField`

  ### attachModel

      public void attachModel(com.sas.ModelInterface model)

    Attaches a model to the component. Listens for PropertyChangeEvents from the model.

    Specified by:
      `attachModel` in interface `com.sas.ViewInterface`
    Overrides:
      `attachModel` in class `TextFieldVisualComponent`
    Parameters:
      `model` - model to attach
    See Also:
      `ViewInterface.attachModel(com.sas.ModelInterface)`

  ### clone

      public java.lang.Object clone()
                             throws java.lang.CloneNotSupportedException

    Clones the component

    Specified by:
      `clone` in interface `com.sas.PublicClonable`
    Overrides:
      `clone` in class `TextFieldVisualComponent`
    Returns:
      new instance of the textField
    Throws:
      `java.lang.CloneNotSupportedException` - if the model attached to the component being cloned will not allow the clone to attach.

  ### computePreferredSize

      public java.awt.Dimension computePreferredSize()

    Returns the preferred size of the component

    Specified by:
      `computePreferredSize` in interface `VisualInterface`
    Overrides:
      `computePreferredSize` in class `TextFieldVisualComponent`
    Returns:
      preferred size
    See Also:
      `VisualInterface.computePreferredSize()`

  ### delete

      public void delete(int start,
                         int end)

    Deletes text from the indicated start to end position. Any text that is currently selected will be deselected. The start and end positions are zero based and are interchangeable (start position does not have to be greater than end position). If the original start position (specified start position > specified end position) is less than zero, the delete will not occur. If the end position is greater than the current text length or less than zero, the end position will be set to the current text length.

    Parameters:
      `start` - start position
      `end` - end position

  ### deselectAll

      public void deselectAll()

    Deselects the selected text in the TextField.

  ### detachModel

      public void detachModel(com.sas.ModelInterface model)

    Detaches the current model and attaches the default model if the model is set to null

    Specified by:
      `detachModel` in interface `com.sas.ViewInterface`
    Overrides:
      `detachModel` in class `TextFieldVisualComponent`
    Parameters:
      `model` - Model to detach
    See Also:
      `ViewInterface.detachModel(com.sas.ModelInterface)`

  ### getDataMonitor

      public com.sas.util.datamonitors.DataMonitorInterface getDataMonitor()

    Returns the dataMonitor

    Returns:
      dataMonitor
    See Also:
      `setDataMonitor(com.sas.util.datamonitors.DataMonitorInterface)`

  ### getErrorHandler

      public ErrorHandlerInterface getErrorHandler()

    Returns the errorHandler or null if none is set

    Specified by:
      `getErrorHandler` in interface `ValidatorInterface`
    Returns:
      errorHandler
    See Also:
      `setErrorHandler(com.sas.util.errorhandlers.ErrorHandlerInterface)`

  ### getRequiredInterfaces

      public java.util.Vector getRequiredInterfaces()

    Returns the required interfaces Vector for this component.

    Specified by:
      `getRequiredInterfaces` in interface `com.sas.ViewInterface`
    Overrides:
      `getRequiredInterfaces` in class `TextFieldVisualComponent`
    Returns:
      the required interfaces Vector for this component.
    See Also:
      `ViewInterface.getRequiredInterfaces()`

  ### getValidator

      public ValidationInterface getValidator()

    Returns the name of the validator or null if none is set

    Specified by:
      `getValidator` in interface `ValidatorInterface`
    Returns:
      validator
    See Also:
      `setValidator(com.sas.util.validators.ValidationInterface)`

  ### handleError

      protected void handleError()

    Internal routine for displaying an error message when text fails the validation rules

    See Also:
      `setValidator(com.sas.util.validators.ValidationInterface)`, `setErrorHandler(com.sas.util.errorhandlers.ErrorHandlerInterface)`

  ### insert

      public void insert(java.lang.String str,
                         int pos)

    Inserts the specified text at the specified position. Any text that is currently selected will be deselected. If the specified position is greater than the current text length, the text to be inserted will be appended to the current text. If the specified position is less than zero, the text to be inserted will be prepended to the current text.

    Parameters:
      `str` - text to insert
      `pos` - position at which to insert

  ### isAutoHighlight

      public boolean isAutoHighlight()

    Returns the value of the autoHighlight property. The autoHighlight property indicates whether or not all text in the component will be selected when the component receives focus.

    Returns:
      value of the autoHighlight property
    See Also:
      `setAutoHighlight(boolean)`

  ### isDefaultModelAttached

      public boolean isDefaultModelAttached()

    Returns whether the default model is attached.

    Specified by:
      `isDefaultModelAttached` in interface `com.sas.ViewDefaultModelInterface`
    Returns:
      whether the default model is attached.

  ### isKeystrokeUpdate

      public boolean isKeystrokeUpdate()

    Returns the value of the keystrokeUpdate property. The keystrokeUpdate property indicates whether an event is sent whenever a character is typed in the TextField.

    Returns:
      value of the keystrokeUpdate property
    See Also:
      `setKeystrokeUpdate(boolean)`

  ### isResizeToDefaultSize

      public boolean isResizeToDefaultSize()

    Returns the value of the resizeToDefaultSize property. This property is not intended for general use.

    Returns:
      value of the resizeToDefaultSize property
    See Also:
      `setResizeToDefaultSize(boolean)`

  ### isResizeToFit

      public boolean isResizeToFit()

    Returns the value of the resizeToFit property. The resizeToFit property determines whether to change the size of the component when either the text or font changes.

    Specified by:
      `isResizeToFit` in interface `ResizeToFitInterface`
    Returns:
      value of the resizeToFit property
    See Also:
      `setResizeToFit(boolean)`

  ### isValid

      public boolean isValid()

    Internal routine that checks if a validator is set. If a validator is set, text is passed to the validator for validation.

    Specified by:
      `isValid` in interface `ValidatorInterface`
    Overrides:
      `isValid` in class `java.awt.Component`
    See Also:
      `setValidator(com.sas.util.validators.ValidationInterface)`, `setErrorHandler(com.sas.util.errorhandlers.ErrorHandlerInterface)`

  ### processActionEvent

      protected void processActionEvent(java.awt.event.ActionEvent e)

    Processes action events occurring on this component.Subclasses should always call super so that events are delivered to any ActionListeners.

    Overrides:
      `processActionEvent` in class `java.awt.TextField`
    Parameters:
      `e` - event to be handled

  ### processFocusEvent

      protected void processFocusEvent(java.awt.event.FocusEvent e)

    Processes focus events occurring on this component.Subclasses should always call super so that events are delivered to any FocusListeners.

    Overrides:
      `processFocusEvent` in class `java.awt.Component`
    Parameters:
      `e` - event to be handled

  ### processKeyEvent

      protected void processKeyEvent(java.awt.event.KeyEvent e)

    Processes key events occurring on this component. Subclasses should always call super so that events are delivered to any KeyListeners. but can still override this behavior by consuming the event.

    Overrides:
      `processKeyEvent` in class `java.awt.Component`
    Parameters:
      `e` - the key event.
    See Also:
      `KeyListener`, `InputEvent.consume()`

  ### processMouseMotionEvent

      protected void processMouseMotionEvent(java.awt.event.MouseEvent e)

    Processes mouse motion events occurring on this component. Subclasses should always call super so that events are delivered to any MouseMotionListeners, but can still override this behavior by consuming the event.

    Overrides:
      `processMouseMotionEvent` in class `java.awt.Component`
    Parameters:
      `e` - the mouseMotion event.
    See Also:
      `MouseMotionListener`, `InputEvent.consume()`

  ### processMouseEvent

      protected void processMouseEvent(java.awt.event.MouseEvent e)

    Processes mouse events occurring on this component. Subclasses should always call super so that events are delivered to any MouseListeners, but can still override this behavior by consuming the event.

    Overrides:
      `processMouseEvent` in class `java.awt.Component`
    Parameters:
      `e` - the mouse event.
    See Also:
      `MouseListener`, `InputEvent.consume()`

  ### propertyChange

      public void propertyChange(java.beans.PropertyChangeEvent event)

    Processes a PropertyChangeEvent sent by the model.

    Specified by:
      `propertyChange` in interface `java.beans.PropertyChangeListener`
    Overrides:
      `propertyChange` in class `TextFieldVisualComponent`
    Parameters:
      `event` - The event from the model indicating what property changed
    See Also:
      `PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)`

  ### refresh

      public void refresh()

    Sets the text for the AWT TextField component from text obtained from the attached model

  ### refresh

      public void refresh(com.sas.ModelInterface Model)

    Sets the text for the AWT TextField component from text obtained from the attached model

    Specified by:
      `refresh` in interface `com.sas.ViewInterface`
    Overrides:
      `refresh` in class `TextFieldVisualComponent`
    Parameters:
      `Model` - attached model
    See Also:
      `ViewInterface.refresh(com.sas.ModelInterface)`

  ### replaceRange

      public void replaceRange(java.lang.String str,
                               int start,
                               int end)

    Replaces text from the indicated start to end position with the new text specified. Any text that is currently selected will be deselected. The start and end positions are zero based and are interchangeable (start position does not have to be greater than end position). If the start position is less than zero and the replacement text is not "", then the replacement text will be prepended to the current string. If the end position is greater than the current text length or less than zero, the end position will be set to the current text length.

    Parameters:
      `str` - replacement text
      `start` - start position
      `end` - end position

  ### select

      public void select(int selectionStart,
                         int selectionEnd)

    Selects the text found between the specified start and end positions. Any text that is currently selected will be deselected. If the start position is greater than the end position, the select will not occur.

    Overrides:
      `select` in class `java.awt.TextComponent`
    Parameters:
      `selectionStart` - start position of the text
      `selectionEnd` - end position of the text

  ### selectAll

      public void selectAll()

    Selects all the text in the TextField

    Overrides:
      `selectAll` in class `java.awt.TextComponent`

  ### setAutoHighlight

      public void setAutoHighlight(boolean value)

    Sets the specified boolean to indicate whether or not all text in the component will be selected when the component receives focus. If set to true, all text will be selected when the component receives focus and deselected when the component loses focus

    Parameters:
      `value` - boolean value
    See Also:
      `isAutoHighlight()`

  ### setBounds

      public void setBounds(int x,
                            int y,
                            int width,
                            int height)

    Reshapes the Component to the specified bounding box.

    Specified by:
      `setBounds` in interface `VisualInterface`
    Overrides:
      `setBounds` in class `TextFieldVisualComponent`
    Parameters:
      `x` - x coordinate
      `y` - y coordinate
      `width` - width of the component
      `height` - height of the component
    See Also:
      `VisualInterface.setBounds(int, int, int, int)`

  ### setBounds

      public void setBounds(java.awt.Rectangle r)

    Reshapes the Component to the specified bounding box.

    Overrides:
      `setBounds` in class `java.awt.Component`
    Parameters:
      `r` - new bounding rectangle for the component

  ### setCaretPosition

      public void setCaretPosition(int position)

    Sets the caret position

    Overrides:
      `setCaretPosition` in class `java.awt.TextComponent`
    Parameters:
      `position` - caret position
    See Also:
      `TextComponent.getCaretPosition()`

  ### setColumns

      public void setColumns(int columns)

    Sets the number of columns for the TextField

    Overrides:
      `setColumns` in class `java.awt.TextField`
    Parameters:
      `columns` - number of columns
    See Also:
      `TextField.getColumns()`

  ### setDataMonitor

      public void setDataMonitor(com.sas.util.datamonitors.DataMonitorInterface dataMonitor)

    Sets the Data Monitor.

    Parameters:
      `dataMonitor` - Data Monitor
    See Also:
      `getDataMonitor()`

  ### setDefaultValues

      public void setDefaultValues()

    Sets the initial values to the default values. This method is called by the Component constructors. The setDefaultValues method of each class is responsible for setting its own initial values.

    Specified by:
      `setDefaultValues` in interface `VisualInterface`
    Specified by:
      `setDefaultValues` in interface `com.sas.ComponentInterface`
    Overrides:
      `setDefaultValues` in class `TextFieldVisualComponent`
    See Also:
      `ComponentInterface.setDefaultValues()`

  ### setEchoChar

      public void setEchoChar(char echoChar)

    Sets the echo character for this TextField. This is useful for fields where the user input shouldn't be echoed to the screen.

    Overrides:
      `setEchoChar` in class `java.awt.TextField`
    Parameters:
      `echoChar` - echo character
    See Also:
      `TextField.getEchoChar()`

  ### setEditable

      public void setEditable(boolean t)

    Sets the specified boolean to indicate whether or not the TextField is editable (accepts keystokes). If set to false, text in the TextField can still be changed by using the setText() method.

    Overrides:
      `setEditable` in class `java.awt.TextComponent`
    Parameters:
      `t` - boolean value
    See Also:
      `TextComponent.isEditable()`

  ### setErrorHandler

      public void setErrorHandler(ErrorHandlerInterface errorHandler)

    Sets the errorHandler for the textArea. Error handlers can display an appropriate error message when text fails validation rules specified by a validator. ErrorHandlers must implement the com.sas.util.errorhandlers.ErrorHandlerInterface.

    Specified by:
      `setErrorHandler` in interface `ValidatorInterface`
    Parameters:
      `errorHandler` - name of an errorHandler
    See Also:
      `setValidator(com.sas.util.validators.ValidationInterface)`

  ### setFont

      public void setFont(java.awt.Font font)

    Sets the font to be used by the component for displaying text.

    Specified by:
      `setFont` in interface `VisualInterface`
    Overrides:
      `setFont` in class `TextFieldVisualComponent`
    Parameters:
      `font` - the font to be used by the component for displaying text.
    See Also:
      `Component.setFont(java.awt.Font)`, `TextFieldVisualComponent.getFont()`

  ### setKeystrokeUpdate

      public void setKeystrokeUpdate(boolean value)

    Sets the specified boolean to indicate whether an event is sent whenever a character is typed in the TextField. Characters typed in the TextField can be used for selecting an entry in a listbox or combobox that begins with the text typed in the TextField. In addition to setting the keystrokeUpdate attribute to true,the keyboardSelectable attribute of the listbox/combobox must be set to true and a link must be established between the selectionPrefix attribute of the listbox/combobox (the source) and the keystrokeUpdate attribute (the target).

    Parameters:
      `value` - boolean value
    See Also:
      `isKeystrokeUpdate()`

  ### setSelectionEnd

      public void setSelectionEnd(int selectionEnd)

    Sets the selection end to the specified position. The specified position is constrained to be at or after the current selection start. If the specified position is greater than the current text length, it will be set to the value of the current text length. Selection end is a zero-based property.

    Overrides:
      `setSelectionEnd` in class `java.awt.TextComponent`
    Parameters:
      `selectionEnd` - end position of the selected text
    See Also:
      `TextComponent.getSelectionEnd()`

  ### setSelectionStart

      public void setSelectionStart(int selectionStart)

    Sets the selection start to the specified position. The specified position is constrained to be before or at the current selection end. Selection start is a zero-based property.If the specified position is less than zero, it will be set to zero.

    Overrides:
      `setSelectionStart` in class `java.awt.TextComponent`
    Parameters:
      `selectionStart` - start position of the selected text
    See Also:
      `TextComponent.getSelectionStart()`

  ### setResizeToDefaultSize

      public void setResizeToDefaultSize(boolean resizeState)

    Sets the value of the resizeToDefaultSize property. This property is not intended for general use. It is used by the textField customizer to indicate whether the textField size should be changed to its default size

    Parameters:
      `resizeState` - boolean value
    See Also:
      `isResizeToDefaultSize()`

  ### setResizeToFit

      public void setResizeToFit(boolean resizeState)

    Sets the value of the resizeToFit property. The resizeToFit property determines whether to change the size of the component when either the text or font changes. If the component is managed by a layout manager that uses preferred sizes, the component will behave as if the resizeToFit property has been set to true regardless of the actual value of the resizeToFit property.

    Specified by:
      `setResizeToFit` in interface `ResizeToFitInterface`
    Parameters:
      `resizeState` - boolean value

  ### setText

      public void setText(java.lang.String text)

    Sets the text of this TextField to the specified text. If you add a listener for property changes on the text property, and you wish to change the text in the handler for the propertyChangeListener, you will need to change the model's text instead of issuing a setText(String).

    Specified by:
      `setText` in interface `com.sas.lang.StringDataInterface`
    Overrides:
      `setText` in class `java.awt.TextField`
    Parameters:
      `text` - text
    See Also:
      `TextComponent.getText()`

  ### setTextOnModel

      protected boolean setTextOnModel(java.lang.String text)

    Internal routine that checks if a validator is set. If a validator is set, text is passed to the validator for validation. If the text passes the validation rules, the model is updated with the text.

    See Also:
      `setValidator(com.sas.util.validators.ValidationInterface)`, `setErrorHandler(com.sas.util.errorhandlers.ErrorHandlerInterface)`

  ### setValidator

      public void setValidator(ValidationInterface validator)

    Sets the validator for the textArea. If the text does not satisfy the criteria in the validator, an appropriate error message can be displayed if an error handler has been set through the setErrorHandler(errorHandler) method. Validators must implement the com.sas.util.validators.ValidationInterface.

    Specified by:
      `setValidator` in interface `ValidatorInterface`
    Parameters:
      `validator` - validator
    See Also:
      `getValidator()`

  All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
  |  | Components |
  PREV CLASS NEXT CLASS | FRAMES NO FRAMES
  SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

  Copyright © 2009 SAS Institute Inc. All Rights Reserved.