Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

oracle.ide.ceditor
Class EditorStatusBar

java.lang.Object
  extended by oracle.ide.ceditor.EditorStatusBar
All Implemented Interfaces:
java.awt.event.ActionListener, java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.event.ChangeListener, FeedbackManager, EditorPlugin

public class EditorStatusBar
extends java.lang.Object
implements java.awt.event.ActionListener, javax.swing.event.ChangeListener, EditorPlugin, FeedbackManager

The StatusBarPlugin provides a status bar UI component that works with the BasicEditorPane. It is implemented as a plugin as a convenient way to attach to the editor pane. To use this plugin, install it into the editor pane by calling installPlugin() on the BasicEditorPane.


Nested Class Summary
protected static class EditorStatusBar.StatusBarCell
          The StatusBarCell is just a label that can be added to our status bar which takes care of making sure that its size remains fairly constant for the types of strings which can contain it (otherwise, it looks pretty bad for the cells to be changing in width, say when you switch between insert and overwrite mode.)
 
Field Summary
static java.lang.String BLANK_MESSAGE
          An empty message just to set the height of the status bar.
static java.lang.String[] EOL_CELL_STRINGS
          The array of strings for the EOL type cell for sizing.
static java.lang.String EOL_MACINTOSH
          String for file with Macintosh-OS9-style EOL terminators (single CR.)
static java.lang.String EOL_UNIX
          String for file with UNIX-style EOL terminators (single LF.)
static java.lang.String EOL_WINDOWS
          String for file with Windows-style EOL terminators (CR/LF pair.)
static java.lang.String INSERT_MODE
          String for insert mode.
static java.lang.String[] INSERT_OVERWRITE_CELL_STRINGS
          The array of cell strings for the InsertOverwrite cell for sizing.
static java.lang.String LINE_COLUMN
          String for the line and column info.
static java.lang.String[] LINE_NUMBER_CELL_STRINGS
          The array of strings for the line number cell for sizing.
static java.lang.String[] LINE_NUMBER_WITH_TOTAL_CELL_STRINGS
          The array of strings for the line number with total cell for sizing.
static java.lang.String LINE_WITH_TOTAL_COLUMN
          String for the line (with total) and column info.
static java.lang.String MODIFIED
          String for modified label.
static java.lang.String[] MODIFIED_CELL_STRINGS
          The array of strings for the Modified cell for sizing.
static java.lang.String OFFSET
          String for the line and column info.
static java.lang.String[] OFFSET_CELL_STRINGS
          The array of strings for the line number cell for sizing.
static java.lang.String OVERWRITE_MODE
          String for overwrite mode.
static java.lang.String PROTECTED
          String for the protected label.
static java.lang.String READ_ONLY
          String for read only label.
 
Constructor Summary
EditorStatusBar()
          Constructs a new EditorStatusBar instance that is associated with the specified editor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          This is invoked when an action is performed.
 void deinstall(BasicEditorPane editor)
          Called when the plugin is being removed from the BasicEditorPane (for example when the editor is closed.) This is used to notify plugins that they should unregister any listeners that were attached.
protected static java.lang.String getLineColumnText(int line, int column)
          Utility routine for building up the "Line 1 Column 5" text.
protected static java.lang.String getLineWithTotalColumnText(int line, int total, int column)
          Utility routine for building up the "Line 1 Column 5" text.
protected static java.lang.String getOffsetText(java.lang.String template, int offset)
          Utility routine for building up the "Offset 5" text.
 javax.swing.JComponent[] getStatusBarCells()
          Fetches the array of cells that make up this status bar.
 void hideFeedback(BasicEditorPane editorPane)
          Clears the text feedback message last displayed for the given editor pane.
 void install(BasicEditorPane editor)
          Called when this plugin is being installed into the BasicEditorPane.
 void propertyChange(java.beans.PropertyChangeEvent event)
          This method gets called when a bound property is changed.
 void showFeedback(BasicEditorPane editorPane, java.lang.String feedbackMessage)
          Displays a text feedback message to the user associated with the given editor pane.
 void showFeedback(BasicEditorPane editorPane, java.lang.String feedbackMessage, int milliSeconds)
          Displays a text feedback message to the user associated with the given editor pane.
 void stateChanged(javax.swing.event.ChangeEvent event)
          Invoked when the target of the listener has changed its state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLANK_MESSAGE

public static final java.lang.String BLANK_MESSAGE
An empty message just to set the height of the status bar.

See Also:
Constant Field Values

INSERT_MODE

public static final java.lang.String INSERT_MODE
String for insert mode.


OVERWRITE_MODE

public static final java.lang.String OVERWRITE_MODE
String for overwrite mode.


LINE_COLUMN

public static final java.lang.String LINE_COLUMN
String for the line and column info.


LINE_WITH_TOTAL_COLUMN

public static final java.lang.String LINE_WITH_TOTAL_COLUMN
String for the line (with total) and column info.


