Lines Matching defs:text
30 import java.text.ParseException;
36 import javax.swing.text.AttributeSet;
37 import javax.swing.text.BadLocationException;
38 import javax.swing.text.DefaultFormatterFactory;
39 import javax.swing.text.DocumentFilter;
43 static void init(int length, boolean hex, JFormattedTextField text) {
45 text.setColumns(length);
46 text.setFormatterFactory(new DefaultFormatterFactory(formatter));
47 text.setHorizontalAlignment(SwingConstants.RIGHT);
48 text.setMinimumSize(text.getPreferredSize());
49 text.addFocusListener(formatter);
61 public void replace(FilterBypass fb, int offset, int length, String text, AttributeSet set) throws BadLocationException {
62 if (isValid(fb.getDocument().getLength() + text.length() - length) && isValid(text)) {
63 fb.replace(offset, length, text.toUpperCase(ENGLISH), set);
68 public void insertString(FilterBypass fb, int offset, String text, AttributeSet set) throws BadLocationException {
69 if (isValid(fb.getDocument().getLength() + text.length()) && isValid(text)) {
70 fb.insertString(offset, text.toUpperCase(ENGLISH), set);
78 private JFormattedTextField text;
86 public Object stringToValue(String text) throws ParseException {
88 return Integer.valueOf(text, this.radix);
123 this.text = (JFormattedTextField) source;
132 if (this.text != null) {
133 this.text.selectAll();
141 private boolean isValid(String text) {
142 int length = text.length();
144 char ch = text.charAt(i);