javax.swing.text
public class: NavigationFilter [javadoc |
source]
java.lang.Object
javax.swing.text.NavigationFilter
Direct Known Subclasses:
DefaultNavigationFilter
NavigationFilter
can be used to restrict where the cursor can
be positioned. When the default cursor positioning actions attempt to
reposition the cursor they will call into the
NavigationFilter
, assuming
the
JTextComponent
has a non-null
NavigationFilter
set. In this manner
the
NavigationFilter
can effectively restrict where the
cursor can be positioned. Similarly
DefaultCaret
will call
into the
NavigationFilter
when the user is changing the
selection to further restrict where the cursor can be positioned.
Subclasses can conditionally call into supers implementation to restrict
where the cursor can be placed, or call directly into the
FilterBypass
.
Nested Class Summary: |
---|
abstract public static class | NavigationFilter.FilterBypass | Used as a way to circumvent calling back into the caret to
position the cursor. Caret implementations that wish to support
a NavigationFilter must provide an implementation that will
not callback into the NavigationFilter. |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.swing.text.NavigationFilter Detail: |
public int getNextVisualPositionFrom(JTextComponent text,
int pos,
Bias bias,
int direction,
Bias[] biasRet) throws BadLocationException {
return text.getUI().getNextVisualPositionFrom(text, pos, bias,
direction, biasRet);
}
Returns the next visual position to place the caret at from an
existing position. The default implementation simply forwards the
method to the root View. Subclasses may wish to further restrict the
location based on additional criteria. |
public void moveDot(FilterBypass fb,
int dot,
Bias bias) {
fb.moveDot(dot, bias);
}
Invoked prior to the Caret moving the dot. The default implementation
calls directly into the FilterBypass with the passed
in arguments. Subclasses may wish to conditionally
call super with a different location, or invoke the necessary
methods on the FilterBypass . |
public void setDot(FilterBypass fb,
int dot,
Bias bias) {
fb.setDot(dot, bias);
}
Invoked prior to the Caret setting the dot. The default implementation
calls directly into the FilterBypass with the passed
in arguments. Subclasses may wish to conditionally
call super with a different location, or invoke the necessary method
on the FilterBypass |