}
};
textField.setId("input-text-field");
textField.getStyleClass().setAll(control.getStyleClass());
control.getStyleClass().addListener(InputFieldStyleClassListener = new InvalidationListener() {
@Override public void invalidated(Observable observable) {
textField.getStyleClass().setAll(control.getStyleClass());
}
});
// // Align the text to the right
// textField.setAlignment(Pos.BASELINE_RIGHT);
textField.promptTextProperty().bind(control.promptTextProperty());
textField.editableProperty().bind(control.editableProperty());
textField.prefColumnCountProperty().bind(control.prefColumnCountProperty());
// Whenever the text of the textField changes, we may need to
// update the value.
textField.textProperty().addListener(new InvalidationListener() {
@Override public void invalidated(Observable observable) {
updateValue();
}
});
// Right now there is some funny business regarding focus in JavaFX. So
// we will just make sure the TextField gets focus whenever somebody tries
// to give it to the InputField. This isn't right, but we need to fix
// this in JavaFX, I don't think I can hack around it
textField.setFocusTraversable(false);
control.focusedProperty().addListener(InputFieldFocusListener = new InvalidationListener() {
@Override public void invalidated(Observable observable) {
textField.handleFocus(control.isFocused());
}
});