|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.1.0) E17493-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.javatools.editor.TextTabber
public final class TextTabber
A class to highlight a number of sections of text in an editor. The user can
then quickly tab forward and backwards through these sections with each
section becoming the editor selection in turn.
To use: create an instance, add ranges of text to it via calls to addRange,
then call setActive(true) to start the tabbing effect.
The effect is automatically removed when either:
- The caret is repositioned before the start offset of the valid range
- The caret is repositioned after the end offset of the valid range
- or by a call to setActive(false).
- or by the user hitting cancel (the escape key by default)
The sections of text can be added in any order, the TextTabber works out
the order of tabbing based on current caret location and start offset.
The offsets for the ranges are automatically adjusted if the text in the
editor is changed.
Internally the class uses editor resources. Once created a TextTabber must
either be started or manually disposed otherwise the resources will not
be freed.
Ranges are currently not allowed to touch. If a change in the document
occurs such that two ranges are immediately adjacent then the InvalidRangeAction
occurs, this can be set to either stop the tabber, or to remove invalid ranges.
Nested Class Summary | |
---|---|
static class |
TextTabber.InvalidRangeAction
|
class |
TextTabber.TabTextRange
A TextRange that also contains a key to identify it to clients |
Field Summary | |
---|---|
static java.lang.String |
PROPERTY_ACTIVE
Property for when the TextTabber becomes active or not |
static java.lang.String |
PROPERTY_RANGE_CHANGE
Property for when the active range is changed. |
Constructor Summary | |
---|---|
TextTabber(BasicEditorPane editor)
Create a TextTabber for the specified editor |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
|
TextTabber.TabTextRange |
addRange(int startOffset,
int endOffset)
Add a range of text to the TextTabber so that is involved in the tabbing. |
TextTabber.TabTextRange |
addRange(java.lang.Object key,
int startOffset,
int endOffset)
Add a range of text to the TextTabber so that is involved in the tabbing. |
void |
dispose()
As the TextTabber uses editor resources these resources need to be released when no longer needed. Note: disposal is automatic once the TextTabber has been activated via setActive(true). |
TextTabber.InvalidRangeAction |
getInvalidRangeAction()
|
java.util.Collection<TextTabber.TabTextRange> |
getTextRanges()
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
removeRange(TextTabber.TabTextRange textRange)
Remove a previously added TabTextRange, This range no longer participates in the tabbing. |
void |
setActive(boolean isActive)
Start or stop the tabbing effect. |
void |
setInvalidRangeAction(TextTabber.InvalidRangeAction invalidRangeAction)
The action to take when the TextTabber discovers a change in the document that makes at least one range invalid (e.g. |
void |
setValidRange(int startValidOffset,
int endValidOffset)
Manually set the first and last offset between which the TextTabber will remain active. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTY_ACTIVE
public static final java.lang.String PROPERTY_RANGE_CHANGE
Constructor Detail |
---|
public TextTabber(BasicEditorPane editor)
editor
- Method Detail |
---|
public TextTabber.TabTextRange addRange(int startOffset, int endOffset)
startOffset
- endOffset
-
public TextTabber.TabTextRange addRange(java.lang.Object key, int startOffset, int endOffset)
key
- the key is set in the returned TabTextRange for clients to identify the rangestartOffset
- endOffset
-
public void removeRange(TextTabber.TabTextRange textRange)
textRange
- public void setValidRange(int startValidOffset, int endValidOffset)
startValidOffset
- endValidOffset
- public void setActive(boolean isActive)
isActive
- public java.util.Collection<TextTabber.TabTextRange> getTextRanges()
public void dispose()
public void setInvalidRangeAction(TextTabber.InvalidRangeAction invalidRangeAction)
invalidRangeAction
- public TextTabber.InvalidRangeAction getInvalidRangeAction()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public java.lang.String toString()
toString
in class java.lang.Object
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.1.0) E17493-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |