|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.awt.TextField
public class TextField
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:
TextField textField1 = new TextField();
textField1.initialize();
TextField textField1 = new TextField("text");
textField1.initialize();
TextField textField1 = new TextField("text", columns);
textField1.initialize();
TextField textField1 = new TextField(columns);
textField1.initialize();
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. |
Field Detail |
---|
protected ValidationInterface validator
protected ErrorHandlerInterface errorHandler
protected boolean isValid
protected transient java.lang.Object setTextOnModelLock
protected transient boolean inSetTextOnModel
protected com.sas.util.datamonitors.DataMonitorInterface dataMonitor
public static final java.lang.String RB_KEY
Constructor Detail |
---|
public TextField()
public TextField(java.lang.String text)
text
- textpublic TextField(java.lang.String text, int columns)
text
- textcolumns
- number of columnspublic TextField(int columns)
columns
- number of columnsMethod Detail |
---|
public static int getDefaultWidth()
setDefaultWidth(int)
public static void setDefaultWidth(int newDefaultWidth)
newDefaultWidth
- the new default width in pixelsgetDefaultWidth()
public static int getDefaultHeight()
setDefaultHeight(int)
public static void setDefaultHeight(int newDefaultHeight)
newDefaultHeight
- the new default height in pixelsgetDefaultHeight()
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
public void append(java.lang.String str)
str
- text to appendpublic void addNotify()
addNotify
in class java.awt.TextField
public void attachModel(com.sas.ModelInterface model)
attachModel
in interface com.sas.ViewInterface
attachModel
in class TextFieldVisualComponent
model
- model to attachViewInterface.attachModel(com.sas.ModelInterface)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface com.sas.PublicClonable
clone
in class TextFieldVisualComponent
java.lang.CloneNotSupportedException
- if the model attached to the component being cloned
will not allow the clone to attach.public java.awt.Dimension computePreferredSize()
computePreferredSize
in interface VisualInterface
computePreferredSize
in class TextFieldVisualComponent
VisualInterface.computePreferredSize()
public void delete(int start, int end)
start
- start positionend
- end positionpublic void deselectAll()
public void detachModel(com.sas.ModelInterface model)
detachModel
in interface com.sas.ViewInterface
detachModel
in class TextFieldVisualComponent
model
- Model to detachViewInterface.detachModel(com.sas.ModelInterface)
public com.sas.util.datamonitors.DataMonitorInterface getDataMonitor()
setDataMonitor(com.sas.util.datamonitors.DataMonitorInterface)
public ErrorHandlerInterface getErrorHandler()
getErrorHandler
in interface ValidatorInterface
setErrorHandler(com.sas.util.errorhandlers.ErrorHandlerInterface)
public java.util.Vector getRequiredInterfaces()
getRequiredInterfaces
in interface com.sas.ViewInterface
getRequiredInterfaces
in class TextFieldVisualComponent
ViewInterface.getRequiredInterfaces()
public ValidationInterface getValidator()
getValidator
in interface ValidatorInterface
setValidator(com.sas.util.validators.ValidationInterface)
protected void handleError()
public void insert(java.lang.String str, int pos)
str
- text to insertpos
- position at which to insertpublic boolean isAutoHighlight()
setAutoHighlight(boolean)
public boolean isDefaultModelAttached()
isDefaultModelAttached
in interface com.sas.ViewDefaultModelInterface
public boolean isKeystrokeUpdate()
setKeystrokeUpdate(boolean)
public boolean isResizeToDefaultSize()
setResizeToDefaultSize(boolean)
public boolean isResizeToFit()
isResizeToFit
in interface ResizeToFitInterface
setResizeToFit(boolean)
public boolean isValid()
isValid
in interface ValidatorInterface
isValid
in class java.awt.Component
protected void processActionEvent(java.awt.event.ActionEvent e)
processActionEvent
in class java.awt.TextField
e
- event to be handledprotected void processFocusEvent(java.awt.event.FocusEvent e)
processFocusEvent
in class java.awt.Component
e
- event to be handledprotected void processKeyEvent(java.awt.event.KeyEvent e)
processKeyEvent
in class java.awt.Component
e
- the key event.KeyListener
,
InputEvent.consume()
protected void processMouseMotionEvent(java.awt.event.MouseEvent e)
processMouseMotionEvent
in class java.awt.Component
e
- the mouseMotion event.MouseMotionListener
,
InputEvent.consume()
protected void processMouseEvent(java.awt.event.MouseEvent e)
processMouseEvent
in class java.awt.Component
e
- the mouse event.MouseListener
,
InputEvent.consume()
public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
propertyChange
in class TextFieldVisualComponent
event
- The event from the model indicating what property changedPropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
public void refresh()
public void refresh(com.sas.ModelInterface Model)
refresh
in interface com.sas.ViewInterface
refresh
in class TextFieldVisualComponent
Model
- attached modelViewInterface.refresh(com.sas.ModelInterface)
public void replaceRange(java.lang.String str, int start, int end)
str
- replacement textstart
- start positionend
- end positionpublic void select(int selectionStart, int selectionEnd)
select
in class java.awt.TextComponent
selectionStart
- start position of the textselectionEnd
- end position of the textpublic void selectAll()
selectAll
in class java.awt.TextComponent
public void setAutoHighlight(boolean value)
value
- boolean valueisAutoHighlight()
public void setBounds(int x, int y, int width, int height)
setBounds
in interface VisualInterface
setBounds
in class TextFieldVisualComponent
x
- x coordinatey
- y coordinatewidth
- width of the componentheight
- height of the componentVisualInterface.setBounds(int, int, int, int)
public void setBounds(java.awt.Rectangle r)
setBounds
in class java.awt.Component
r
- new bounding rectangle for the componentpublic void setCaretPosition(int position)
setCaretPosition
in class java.awt.TextComponent
position
- caret positionTextComponent.getCaretPosition()
public void setColumns(int columns)
setColumns
in class java.awt.TextField
columns
- number of columnsTextField.getColumns()
public void setDataMonitor(com.sas.util.datamonitors.DataMonitorInterface dataMonitor)
dataMonitor
- Data MonitorgetDataMonitor()
public void setDefaultValues()
setDefaultValues
in interface VisualInterface
setDefaultValues
in interface com.sas.ComponentInterface
setDefaultValues
in class TextFieldVisualComponent
ComponentInterface.setDefaultValues()
public void setEchoChar(char echoChar)
setEchoChar
in class java.awt.TextField
echoChar
- echo characterTextField.getEchoChar()
public void setEditable(boolean t)
setEditable
in class java.awt.TextComponent
t
- boolean valueTextComponent.isEditable()
public void setErrorHandler(ErrorHandlerInterface errorHandler)
setErrorHandler
in interface ValidatorInterface
errorHandler
- name of an errorHandlersetValidator(com.sas.util.validators.ValidationInterface)
public void setFont(java.awt.Font font)
setFont
in interface VisualInterface
setFont
in class TextFieldVisualComponent
font
- the font to be used by the component for displaying text.Component.setFont(java.awt.Font)
,
TextFieldVisualComponent.getFont()
public void setKeystrokeUpdate(boolean value)
value
- boolean valueisKeystrokeUpdate()
public void setSelectionEnd(int selectionEnd)
setSelectionEnd
in class java.awt.TextComponent
selectionEnd
- end position of the selected textTextComponent.getSelectionEnd()
public void setSelectionStart(int selectionStart)
setSelectionStart
in class java.awt.TextComponent
selectionStart
- start position of the selected textTextComponent.getSelectionStart()
public void setResizeToDefaultSize(boolean resizeState)
resizeState
- boolean valueisResizeToDefaultSize()
public void setResizeToFit(boolean resizeState)
setResizeToFit
in interface ResizeToFitInterface
resizeState
- boolean valuepublic void setText(java.lang.String text)
setText
in interface com.sas.lang.StringDataInterface
setText
in class java.awt.TextField
text
- textTextComponent.getText()
protected boolean setTextOnModel(java.lang.String text)
public void setValidator(ValidationInterface validator)
setValidator
in interface ValidatorInterface
validator
- validatorgetValidator()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |