public class TrailingSpacePlugin extends java.lang.Object implements EditorPlugin, javax.swing.event.ChangeListener, java.awt.event.HierarchyListener
TrailingSpacePlugin
is an
for an EditorPlugin implementation which provides support for
performing some action when the user clicks over certain text in
an editor, usually with a modifier key held down. It also supports
displaying some hint text in the status bar, when the user hovers
(moves the mouse) over that text with modifier key held down, and
underlines it for additional feedback.Constructor and Description |
---|
TrailingSpacePlugin() |
Modifier and Type | Method and Description |
---|---|
protected int |
calculateTrailingColumns(int viewportWidth)
Fetch the number of trailing columns that should be used for the given
viewport width.
|
protected int |
calculateTrailingRows(int viewportHeight)
Fetch the number of trailing rows that should be used for the given
viewport height.
|
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 BasicEditorPane |
getEditorPane()
Fetch the
BasicEditorPane associated with this plugin,
or null if this plugin is not currently installed. |
void |
hierarchyChanged(java.awt.event.HierarchyEvent event)
Called when the hierarchy has been changed.
|
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 |
stateChanged(javax.swing.event.ChangeEvent event)
Invoked when the target of the listener has changed its state.
|
public void install(BasicEditorPane editor)
install
in interface EditorPlugin
editor
- the editor panepublic void deinstall(BasicEditorPane editor)
deinstall
in interface EditorPlugin
editor
- the editor panepublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- A PropertyChangeEvent object describing the event source
and the property that has changed.public void stateChanged(javax.swing.event.ChangeEvent event)
stateChanged
in interface javax.swing.event.ChangeListener
event
- the change eventpublic void hierarchyChanged(java.awt.event.HierarchyEvent event)
HierarchyEvent.getChangeFlags()
.hierarchyChanged
in interface java.awt.event.HierarchyListener
protected BasicEditorPane getEditorPane()
BasicEditorPane
associated with this plugin,
or null if this plugin is not currently installed.protected int calculateTrailingRows(int viewportHeight)
viewportHeight
- the height of the viewport areaprotected int calculateTrailingColumns(int viewportWidth)
viewportWidth
- the width of the viewport area