|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.awt.TextArea
public class TextArea
TextArea is a component for creating a multi-line area that can set and display text.
It can be set to not accept
keystrokes through the setEditable method. The TextArea can be created with a
specified number of rows and columns. Vertical and horizontal scrollbars will be
attached unless specified differently during construction of
the TextArea.
Creation:
TextArea textArea1 = new TextArea();
textArea1.initialize();
TextArea textArea1 = new TextArea("text");
textArea1.initialize();
TextArea textArea1 = new TextArea("text", rows, columns);
textArea1.initialize();
Field Summary | |
---|---|
protected int |
caretRowBeforeDoubleClick
|
protected int |
currentCaretRow
|
protected java.lang.String |
currentCaretRowText
|
protected int |
currentRowCount
|
protected com.sas.lang.StringData |
defaultModel
|
protected com.sas.util.transforms.TransformInterface |
displayTransform
|
protected com.sas.util.transforms.TransformInterface |
inputTransform
|
protected com.sas.util.transforms.TransformInterface |
outputTransform
|
static java.lang.String |
RB_KEY
|
Constructor Summary | |
---|---|
TextArea()
Default constructor |
|
TextArea(int rows,
int columns)
Create a TextArea with the specified rows and columns |
|
TextArea(java.lang.String text)
Create a TextArea with the specified text |
|
TextArea(java.lang.String text,
int rows,
int columns)
Create a TextArea with the specified text, rows and columns |
|
TextArea(java.lang.String text,
int rows,
int columns,
int scrollbars)
Create a TextArea with the specified text, rows, columns and scrollbar visibility |
Method Summary | |
---|---|
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 |
void |
contentsChanged(com.sas.collection.ContentsChangedEvent evt)
Called when the contents of the Model have changed. |
protected int |
countRows()
Returns the number of rows in the textArea |
void |
delete(int start,
int end)
Deletes text from the indicated start to end position. |
void |
deselectAll()
Deselects the selected text in the TextArea. |
void |
detachModel(com.sas.ModelInterface model)
Detaches the current model and attaches the default model if the model is set to null |
int |
getCaretRow()
Returns the row the caret is currently on |
static int |
getDefaultHeight()
Returns the default height for instances of this class |
static int |
getDefaultWidth()
Returns the default width for instances of this class |
com.sas.util.transforms.TransformInterface |
getDisplayTransform()
Returns the display transform. |
ErrorHandlerInterface |
getErrorHandler()
Returns the name of the errorHandler or null if none if set |
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
Returns the ExtendedBeanInfo for this class. |
com.sas.util.transforms.TransformInterface |
getInputTransform()
Returns the input transform. |
com.sas.util.transforms.TransformInterface |
getOutputTransform()
Returns the output transform. |
java.util.Vector |
getRequiredInterfaces()
Returns the required interfaces Vector for this component. |
java.lang.String |
getRowText(int row)
Returns the text in a row |
ValidationInterface |
getValidator()
Returns the name of the validator or null if none if 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 |
isSelectRowText()
Returns the value of the selectRowText property. |
boolean |
isValid()
Internal routine that checks if a validator is set. |
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 from text obtained from the attached model. |
void |
refresh(com.sas.ModelInterface Model)
Sets the text 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 TextArea |
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 |
setCaretPosition(int position)
Sets the caret position |
void |
setColumns(int columns)
Sets the number of columns for the TextArea |
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 |
setDisplayTransform(com.sas.util.transforms.TransformInterface displayTransform)
Sets the display transform. |
void |
setEditable(boolean t)
Sets the specified boolean to indicate whether or not the TextArea is editable (accepts keystokes). |
void |
setErrorHandler(ErrorHandlerInterface errorHandler)
Sets the errorHandler for the textArea. |
void |
setInputTransform(com.sas.util.transforms.TransformInterface inputTransform)
Sets the input Transform. |
void |
setKeystrokeUpdate(boolean value)
Sets the specified boolean to indicate whether an event is sent whenever a character is typed in the TextArea. |
void |
setOutputTransform(com.sas.util.transforms.TransformInterface outputTransform)
Sets the output Transform. |
void |
setRows(int rows)
Sets the number of rows for the TextArea. |
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 |
setSelectRowText(boolean value)
Sets the value of the selectRowText property. |
void |
setText(java.lang.String text)
Sets the text of this TextArea 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. |
protected com.sas.collection.OrderedCollection |
transformStrings(java.lang.String text)
Parses a string into an ordered collection of objects |
void |
updateCaretPosition()
Updates the caret position |
protected void |
updateOrderedCollectionModel(java.lang.String text)
Updates the ordered collection model |
Field Detail |
---|
protected com.sas.util.transforms.TransformInterface displayTransform
protected com.sas.util.transforms.TransformInterface inputTransform
protected com.sas.util.transforms.TransformInterface outputTransform
protected transient int currentCaretRow
protected transient java.lang.String currentCaretRowText
protected transient int currentRowCount
protected transient int caretRowBeforeDoubleClick
protected com.sas.lang.StringData defaultModel
public static final java.lang.String RB_KEY
Constructor Detail |
---|
public TextArea()
public TextArea(java.lang.String text)
text
- textpublic TextArea(int rows, int columns)
rows
- number of rowscolumns
- number of columnspublic TextArea(java.lang.String text, int rows, int columns)
text
- textrows
- number of rowscolumns
- number of columnspublic TextArea(java.lang.String text, int rows, int columns, int scrollbars)
text
- textrows
- number of rowscolumns
- number of columnsscrollbars
- an integer that specifies the scrollbars for the textArea
(TextArea.SCROLLBARS_BOTH, TextArea.HORIZONTAL_ONLY,
(TextArea.NONE, TextArea.VERTICAL_ONLY)Method 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)
append
in class java.awt.TextArea
str
- text to appendpublic void attachModel(com.sas.ModelInterface model)
attachModel
in interface com.sas.ViewInterface
attachModel
in class TextAreaVisualComponent
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 TextAreaVisualComponent
java.lang.CloneNotSupportedException
- if the model attached to the component being cloned
will not allow the clone to attach.public void contentsChanged(com.sas.collection.ContentsChangedEvent evt)
contentsChanged
in interface com.sas.collection.ContentsChangedListener
evt
- ContentsChangedEvent from the Modelprotected int countRows()
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 TextAreaVisualComponent
model
- Model to detachViewInterface.detachModel(com.sas.ModelInterface)
public int getCaretRow()
public com.sas.util.transforms.TransformInterface getDisplayTransform()
setDisplayTransform(com.sas.util.transforms.TransformInterface)
public ErrorHandlerInterface getErrorHandler()
getErrorHandler
in interface ValidatorInterface
setErrorHandler(com.sas.util.errorhandlers.ErrorHandlerInterface)
public com.sas.util.transforms.TransformInterface getInputTransform()
setInputTransform(com.sas.util.transforms.TransformInterface)
public com.sas.util.transforms.TransformInterface getOutputTransform()
setOutputTransform(com.sas.util.transforms.TransformInterface)
public java.util.Vector getRequiredInterfaces()
getRequiredInterfaces
in interface com.sas.ViewInterface
getRequiredInterfaces
in class TextAreaVisualComponent
ViewInterface.getRequiredInterfaces()
public java.lang.String getRowText(int row)
row
- row to obtain text from
public ValidationInterface getValidator()
getValidator
in interface ValidatorInterface
setValidator(com.sas.util.validators.ValidationInterface)
protected void handleError()
setValidator(com.sas.util.validators.ValidationInterface)
,
setErrorHandler(com.sas.util.errorhandlers.ErrorHandlerInterface)
public boolean isSelectRowText()
setSelectRowText(boolean)
public boolean isValid()
isValid
in interface ValidatorInterface
isValid
in class java.awt.Component
setValidator(com.sas.util.validators.ValidationInterface)
,
setErrorHandler(com.sas.util.errorhandlers.ErrorHandlerInterface)
public void insert(java.lang.String str, int pos)
insert
in class java.awt.TextArea
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)
protected 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 processMouseEvent(java.awt.event.MouseEvent e)
processMouseEvent
in class java.awt.Component
e
- the mouse event.MouseListener
,
InputEvent.consume()
protected void processMouseMotionEvent(java.awt.event.MouseEvent e)
processMouseMotionEvent
in class java.awt.Component
e
- the mouseMotion event.MouseMotionListener
,
InputEvent.consume()
public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
propertyChange
in class TextAreaVisualComponent
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 TextAreaVisualComponent
Model
- attached modelViewInterface.refresh(com.sas.ModelInterface)
public void replaceRange(java.lang.String str, int start, int end)
replaceRange
in class java.awt.TextArea
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 setCaretPosition(int position)
setCaretPosition
in class java.awt.TextComponent
position
- caret positionTextComponent.getCaretPosition()
public void setColumns(int columns)
setColumns
in class java.awt.TextArea
columns
- number of columnsTextArea.getColumns()
public void setDefaultValues()
setDefaultValues
in interface VisualInterface
setDefaultValues
in interface com.sas.ComponentInterface
setDefaultValues
in class TextAreaVisualComponent
ComponentInterface.setDefaultValues()
public void setDisplayTransform(com.sas.util.transforms.TransformInterface displayTransform)
transform
- the new value for the displayTransform propertygetDisplayTransform()
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 setKeystrokeUpdate(boolean value)
value
- boolean valueisKeystrokeUpdate()
public void setInputTransform(com.sas.util.transforms.TransformInterface inputTransform)
the
- new value for the inputTransform propertygetInputTransform()
public void setOutputTransform(com.sas.util.transforms.TransformInterface outputTransform)
transform
- the new value for the outputTransform propertygetOutputTransform()
public void setRows(int rows)
setRows
in class java.awt.TextArea
rows
- number of rowsTextArea.getRows()
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 setSelectRowText(boolean value)
value
- boolean valueisSelectRowText()
public void setText(java.lang.String text)
setText
in interface com.sas.lang.StringDataInterface
setText
in class java.awt.TextComponent
text
- textTextComponent.getText()
protected boolean setTextOnModel(java.lang.String text)
setValidator(com.sas.util.validators.ValidationInterface)
,
setErrorHandler(com.sas.util.errorhandlers.ErrorHandlerInterface)
public void setValidator(ValidationInterface validator)
setValidator
in interface ValidatorInterface
validator
- name of a validatorgetValidator()
protected com.sas.collection.OrderedCollection transformStrings(java.lang.String text)
text
- string to be parsed
public void updateCaretPosition()
protected void updateOrderedCollectionModel(java.lang.String text)
text
- text to be added or text that will replace a current item
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |