|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbuoy.event.EventSource
buoy.widget.Widget
buoy.widget.TextWidget
buoy.widget.BTextArea
public class BTextArea
A BTextArea is a multi-line text entry box. You can specify a preferred size for the text area in terms of rows and columns, but it automatically expands to be large enough to show all text contained in it. Usually, a BTextArea is used inside a BScrollPane. The settings for numbers of rows and columns are then treated as the preferred size of the visible area, and the scroll bars can be used to scroll through the text.
In addition to the event types generated by all Widgets, BTextAreas generate the following event types:
Nested Class Summary | |
---|---|
static class |
BTextArea.WrapStyle
This inner class represents a wrapping style. |
Field Summary | |
---|---|
static BTextArea.WrapStyle |
WRAP_CHARACTER
|
static BTextArea.WrapStyle |
WRAP_NONE
|
static BTextArea.WrapStyle |
WRAP_WORD
|
Constructor Summary | |
---|---|
BTextArea()
Create an empty BTextArea whose preferred numbers of rows and columns are 0. |
|
BTextArea(int rows,
int columns)
Create an empty BTextArea. |
|
BTextArea(java.lang.String text)
Create a new BTextArea whose preferred numbers of rows and columns are 0. |
|
BTextArea(java.lang.String text,
int rows,
int columns)
Create a new BTextArea. |
Method Summary | |
---|---|
void |
append(java.lang.String text)
Append a String to the text contained in this Widget. |
int |
getColumns()
Get the number of columns this text area should be wide enough to display. |
javax.swing.JTextArea |
getComponent()
Get the java.awt.Component corresponding to this Widget. |
int |
getLineCount()
Determine the number of lines of text contained in this text area. |
java.awt.Dimension |
getMinimumSize()
Get the smallest size at which this Widget can reasonably be drawn. |
int |
getRows()
Get the number of rows this text area should be tall enough to display. |
int |
getTabSize()
Get the number of character widths to use for a tab character. |
BTextArea.WrapStyle |
getWrapStyle()
Get the line wrap style for this text area. |
void |
insert(java.lang.String text,
int pos)
Insert a String into the middle of the text contained in this Widget. |
void |
replaceRange(java.lang.String text,
int start,
int end)
Replace a part of the text contained in this Widget with a new String. |
void |
setColumns(int columns)
Set the number of columns this text area should be wide enough to display. |
void |
setRows(int rows)
Set the number of rows this text area should be tall enough to display. |
void |
setTabSize(int size)
Set the number of character widths to use for a tab character. |
void |
setWrapStyle(BTextArea.WrapStyle style)
Set the line wrap style for this text area. |
Methods inherited from class buoy.widget.TextWidget |
---|
getCaretPosition, getLength, getSelectedText, getSelectionEnd, getSelectionStart, getText, isEditable, setCaretPosition, setEditable, setSelectionEnd, setSelectionStart, setText |
Methods inherited from class buoy.widget.Widget |
---|
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMaximumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible |
Methods inherited from class buoy.event.EventSource |
---|
addEventLink, addEventLink, removeEventLink |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final BTextArea.WrapStyle WRAP_NONE
public static final BTextArea.WrapStyle WRAP_CHARACTER
public static final BTextArea.WrapStyle WRAP_WORD
Constructor Detail |
---|
public BTextArea()
public BTextArea(java.lang.String text)
text
- the initial text contained in the text area (may be null)public BTextArea(int rows, int columns)
rows
- the number of rows this text area should be tall enough to displaycolumns
- the number of columns this text area should be wide enough to displaypublic BTextArea(java.lang.String text, int rows, int columns)
text
- the initial text contained in the text area (may be null)rows
- the number of rows this text area should be tall enough to displaycolumns
- the number of columns this text area should be wide enough to displayMethod Detail |
---|
public javax.swing.JTextArea getComponent()
Widget
getComponent
in class TextWidget
public int getRows()
public void setRows(int rows)
public int getColumns()
public void setColumns(int columns)
public int getLineCount()
public BTextArea.WrapStyle getWrapStyle()
public void setWrapStyle(BTextArea.WrapStyle style)
public int getTabSize()
public void setTabSize(int size)
public void append(java.lang.String text)
This method can be safely called from any thread, not just the event dispatch thread.
text
- the text to appendpublic void insert(java.lang.String text, int pos)
This method can be safely called from any thread, not just the event dispatch thread.
text
- the text to insertpos
- the position at which to insert itpublic void replaceRange(java.lang.String text, int start, int end)
This method can be safely called from any thread, not just the event dispatch thread.
text
- the new text with which to replace the specified rangestart
- the beginning of the range to replaceend
- the end of the range to replacepublic java.awt.Dimension getMinimumSize()
getMinimumSize
in class Widget
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |