borland Packages  Class Hierarchy  dbswing Package 

JdbEditorPane component

java.lang.Object
   +----java.awt.Component
           +----java.awt.Container
                   +----javax.swing.JComponent
                           +----javax.swing.text.JTextComponent
                                   +----javax.swing.JEditorPane
                                           +----com.borland.dbswing.JdbEditorPane

About the JdbEditorPane component

Variables  Constructors  Properties  Methods  Event Listeners

Implements ColumnAware, DataSetAware, ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

Note: This is a feature of JBuilder Professional and Enterprise.

JdbEditorPane is a data-aware extension of the JEditorPane component. A JdbEditorPane is used to display or edit pages of RTF or HTML formatted data. A JdbEditorPane must be attached to a DataSet Column of type Variant.OBJECT (or not attached to a DataSet at all) to allow editing and the display of RTF or HTML formatted data. To facilitate the use of JdbEditorPane as an HTML page viewer, JdbEditorPane has its editable property set to false by default. In addition to the file loading and saving menu commands on its popup menu, a JdbEditorPane can also load its content directly from an HTML page with the Open URL menu command on the popup menu or by using the pageURL property.

JdbEditorPane 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 JdbEditorPane. Some of the menu's behavior can be customized using these property settings:

To make a JdbEditorPane data-aware, set its dataSet and columnName properties. Note that the JdbEditorPane's menu is available whether it is attached to a DataSet or not. When you view HTML while JdbEditorPane is attached to a DataSet, the enableURLAutoCache property controls whether clicking on a link to a HTML page automatically caches the page's URL in the DataSet. enableURLAutoCache's default value is true.

Data typed into a JdbEditorPane 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:

When a JdbEditorPane is attached to a DataSet, the following keystrokes perform special tasks when pressed:

JdbEditorPane keystrokes

Keystroke(s) Action
Ctrl+Enter Causes the data in the editor pane to be written to the DataSet Column. In general, changes to the editor 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 JdbEditorPane 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 JdbEditorField to lose focus causes the text to be saved in the Column.

See also: DBTextDataBinder
Working with text in the dbswing package file.


JdbEditorPane variables

Variables implemented in this class

Variables implemented in java.awt.Component

Variables implemented in javax.swing.JComponent

Variables implemented in javax.swing.text.JTextComponent

JdbEditorPane constructors

JdbEditorPane properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.awt.Component

Properties implemented in java.awt.Container

Properties implemented in java.lang.Object

Properties implemented in javax.swing.JComponent

Properties implemented in javax.swing.JEditorPane

Properties implemented in javax.swing.text.JTextComponent

JdbEditorPane methods

Methods implemented in this class

Methods implemented in java.awt.Component

Methods implemented in java.awt.Container

Methods implemented in java.lang.Object

Methods implemented in javax.swing.JComponent

Methods implemented in javax.swing.JEditorPane

Methods implemented in javax.swing.text.JTextComponent

JdbEditorPane event listeners


JdbEditorPane variables

dataBinder

  protected DBTextDataBinder dataBinder
The JdbTextDataBinder that makes this component data-aware.

JdbEditorPane constructors

JdbEditorPane()

  public JdbEditorPane()
Constructs a JdbEditorPane, calling the constructor of its superclass, and sets the editable property to false so that its contents cannot be edited.

JdbEditorPane(java.lang.String)

  public JdbEditorPane(String url)
Constructs a JdbEditorPane, by calling the constructor of its superclass which takes a string containing an URL specification, and sets the editable property to false so that its contents cannot be edited.

Parameters:

url
The URL for the page you want displayed in the JdbEditorPane.

JdbEditorPane(java.lang.String, java.lang.String)

  public JdbEditorPane(String type, String text)
Constructs a JdbEditorPane by calling the constructor of its superclass that takes two Strings as parameters. It displays the specified text string and sets the editable property to false so that its contents cannot be edited.

Parameters:

type
A string indicating the MIME content type of the specified text parameter. The content type (e.g. "text/plain") determines which EditorKit is used by JdbEditorPane to process data.
text
The text to be displayed initially.

JdbEditorPane(java.net.URL)

  public JdbEditorPane(URL initialPage)
Constructs a JdbEditorPane by calling the constructor of its superclass that takes an URL as a parameter. It displays the contents of the specified URL and sets the editable property to false so that its contents cannot be edited.

Parameters:

initialPage
The initial page that JdbEditorPane displays.

JdbEditorPane properties

columnName

 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. Must be of type Object to save RTF or HTML data.

See also: dataSet

columnNameURL

 public String getColumnNameURL()
 public void setColumnNameURL(String columnName)
Returns the column name of the DataSet from which URLs are read and and sets the column name of the DataSet to which URLs are written. Must be a column of type String.

See also: dataSet

dataSet

 public DataSet getDataSet()
 public void setDataSet(DataSet dataSet)
Returns the DataSet from which values are read and to which values are written.

