src/java.desktop/share/classes/javax/swing/text/NavigationFilter.java

Print this page




 103      * @exception BadLocationException for a bad location within a document model
 104      * @exception IllegalArgumentException if <code>direction</code>
 105      *          doesn't have one of the legal values above
 106      */
 107     public int getNextVisualPositionFrom(JTextComponent text, int pos,
 108                                          Position.Bias bias, int direction,
 109                                          Position.Bias[] biasRet)
 110                                            throws BadLocationException {
 111         return text.getUI().getNextVisualPositionFrom(text, pos, bias,
 112                                                       direction, biasRet);
 113     }
 114 
 115 
 116     /**
 117      * Used as a way to circumvent calling back into the caret to
 118      * position the cursor. Caret implementations that wish to support
 119      * a NavigationFilter must provide an implementation that will
 120      * not callback into the NavigationFilter.
 121      * @since 1.4
 122      */
 123     public static abstract class FilterBypass {
 124         /**
 125          * Returns the Caret that is changing.
 126          *
 127          * @return Caret that is changing
 128          */
 129         public abstract Caret getCaret();
 130 
 131         /**
 132          * Sets the caret location, bypassing the NavigationFilter.
 133          *
 134          * @param dot the position &gt;= 0
 135          * @param bias Bias to place the dot at
 136          */
 137         public abstract void setDot(int dot, Position.Bias bias);
 138 
 139         /**
 140          * Moves the caret location, bypassing the NavigationFilter.
 141          *
 142          * @param dot the position &gt;= 0
 143          * @param bias Bias for new location


 103      * @exception BadLocationException for a bad location within a document model
 104      * @exception IllegalArgumentException if <code>direction</code>
 105      *          doesn't have one of the legal values above
 106      */
 107     public int getNextVisualPositionFrom(JTextComponent text, int pos,
 108                                          Position.Bias bias, int direction,
 109                                          Position.Bias[] biasRet)
 110                                            throws BadLocationException {
 111         return text.getUI().getNextVisualPositionFrom(text, pos, bias,
 112                                                       direction, biasRet);
 113     }
 114 
 115 
 116     /**
 117      * Used as a way to circumvent calling back into the caret to
 118      * position the cursor. Caret implementations that wish to support
 119      * a NavigationFilter must provide an implementation that will
 120      * not callback into the NavigationFilter.
 121      * @since 1.4
 122      */
 123     public abstract static class FilterBypass {
 124         /**
 125          * Returns the Caret that is changing.
 126          *
 127          * @return Caret that is changing
 128          */
 129         public abstract Caret getCaret();
 130 
 131         /**
 132          * Sets the caret location, bypassing the NavigationFilter.
 133          *
 134          * @param dot the position &gt;= 0
 135          * @param bias Bias to place the dot at
 136          */
 137         public abstract void setDot(int dot, Position.Bias bias);
 138 
 139         /**
 140          * Moves the caret location, bypassing the NavigationFilter.
 141          *
 142          * @param dot the position &gt;= 0
 143          * @param bias Bias for new location