OFFSET

public static final java.lang.String OFFSET
String for the line and column info.


EOL_MACINTOSH

public static final java.lang.String EOL_MACINTOSH
String for file with Macintosh-OS9-style EOL terminators (single CR.)


EOL_UNIX

public static final java.lang.String EOL_UNIX
String for file with UNIX-style EOL terminators (single LF.)


EOL_WINDOWS

public static final java.lang.String EOL_WINDOWS
String for file with Windows-style EOL terminators (CR/LF pair.)


MODIFIED

public static final java.lang.String MODIFIED
String for modified label.


READ_ONLY

public static final java.lang.String READ_ONLY
String for read only label.


PROTECTED

public static final java.lang.String PROTECTED
String for the protected label.


INSERT_OVERWRITE_CELL_STRINGS

public static final java.lang.String[] INSERT_OVERWRITE_CELL_STRINGS
The array of cell strings for the InsertOverwrite cell for sizing.


EOL_CELL_STRINGS

public static final java.lang.String[] EOL_CELL_STRINGS
The array of strings for the EOL type cell for sizing.


MODIFIED_CELL_STRINGS

public static final java.lang.String[] MODIFIED_CELL_STRINGS
The array of strings for the Modified cell for sizing.


LINE_NUMBER_CELL_STRINGS

public static final java.lang.String[] LINE_NUMBER_CELL_STRINGS
The array of strings for the line number cell for sizing.


LINE_NUMBER_WITH_TOTAL_CELL_STRINGS

public static final java.lang.String[] LINE_NUMBER_WITH_TOTAL_CELL_STRINGS
The array of strings for the line number with total cell for sizing.


OFFSET_CELL_STRINGS

public static final java.lang.String[] OFFSET_CELL_STRINGS
The array of strings for the line number cell for sizing.

Constructor Detail

EditorStatusBar

public EditorStatusBar()
Constructs a new EditorStatusBar instance that is associated with the specified editor.

Method Detail

install

public void install(BasicEditorPane editor)
Called when this plugin is being installed into the BasicEditorPane.

Specified by:
install in interface EditorPlugin
Parameters:
editor - the editor pane

deinstall

public void deinstall(BasicEditorPane editor)
Called when the plugin is being removed from the BasicEditorPane (for example when the editor is closed.) This is used to notify plugins that they should unregister any listeners that were attached.

Specified by:
deinstall in interface EditorPlugin
Parameters:
editor - the editor pane

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
This method gets called when a bound property is changed.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
event - A PropertyChangeEvent object describing the event source and the property that has changed.

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent event)
Invoked when the target of the listener has changed its state.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener
Parameters:
event - the change event

showFeedback

public void showFeedback(BasicEditorPane editorPane,
                         java.lang.String feedbackMessage)
Displays a text feedback message to the user associated with the given editor pane.

Specified by:
showFeedback in interface FeedbackManager
Parameters:
editorPane - the editor pane the message is associated with
feedbackMessage - the message to display

showFeedback

public void showFeedback(BasicEditorPane editorPane,
                         java.lang.String feedbackMessage,
                         int milliSeconds)
Displays a text feedback message to the user associated with the given editor pane. The message will only be displayed for the time period specified.

Specified by:
showFeedback in interface FeedbackManager
Parameters:
editorPane - the editor pane the message is associated with
feedbackMessage - the message to display
milliSeconds - the length of time to display the message

hideFeedback

public void hideFeedback(BasicEditorPane editorPane)
Clears the text feedback message last displayed for the given editor pane. This is meant to be used in conjunction with the non-timeout version of showFeedback() to clear the feedback area.

Specified by:
hideFeedback in interface FeedbackManager
Parameters:
editorPane - the editor pane the last message was associated with

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
This is invoked when an action is performed. In this case, it should only be a Timer event.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
event - the action event

getStatusBarCells

public javax.swing.JComponent[] getStatusBarCells()
Fetches the array of cells that make up this status bar.

Returns:
an array of this status bar's cells

getLineColumnText

protected static java.lang.String getLineColumnText(int line,
                                                    int column)
Utility routine for building up the "Line 1 Column 5" text.

Parameters:
line - the line number
column - the column number
Returns:
the display text for the line and column cell

getLineWithTotalColumnText

protected static java.lang.String getLineWithTotalColumnText(int line,
                                                             int total,
                                                             int column)
Utility routine for building up the "Line 1 Column 5" text.

Parameters:
line - the line number
total - the total number of lines in the editor
column - the column number
Returns:
the display text for the line and column cell

getOffsetText

protected static java.lang.String getOffsetText(java.lang.String template,
                                                int offset)
Utility routine for building up the "Offset 5" text.

Parameters:
template - the template for the text, i.e., "Offset {0}"
offset - the offset number
Returns:
the display text for the offset cell

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

Copyright © 1997, 2011, Oracle. All rights reserved.