borland Packages Class Hierarchy dbswing Package
java.lang.Object +----java.awt.Component +----java.awt.Container +----javax.swing.JComponent +----javax.swing.text.JTextComponent +----javax.swing.JTextArea +----com.borland.dbswing.JdbTextArea
Variables Constructors Properties Methods Event Listeners
Implements ColumnAware, DataSetAware, ImageObserver, MenuContainer, Serializable, Accessible, Scrollable
JdbTextArea
is a data-aware extension of the JTextArea
component.
A JdbTextArea
is usually used to edit multi-line strings of plain text data. When the lineWrap
property is set to true
, text is forced to wrap. When the wrapStyleWord
property is set to true
, wrapping occurs on word boundaries (white space). Both properties are set to true
by default. Set lineWrap
to false
if you don't want long lines to wrap. Set wrapStyleWord
to false
if you want wrapping to occur on character boundaries, rather than word boundaries. Note that lineWrap
must be set to true
for wrapping to occur, regardless of the wrapStyleWord
setting.
JdbTextArea
provides a right-click popup menu for
performing simple editing tasks, such as cutting, copying, or
pasting clipboard data. You can also display the menu by pressing Shift+F10. Some of the menu's behavior can be customized with property settings:
enablePopupMenu
- Sets whether or not the popup menu is displayable.enableClearAll
- Sets whether the Clear All popup menu command appears.enableUndoRedo
- Sets whether the Undo and Redo menu command appear on the popup menu.enableFileLoading
- Sets whether the File Open menu command appears on the popup menu.enableFileSaving
- Sets whether the File Save menu command appears on the popup menu.
To make a JdbTextArea
data-aware, set its dataSet
and columnName
properties. Note that the JdbTextArea
's menu is available whether it is attached to a DataSet
or not.
Data typed into a JdbTextArea
is not saved immediately to
the DataSet
. Rather, certain conditions/events automatically
cause the data to be put into the DataSet
's column. These two properties affect this bevavior:
postOnFocusLost
- If true
, data is saved to the DataSet
whenever the JdbTextArea
loses focus.postOnRowPosted
- If true
, data is saved to the DataSet
whenever the current DataSet
row is posted.
When a JdbTextArea
is attached to a DataSet
, the following
keystrokes perform special tasks when pressed:
JdbTextArea
keystrokes
Keystroke(s) | Action |
---|---|
Ctrl+Enter | Causes the data in the text area to be written to the DataSet Column . In general, changes to the text are not saved to the DataSet Column until some action that posts the text occurs. |
Esc | Makes the data in the field change back to the value in the DataSet Column . Pressing Esc discards any Undo/Redo information that may have accumulated. |
Ctrl+PgUp, Ctrl+PgDn | Moves to the previous and next DataSet row, respectively. If the postOnRowPosted property is true , pressing the Ctrl+PgUp or Ctrl+PgDn key saves all the text in the JdbTextArea to the DataSet . |
Ctrl+Tab, Ctrl+Shift+Tab | Using either of these keystrokes to move to another component saves the current text to the DataSet if the postOnFocusLost property is true . More generally, if the postOnFocusLost property is true , any action that causes the JdbTextArea to lose focus causes the text to be saved in the column. |
DBTextDataBinder
Working with text in the dbswing
package file.
protected DBTextDataBinder dataBinderThe
JdbTextDataBinder
that makes this component data aware.
public JdbTextArea()Constructs a
JdbTextArea
component by calling the constructor of this
class that takes a Document
, a String
, and two int
values as parameters. Passes default values of null
, null
, 0, and 0 to the other constructor.
public JdbTextArea(int rows, int columns)Constructs a
JdbTextArea
component by calling the constructor of this
class that takes a Document
, a String
, and two int
values as parameters. Passes the specified int
values for number of rows and columns, along with default null
values for the Document
and String
, to the other constructor.
Note that the rows and column parameters are not related to the rows and columns of a DataSet
, and are only a request for the specified height and width. The layout determines how big the JdbTextArea
actually is.
rows
columns
public JdbTextArea(String text)Constructs a
JdbTextArea
component by calling the constructor of this
class that takes a Document
, a String
, and two int
values as parameters. Passes the specified text string, along with default values of null
, 0, and 0, to the other constructor.
text
public JdbTextArea(String text, int rows, int columns)Constructs a
JdbTextArea
component by calling the constructor of this
class that takes a Document
, a String
, and two int
values as parameters. Passes the specified text string, specified number of rows and columns, and a default value of null
for the Document
to the other constructor.
Note that the rows and column parameters are not related to the rows and columns of a DataSet
, and are only a request for the specified height and width. The layout determines how big the JdbTextArea
actually is.
text
rows
columns
public JdbTextArea(Document doc)Constructs a
JdbTextArea
component by calling the constructor of this
class that takes a Document
, a String
, and two int
values as parameters. Passes the specified Document
, along with default values of null, 0, and 0, to the other constructor.
doc
public JdbTextArea(Document doc, String text, int rows, int columns)Constructs a
JdbTextArea
component by calling the constructor of its superclass that takes a Document
, the text string to initially display, and the number of rows and columns as parameters. This constructor is called by all of the other JdbTextArea
constructors, and is the only one of them that calls a constructor of its superclass directly.
Note that the rows and column parameters are not related to the rows and columns of a DataSet
, and are only a request for the specified height and width. The layout determines how big the JdbTextArea
actually is.
doc
text
rows
columns
public String getColumnName() public void setColumnName(String columnName)Returns and sets the column name of the
DataSet
from which values are read and to which values are written.
public DataSet getDataSet() public void setDataSet(DataSet dataSet)Returns and sets the
DataSet
from which values are read and to which values are written.
public boolean isEnableClearAll() public void setEnableClearAll(boolean enableClearAll)Returns and sets whether the Clear All popup menu command appears.
enablePopupMenu
public boolean isEnableFileLoading() public void setEnableFileLoading(boolean enableFileLoading)Returns and sets whether the File Open popup menu command appears.
enablePopupMenu
public boolean isEnableFileSaving() public void setEnableFileSaving(boolean enableFileSaving)Returns and sets whether the File Save popup menu command appears.
enablePopupMenu
public boolean isEnablePopupMenu() public void setEnablePopupMenu(boolean popupEnabled)Returns and sets whether a popup menu appears when the user right-clicks the text area or presses Shift+F10.
public boolean isEnableUndoRedo() public void setEnableUndoRedo(boolean enableUndoRedo)Returns and sets whether the Undo and Redo menu commands appear on the popup menu.
enablePopupMenu
public boolean isPostOnFocusLost() public void setPostOnFocusLost(boolean postOnFocusLost)Returns and sets whether the current text is entered in the
DataSet
's Column
when focus is lost on the text area. The default value is true
.
public boolean isPostOnRowPosted() public void setPostOnRowPosted(boolean postOnRowPosted)Returns and sets whether the current text should be put in the
DataSet
's Column
when the current row is posted. This occurs, for example, if the user presses a row navigation key while the text component has current focus. The default value is true
.
protected void commonInit()Used to initialize
JdbTextArea
with the same defaults, regardless of the constructor used.
A newly instantiated JdbTextArea
differs from a JTextArea
in that it has a non-blinking cursor, slightly larger left and right margins, and has the lineWrap
and wrapStyleWord
properties set to true
by default.
public void addAncestorListener(javax.swing.event.AncestorListener ) public void removeAncestorListener(javax.swing.event.AncestorListener )
public void addCaretListener(javax.swing.event.CaretListener ) public void removeCaretListener(javax.swing.event.CaretListener )
public synchronized void addComponentListener(java.awt.event.ComponentListener ) public synchronized void removeComponentListener(java.awt.event.ComponentListener )
public synchronized void addContainerListener(java.awt.event.ContainerListener ) public synchronized void removeContainerListener(java.awt.event.ContainerListener )
public synchronized void addFocusListener(java.awt.event.FocusListener ) public synchronized void removeFocusListener(java.awt.event.FocusListener )
public synchronized void addInputMethodListener(java.awt.event.InputMethodListener ) public synchronized void removeInputMethodListener(java.awt.event.InputMethodListener )
public synchronized void addKeyListener(java.awt.event.KeyListener ) public synchronized void removeKeyListener(java.awt.event.KeyListener )
public synchronized void addMouseListener(java.awt.event.MouseListener ) public synchronized void removeMouseListener(java.awt.event.MouseListener )
public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener ) public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener ) public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )
public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener ) public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )