com.droplets.api
Class TextArea

java.lang.Object
  |
  +--com.droplets.api.Component
        |
        +--com.droplets.api.TextArea

public class TextArea
extends Component

A multi-line text input component. TextAreas automatically sprout scroll bars when necessary. The text is stored in the value property, so use getValue and setValue to get and set it.


Fields inherited from class com.droplets.api.Component
ANCHOR_CENTER, ANCHOR_EAST, ANCHOR_NORTH, ANCHOR_NORTHEAST, ANCHOR_NORTHWEST, ANCHOR_SOUTH, ANCHOR_SOUTHEAST, ANCHOR_SOUTHWEST, ANCHOR_WEST, FILL_BOTH, FILL_HORIZONTAL, FILL_NONE, FILL_VERTICAL
 
Constructor Summary
TextArea(LayoutPlacement p, int cols, int rows, Window window)
          Constructs a new TextArea.
 
Method Summary
 int getHeight()
          Gets the minimum number of rows that should be displayed.
 int getWidth()
          Gets the minimum number of columns that should be displayed.
 void select(int selectionStart, int selectionEnd)
          This method sets the start and end positions of the selected text, enforcing the restriction that the start position must be greater than or equal to zero.
 void selectAll()
          Selects all the text in this text component
 void setHeight(int value)
          Sets the minimum number of rows that should be displayed.
 void setHeight(int value, java.lang.String skin)
          Sets the minimum number of rows that should be displayed.
 void setWidth(int value)
          Sets the minimum number of columns that should be displayed.
 void setWidth(int value, java.lang.String skin)
          Sets the minimum number of columns that should be displayed.
 
Methods inherited from class com.droplets.api.Component
action, addActionListener, addAttributeChangeListener, addValueChangeListener, attributeChanged, constructionFailed, equals, fireActionEvent, fireAttributeChangeEvent, fireValueChangeEvent, getAnchor, getAttribute, getBgColor, getBoolAttribute, getBordersAttribute, getColorAttribute, getCursor, getCursorType, getDoubleAttribute, getEnabled, getFgColor, getFill, getFont, getGridHeight, getGridWidth, getGridX, getGridY, getInsets, getIntAttribute, getIPadX, getIPadY, getOpaque, getParent, getScriptingName, getSpecification, getStringAttribute, getToolTip, getValue, getVisible, getWeightX, getWeightY, getWindow, invalidate, isAddedToWindow, isContainer, isFocusTraversable, isFocusTraversableDefault, isValid, removeActionListener, removeAttributeChangeListener, removeValueChangeListener, requestFocus, reset, sendCommandAttribute, setAnchor, setAnchor, setArg, setAttribute, setBgColor, setBgColor, setBoolAttribute, setBordersAttribute, setColorAttribute, setCursor, setCursor, setCursorType, setDoubleAttribute, setEnabled, setEnabled, setEnterButton, setEnterButton, setEnterButton, setFgColor, setFgColor, setFill, setFill, setFocusTraversable, setFont, setFont, setGridHeight, setGridHeight, setGridWidth, setGridWidth, setGridX, setGridX, setGridY, setGridY, setInsets, setInsets, setIntAttribute, setIPadX, setIPadX, setIPadY, setIPadY, setItemListAttribute, setOpaque, setOpaque, setScriptingName, setStringAttribute, setToolTip, setValue, setValue, setVisible, setVisible, setWeightX, setWeightX, setWeightY, setWeightY, storeAttribute, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextArea

public TextArea(LayoutPlacement p,
                int cols,
                int rows,
                Window window)
Constructs a new TextArea.
Parameters:
p - specifies how this component should be laid out in the enclosing panel (see LayoutPlacement)
cols - the preferred number of text columns in the TextArea
rows - the preferred number of text rows
window - the window in which this component will be placed
Method Detail

getHeight

public int getHeight()
Gets the minimum number of rows that should be displayed.
Returns:
the number of rows

setHeight

public void setHeight(int value,
                      java.lang.String skin)
Sets the minimum number of rows that should be displayed.
Parameters:
value - the number of rows
skin - the skin name to use for this attribute

setHeight

public void setHeight(int value)
Sets the minimum number of rows that should be displayed.
Parameters:
value - the number of rows

getWidth

public int getWidth()
Gets the minimum number of columns that should be displayed.
Returns:
the number of columns

setWidth

public void setWidth(int value,
                     java.lang.String skin)
Sets the minimum number of columns that should be displayed.
Parameters:
value - the number of columns
skin - the skin name to use for this attribute

setWidth

public void setWidth(int value)
Sets the minimum number of columns that should be displayed.
Parameters:
value - the number of columns

selectAll

public void selectAll()
Selects all the text in this text component

select

public void select(int selectionStart,
                   int selectionEnd)
This method sets the start and end positions of the selected text, enforcing the restriction that the start position must be greater than or equal to zero. The end position must be greater than or equal to the start position, and less than or equal to the length of the text component's text. The character positions are indexed starting with zero. The length of the selection is endPosition-startPosition, so the character at endPosition is not selected. If the start and end positions of the selected text are equal, all text is deselected. If the caller supplies values that are inconsistent or out of bounds, the method enforces these constraints silently, and without failure. Specifically, if the start position or end position is greater than the length of the text, it is reset to equal the text length. If the start position is less than zero, it is reset to zero, and if the end position is less than the start position, it is reset to the start position.
Parameters:
selectionStart - the zero-based index of the first character to be selected.
selectionEnd - the zero-based end position of the text to be selected. The character at selectionEnd is not selected.


Copyright © Droplets, 2001. All Rights Reserved.