Java 类java.awt.TextComponent 实例源码

项目:apache-jmeter-2.10    文件:NumberFieldErrorListener.java   
@Override
public void focusLost(FocusEvent e) {
    Component source = (Component) e.getSource();
    String text = "";
    if (source instanceof JTextComponent) {
        text = ((JTextComponent) source).getText();
    } else if (source instanceof TextComponent) {
        text = ((TextComponent) source).getText();
    }
    try {
        Integer.parseInt(text);
    } catch (NumberFormatException nfe) {
        JOptionPane.showMessageDialog(source,
                JMeterUtils.getResString("you_must_enter_a_valid_number"), //$NON-NLS-1$
                JMeterUtils.getResString("invalid_data"),  //$NON-NLS-1$
                JOptionPane.WARNING_MESSAGE);
        FocusRequester.requestFocus(source);
    }
}
项目:marathonv5    文件:AbstractJavaElement.java   
public void _clear() {
    verifyCanInteractWithElement();
    final Component active = Device.getActiveComponent(component);
    if (active instanceof JTextComponent) {
        ((JTextComponent) active).setText("");
    } else if (active instanceof TextComponent) {
        ((TextComponent) active).setText("");
    } else {
        throw new UnsupportedCommandException("Clear not supported on " + active.getClass().getName(), null);
    }
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.addTextListener(TextListener)} through queue
 */
public void addTextListener(final TextListener textListener) {
    runMapping(new MapVoidAction("addTextListener") {
        @Override
        public void map() {
            ((TextComponent) getSource()).addTextListener(textListener);
        }
    });
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.getCaretPosition()} through queue
 */
public int getCaretPosition() {
    return (runMapping(new MapIntegerAction("getCaretPosition") {
        @Override
        public int map() {
            return ((TextComponent) getSource()).getCaretPosition();
        }
    }));
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.getSelectedText()} through queue
 */
public String getSelectedText() {
    return (runMapping(new MapAction<String>("getSelectedText") {
        @Override
        public String map() {
            return ((TextComponent) getSource()).getSelectedText();
        }
    }));
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.getSelectionEnd()} through queue
 */
public int getSelectionEnd() {
    return (runMapping(new MapIntegerAction("getSelectionEnd") {
        @Override
        public int map() {
            return ((TextComponent) getSource()).getSelectionEnd();
        }
    }));
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.getSelectionStart()} through queue
 */
public int getSelectionStart() {
    return (runMapping(new MapIntegerAction("getSelectionStart") {
        @Override
        public int map() {
            return ((TextComponent) getSource()).getSelectionStart();
        }
    }));
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.getText()} through queue
 */
public String getText() {
    return (runMapping(new MapAction<String>("getText") {
        @Override
        public String map() {
            return ((TextComponent) getSource()).getText();
        }
    }));
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.isEditable()} through queue
 */
public boolean isEditable() {
    return (runMapping(new MapBooleanAction("isEditable") {
        @Override
        public boolean map() {
            return ((TextComponent) getSource()).isEditable();
        }
    }));
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.removeTextListener(TextListener)} through queue
 */
public void removeTextListener(final TextListener textListener) {
    runMapping(new MapVoidAction("removeTextListener") {
        @Override
        public void map() {
            ((TextComponent) getSource()).removeTextListener(textListener);
        }
    });
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.select(int, int)} through queue
 */
public void select(final int i, final int i1) {
    runMapping(new MapVoidAction("select") {
        @Override
        public void map() {
            ((TextComponent) getSource()).select(i, i1);
        }
    });
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.selectAll()} through queue
 */
public void selectAll() {
    runMapping(new MapVoidAction("selectAll") {
        @Override
        public void map() {
            ((TextComponent) getSource()).selectAll();
        }
    });
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.setCaretPosition(int)} through queue
 */
public void setCaretPosition(final int i) {
    runMapping(new MapVoidAction("setCaretPosition") {
        @Override
        public void map() {
            ((TextComponent) getSource()).setCaretPosition(i);
        }
    });
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.setEditable(boolean)} through queue
 */
public void setEditable(final boolean b) {
    runMapping(new MapVoidAction("setEditable") {
        @Override
        public void map() {
            ((TextComponent) getSource()).setEditable(b);
        }
    });
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.setSelectionEnd(int)} through queue
 */
public void setSelectionEnd(final int i) {
    runMapping(new MapVoidAction("setSelectionEnd") {
        @Override
        public void map() {
            ((TextComponent) getSource()).setSelectionEnd(i);
        }
    });
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.setSelectionStart(int)} through queue
 */
public void setSelectionStart(final int i) {
    runMapping(new MapVoidAction("setSelectionStart") {
        @Override
        public void map() {
            ((TextComponent) getSource()).setSelectionStart(i);
        }
    });
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.setText(String)} through queue
 */
public void setText(final String string) {
    runMapping(new MapVoidAction("setText") {
        @Override
        public void map() {
            ((TextComponent) getSource()).setText(string);
        }
    });
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
@Override
public boolean checkComponent(Component comp) {
    if (comp instanceof TextComponent) {
        if (((TextComponent) comp).getText() != null) {
            return (comparator.equals(((TextComponent) comp).getText(),
                    label));
        }
    }
    return false;
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.addTextListener(TextListener)} through queue
 */
public void addTextListener(final TextListener textListener) {
    runMapping(new MapVoidAction("addTextListener") {
        @Override
        public void map() {
            ((TextComponent) getSource()).addTextListener(textListener);
        }
    });
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.getCaretPosition()} through queue
 */
public int getCaretPosition() {
    return (runMapping(new MapIntegerAction("getCaretPosition") {
        @Override
        public int map() {
            return ((TextComponent) getSource()).getCaretPosition();
        }
    }));
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.getSelectedText()} through queue
 */
public String getSelectedText() {
    return (runMapping(new MapAction<String>("getSelectedText") {
        @Override
        public String map() {
            return ((TextComponent) getSource()).getSelectedText();
        }
    }));
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.getSelectionEnd()} through queue
 */
public int getSelectionEnd() {
    return (runMapping(new MapIntegerAction("getSelectionEnd") {
        @Override
        public int map() {
            return ((TextComponent) getSource()).getSelectionEnd();
        }
    }));
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.getSelectionStart()} through queue
 */
public int getSelectionStart() {
    return (runMapping(new MapIntegerAction("getSelectionStart") {
        @Override
        public int map() {
            return ((TextComponent) getSource()).getSelectionStart();
        }
    }));
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.getText()} through queue
 */
public String getText() {
    return (runMapping(new MapAction<String>("getText") {
        @Override
        public String map() {
            return ((TextComponent) getSource()).getText();
        }
    }));
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.isEditable()} through queue
 */
public boolean isEditable() {
    return (runMapping(new MapBooleanAction("isEditable") {
        @Override
        public boolean map() {
            return ((TextComponent) getSource()).isEditable();
        }
    }));
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.removeTextListener(TextListener)} through queue
 */
public void removeTextListener(final TextListener textListener) {
    runMapping(new MapVoidAction("removeTextListener") {
        @Override
        public void map() {
            ((TextComponent) getSource()).removeTextListener(textListener);
        }
    });
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.select(int, int)} through queue
 */
public void select(final int i, final int i1) {
    runMapping(new MapVoidAction("select") {
        @Override
        public void map() {
            ((TextComponent) getSource()).select(i, i1);
        }
    });
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.selectAll()} through queue
 */
public void selectAll() {
    runMapping(new MapVoidAction("selectAll") {
        @Override
        public void map() {
            ((TextComponent) getSource()).selectAll();
        }
    });
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.setCaretPosition(int)} through queue
 */
public void setCaretPosition(final int i) {
    runMapping(new MapVoidAction("setCaretPosition") {
        @Override
        public void map() {
            ((TextComponent) getSource()).setCaretPosition(i);
        }
    });
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.setEditable(boolean)} through queue
 */
public void setEditable(final boolean b) {
    runMapping(new MapVoidAction("setEditable") {
        @Override
        public void map() {
            ((TextComponent) getSource()).setEditable(b);
        }
    });
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.setSelectionEnd(int)} through queue
 */
public void setSelectionEnd(final int i) {
    runMapping(new MapVoidAction("setSelectionEnd") {
        @Override
        public void map() {
            ((TextComponent) getSource()).setSelectionEnd(i);
        }
    });
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.setSelectionStart(int)} through queue
 */
public void setSelectionStart(final int i) {
    runMapping(new MapVoidAction("setSelectionStart") {
        @Override
        public void map() {
            ((TextComponent) getSource()).setSelectionStart(i);
        }
    });
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Maps {@code TextComponent.setText(String)} through queue
 */
public void setText(final String string) {
    runMapping(new MapVoidAction("setText") {
        @Override
        public void map() {
            ((TextComponent) getSource()).setText(string);
        }
    });
}
项目:openjdk9    文件:TextComponentOperator.java   
@Override
public boolean checkComponent(Component comp) {
    if (comp instanceof TextComponent) {
        if (((TextComponent) comp).getText() != null) {
            return (comparator.equals(((TextComponent) comp).getText(),
                    label));
        }
    }
    return false;
}
项目:java-ui-factory    文件:TextComponentFactory.java   
@UiAnnotationHandler(UiText.class)
void handleUiText(final ComponentContext context,
        final TextComponent component, final UiText annotate) {
    component.setText(annotate.value());
    LOGGER.debug("{}|TextComponent.setText(\"{}\")", context.getId(),
            annotate.value());
}
项目:pdfxtk    文件:Awt.java   
public static void setCursor(Container container, int cursor) {
   Component[] cmps = container.getComponents();
   container.setCursor(Cursor.getPredefinedCursor(cursor));
   for(int i = 0; i < cmps.length; i++) {
     if(cmps[i] instanceof Container)
setCursor((Container)cmps[i], cursor);
     else if (cmps[i] instanceof TextComponent && 
       cursor == Cursor.DEFAULT_CURSOR)
cmps[i].setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
     else
cmps[i].setCursor(Cursor.getPredefinedCursor(cursor));
   }
 }
项目:openjdk-jdk10    文件:TextComponentOperator.java   
@Override
public Hashtable<String, Object> getDump() {
    Hashtable<String, Object> result = super.getDump();
    result.put(TEXT_DPROP, ((TextComponent) getSource()).getText());
    return result;
}
项目:openjdk-jdk10    文件:TextComponentOperator.java   
/**
 * Constructs TextComponentFinder.
 */
public TextComponentFinder() {
    super(TextComponent.class);
}
项目:openjdk9    文件:TextComponentOperator.java   
@Override
public Hashtable<String, Object> getDump() {
    Hashtable<String, Object> result = super.getDump();
    result.put(TEXT_DPROP, ((TextComponent) getSource()).getText());
    return result;
}
项目:openjdk9    文件:TextComponentOperator.java   
/**
 * Constructs TextComponentFinder.
 */
public TextComponentFinder() {
    super(TextComponent.class);
}