下面列出了怎么用javafx.scene.control.skin.TextFieldSkin的API类实例代码及写法,或者点击链接到github查看源代码。
public JFXTextFieldSkinBisqStyle(T textField, double inputLineExtension) {
super(textField);
textPane = (Pane) this.getChildren().get(0);
this.inputLineExtension = inputLineExtension;
// get parent fields
textNode = ReflectionHelper.getFieldContent(TextFieldSkin.class, this, "textNode");
textTranslateX = ReflectionHelper.getFieldContent(TextFieldSkin.class, this, "textTranslateX");
textRight = ReflectionHelper.getFieldContent(TextFieldSkin.class, this, "textRight");
linesWrapper = new PromptLinesWrapper<T>(
textField,
promptTextFillProperty(),
textField.textProperty(),
textField.promptTextProperty(),
() -> promptText);
linesWrapper.init(() -> createPromptNode(), textPane);
ReflectionHelper.setFieldContent(TextFieldSkin.class, this, "usePromptText", linesWrapper.usePromptText);
errorContainer = new ValidationPane<>(textField);
getChildren().addAll(linesWrapper.line, linesWrapper.focusedLine, linesWrapper.promptContainer, errorContainer);
registerChangeListener(textField.disableProperty(), obs -> linesWrapper.updateDisabled());
registerChangeListener(textField.focusColorProperty(), obs -> linesWrapper.updateFocusColor());
registerChangeListener(textField.unFocusColorProperty(), obs -> linesWrapper.updateUnfocusColor());
registerChangeListener(textField.disableAnimationProperty(), obs -> errorContainer.updateClip());
}