public final class TextTabber
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TextTabber.InvalidRangeAction |
class |
TextTabber.TabTextRange
A TextRange that also contains a key to identify it to clients
|
Modifier and Type | Field and Description |
---|---|
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.
|
static java.lang.String |
PROPERTY_RANGE_CHANGE_PENDING
Property for when the active range is about to be changed.
|
static java.lang.String |
PROPERTY_SELECT
Property for when the user selects a field of the TextTabber.
|
Constructor and Description |
---|
TextTabber(BasicEditorPane editor)
Create a TextTabber for the specified editor
|
Modifier and Type | Method and Description |
---|---|
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). |
boolean |
getEnterIsSelect() |
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 |
selectRange(TextTabber.TabTextRange range)
Select (move the highlight) to the indicated range.
|
void |
setActive(boolean isActive)
Start or stop the tabbing effect.
|
void |
setEnterIsSelect(boolean enterIsSelect)
Set the ability for the TextTabber to consume Enter key presses and fire a PROPERTY_SELECT property
change event instead.
|
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() |
public static final java.lang.String PROPERTY_ACTIVE
public static final java.lang.String PROPERTY_SELECT
public static final java.lang.String PROPERTY_RANGE_CHANGE
public static final java.lang.String PROPERTY_RANGE_CHANGE_PENDING
public TextTabber(BasicEditorPane editor)
editor
- public void setEnterIsSelect(boolean enterIsSelect)
enterIsSelect
- public boolean getEnterIsSelect()
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 selectRange(TextTabber.TabTextRange range)
range
- Range to be selectedjava.lang.IllegalArgumentException
- if range is null or not a member of text tabber's rangespublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public java.lang.String toString()
toString
in class java.lang.Object