See also: columName

enableClearAll

 public boolean isEnableClearAll()
 public void setEnableClearAll(boolean enableClearAll)
Returns and sets whether the Clear All popup menu command appears.

See also: enablePopupMenu

enableColorChange

 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 document being edited must be of type RTF or HTML for this option to display.

The default value is true.

See also: enablePopupMenu

enableFileLoading

 public boolean isEnableFileLoading()
 public void setEnableFileLoading(boolean enableFileLoading)
Returns and sets whether the Open File popup menu command appears.

See also: enablePopupMenu

enableFileSaving

 public boolean isEnableFileSaving()
 public void setEnableFileSaving(boolean enableFileSaving)
Returns and sets whether the File Save popup menu command appears.

See also: enablePopupMenu

enableFontChange

 public boolean isEnableFontChange()
 public void setEnableFontChange(boolean enableFontChange)
Returns and sets whether the font setting menu command appears on the popup menu.

The document being edited must be of type RTF or HTML for this option to display.

The default value is true.

See also: enablePopupMenu

enablePopupMenu

 public boolean isEnablePopupMenu()
 public void setEnablePopupMenu(boolean popupEnabled)
Returns and sets whether a popup menu is enabled on the JdbEditorPane. If enablePopupMenu is true, a menu pops up when the user right-clicks on the JdbEditorPane or presses Shift+F10.

enableUndoRedo

 public boolean isEnableUndoRedo()
 public void setEnableUndoRedo(boolean enableUndoRedo)
Returns and sets whether the Undo and Redo menu commands appear on the popup menu.

See also: enablePopupMenu

enableURLAutoCache

 public boolean isEnableURLAutoCache()
 public void setEnableURLAutoCache(boolean enableURLCache)
Returns and sets whether HTML pages fetched using hyperlinks are automatically inserted as new rows if they don't already exist in the DataSet (for example, the URL in the columnNameURL column can't be found). This property is ignored unless the data binder is bound to a JdbEditorPane, the columnNameURL property is set, and the associated DataSet allows new rows to be inserted. The default value is true.

See also: enablePopupMenu

enableURLLoading

 public boolean isEnableURLLoading()
 public void setEnableURLLoading(boolean enableURLLoading)
Returns and sets whether the Open URL load menu command is available on the popup menu.

The default value is true.

See also: enablePopupMenu

pageURL

 public String getPageURL()
 public void setPageURL(String urlString)
Returns and sets the JdbEditorPane's URL page as a String:

postOnFocusLost

 public boolean isPostOnFocusLost()
 public void setPostOnFocusLost(boolean postOnFocusLost)
Returns and sets whether the current text is entered in the DataSet Column indicated by columnName property when focus is lost on the text area. The default value is true.

postOnRowPosted

 public boolean isPostOnRowPosted()
 public void setPostOnRowPosted(boolean postOnRowPosted)
Returns and sets whether the current text should be put in the DataSet Column indicated by the columnName property 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.

JdbEditorPane methods

commonInit()

  protected void commonInit()
Used to initialize JdbEditorPane with the same defaults, regardless of the constructor used.

A newly instantiated JdbEditorPane differs from a JEditorPane in that it is non-editable by default, has a non-blinking cursor, and its cursor has the same foreground color as a JTextPane.


JdbEditorPane event listeners

This component is a source for the following event sets.

ancestor

 public void addAncestorListener(javax.swing.event.AncestorListener )
 public void removeAncestorListener(javax.swing.event.AncestorListener )

caret

 public void addCaretListener(javax.swing.event.CaretListener )
 public void removeCaretListener(javax.swing.event.CaretListener )

component

 public synchronized void addComponentListener(java.awt.event.ComponentListener )
 public synchronized void removeComponentListener(java.awt.event.ComponentListener )

container

 public synchronized void addContainerListener(java.awt.event.ContainerListener )
 public synchronized void removeContainerListener(java.awt.event.ContainerListener )

focus

 public synchronized void addFocusListener(java.awt.event.FocusListener )
 public synchronized void removeFocusListener(java.awt.event.FocusListener )

hyperlink

 public synchronized void addHyperlinkListener(javax.swing.event.HyperlinkListener )
 public synchronized void removeHyperlinkListener(javax.swing.event.HyperlinkListener )

inputMethod

 public synchronized void addInputMethodListener(java.awt.event.InputMethodListener )
 public synchronized void removeInputMethodListener(java.awt.event.InputMethodListener )

key

 public synchronized void addKeyListener(java.awt.event.KeyListener )
 public synchronized void removeKeyListener(java.awt.event.KeyListener )

mouse

 public synchronized void addMouseListener(java.awt.event.MouseListener )
 public synchronized void removeMouseListener(java.awt.event.MouseListener )

mouseMotion

 public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener )
 public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )

propertyChange

 public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener )
 public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )

vetoableChange

 public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener )
 public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )