1 7 package javax.swing.text; 8 9 34 public class DocumentFilter { 35 49 public void remove(FilterBypass fb, int offset, int length) throws 50 BadLocationException { 51 fb.remove(offset, length); 52 } 53 54 70 public void insertString(FilterBypass fb, int offset, String string, 71 AttributeSet attr) throws BadLocationException { 72 fb.insertString(offset, string, attr); 73 } 74 75 90 public void replace(FilterBypass fb, int offset, int length, String text, 91 AttributeSet attrs) throws BadLocationException { 92 fb.replace(offset, length, text, attrs); 93 } 94 95 96 103 public static abstract class FilterBypass { 104 109 public abstract Document getDocument(); 110 111 121 public abstract void remove(int offset, int length) throws 122 BadLocationException ; 123 124 136 public abstract void insertString(int offset, String string, 137 AttributeSet attr) throws 138 BadLocationException ; 139 140 153 public abstract void replace(int offset, int length, String string, 154 AttributeSet attrs) throws 155 BadLocationException ; 156 } 157 } 158 | Popular Tags |