borland Packages Class Hierarchy dbswing Package
java.lang.Object +----java.awt.Component +----java.awt.Container +----javax.swing.JComponent +----javax.swing.text.JTextComponent +----javax.swing.JEditorPane +----javax.swing.JTextPane +----com.borland.dbswing.JdbTextPane
Variables Constructors Properties Methods Event Listeners
Implements ColumnAware, DataSetAware, ImageObserver, MenuContainer, Serializable, Accessible, Scrollable
JdbTextPane
is a data-aware extension of the JTextPane
component. A JdbTextPane
attached to a DataSet
Column
of type
Object
(or one not attached to a DataSet
at all) allows its
text data to include multiple font and color styles.
JdbTextPane
provides a right-click popup menu for
performing simple editing tasks, such as cutting, copying, or
pasting clipboard data. The popup menu also appears when the user presses Shift+F10 while the cursor is in the JdbTextPane
. Some of the menu's behavior can be
customized using these 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 commands 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.enableColorChange
- Sets whether the foreground and background color setting menu commands appear on the popup menu.enableFontChange
- Sets whether the font style setting menu commands appear on the popup menu.
To make a JdbTextPane
data-aware, set its dataSet
and columnName
properties. Note that the JdbTextPane
's popup menu is available whether it is attached to a DataSet
or not.
Data typed into a JdbTextPane
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 behavior:
postOnFocusLost
- If true
, data is saved to the DataSet
whenever the JdbTextPane
loses focus.postOnRowPosted
- If true
, data is saved to the DataSet
whenever the current DataSet
row is posted.
When a JdbTextPane
is attached to a DataSet
, the following
keystrokes perform special tasks when pressed:
JdbTextPane
keystrokes
Keystroke(s) | Action |
---|---|
Ctrl+Enter | Causes the data in the text pane to be written to the DataSet Column . In general, changes to the pane's 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 Ctrl+PgUp or Ctrl+PgDn saves all the text in the JdbTextPane 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 JdbTextPane 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 JdbTextPane
data aware.
public JdbTextPane()Constructs a
JdbTextPane
component by calling the null
constructor of its superclass.
public JdbTextPane(StyledDocument doc)Constructs a
JdbTextPane
component by calling the constructor of its superclass which takes a StyledDocument
as a parameter.
doc
StyledDocument
that displays in the JdbTextPane
.
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 isEnableColorChange() public void setEnableColorChange(boolean enableColorChange)Returns and sets whether the foreground and background color setting menu commands appear on the popup menu. The default value is
true
.
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 isEnableFontChange() public void setEnableFontChange(boolean enableFontChange)Returns and sets whether the font setting menu command appears on the popup menu. The default value is
true
.
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
JdbTextPane
with the same defaults, regardless of the constructor used. A newly instantiated JdbTextPane
differs from a JTextPane
in that it has a non-blinking cursor.
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 addHyperlinkListener(javax.swing.event.HyperlinkListener ) public synchronized void removeHyperlinkListener(javax.swing.event.HyperlinkListener )
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 )