public JFXTextFieldSkinAndroid(T textField) { super(textField); textPane = (Pane) this.getChildren().get(0); // get parent fields reflectionFieldConsumer("textNode", field -> textNode = (Node) field.get(this)); reflectionFieldConsumer("textTranslateX", field -> textTranslateX = (DoubleProperty) field.get(this)); linesWrapper = new PromptLinesWrapper<T>( textField, super.promptTextFill, textField.textProperty(), textField.promptTextProperty(), () -> promptText); linesWrapper.init(() -> createPromptNode(), textPane); reflectionFieldConsumer("usePromptText", field -> field.set(this, linesWrapper.usePromptText)); errorContainer = new ValidationPane<>(textField); getChildren().addAll(linesWrapper.line, linesWrapper.focusedLine, linesWrapper.promptContainer, errorContainer); registerChangeListener(textField.disableProperty(), "DISABLE_NODE"); registerChangeListener(textField.focusColorProperty(), "FOCUS_COLOR"); registerChangeListener(textField.unFocusColorProperty(), "UNFOCUS_COLOR"); registerChangeListener(textField.disableAnimationProperty(), "DISABLE_ANIMATION"); }
public JFXTextFieldSkin(T textField) { super(textField); textPane = (Pane) this.getChildren().get(0); // get parent fields reflectionFieldConsumer("textNode", field -> textNode = (Node) field.get(this)); reflectionFieldConsumer("textTranslateX", field -> textTranslateX = (DoubleProperty) field.get(this)); linesWrapper = new PromptLinesWrapper<T>( textField, super.promptTextFill, textField.textProperty(), textField.promptTextProperty(), () -> promptText); linesWrapper.init(() -> createPromptNode(), textPane); reflectionFieldConsumer("usePromptText", field -> field.set(this, linesWrapper.usePromptText)); errorContainer = new ValidationPane<>(textField); getChildren().addAll(linesWrapper.line, linesWrapper.focusedLine, linesWrapper.promptContainer, errorContainer); registerChangeListener(textField.disableProperty(), "DISABLE_NODE"); registerChangeListener(textField.focusColorProperty(), "FOCUS_COLOR"); registerChangeListener(textField.unFocusColorProperty(), "UNFOCUS_COLOR"); registerChangeListener(textField.disableAnimationProperty(), "DISABLE_ANIMATION"); }
@Override public Node createValueVisualisation() { TextField textField = new TextField(); textField.textProperty().bindBidirectional(observableAttributeValue); textField.disableProperty().bind(readOnly); return textField; } }
@Override public Node createValueVisualisation() { TextField textField = new TextField(); TypedTextFieldHelper.setupBigDecimalTextField(textField,decimalFormatPattern); DecimalFormat decimalFormat = new DecimalFormat(decimalFormatPattern); decimalFormat.setParseBigDecimal(true); textField.textProperty().bindBidirectional(observableAttributeValue, new BigDecimalStringConverter(decimalFormat)); textField.disableProperty().bind(readOnly); return textField; }
@Override public Node createValueVisualisation() { TextField textField = new TextField(); TypedTextFieldHelper.setupIntegerTextField(textField); textField.textProperty().bindBidirectional(observableAttributeValue, new IntegerStringConverter()); textField.disableProperty().bind(readOnly); return textField; } }
@Override public Node createValueVisualisation() { TextField textField = new TextField(); TypedTextFieldHelper.setupLongTextField(textField); textField.textProperty().bindBidirectional(observableAttributeValue, new LongStringConverter()); textField.disableProperty().bind(readOnly); return textField; } }
@Override public Node createValueVisualisation() { TextField textField = new TextField(); TypedTextFieldHelper.setupShortTextField(textField); textField.textProperty().bindBidirectional(observableAttributeValue, new ShortStringConverter()); textField.disableProperty().bind(readOnly); return textField; } }
@Override public Node createValueVisualisation() { TextField textField = new TextField(); TypedTextFieldHelper.setupURITextField(textField); textField.textProperty().bindBidirectional(observableAttributeValue, new URIStringConverter()); textField.disableProperty().bind(readOnly); return textField; } }
@Override public Node createValueVisualisation() { TextField textField = new TextField(); TypedTextFieldHelper.setupDoubleTextField(textField); textField.textProperty().bindBidirectional(observableAttributeValue, new DoubleStringConverter()); textField.disableProperty().bind(readOnly); return textField; } }
@Override // This method is called by the FXMLLoader when initialization is complete public void initialize(URL fxmlFileLocation, ResourceBundle resources) { assert password != null : "fx:id=\"password\" was not injected: check your FXML file 'Login.fxml'."; assert serverAddress != null : "fx:id=\"serverAddress\" was not injected: check your FXML file 'Login.fxml'."; assert serverRadioButton != null : "fx:id=\"serverRadioButton\" was not injected: check your FXML file 'Login.fxml'."; assert startButton != null : "fx:id=\"startButton\" was not injected: check your FXML file 'Login.fxml'."; assert user != null : "fx:id=\"user\" was not injected: check your FXML file 'Login.fxml'."; ToggleGroup groupConnection = new ToggleGroup(); serverRadioButton.setSelected(true); serverRadioButton.setToggleGroup(groupConnection); user.disableProperty().bind(serverRadioButton.selectedProperty().not()); password.disableProperty().bind(serverRadioButton.selectedProperty().not()); serverAddress.disableProperty().bind(serverRadioButton.selectedProperty().not()); startButton.disableProperty().bind(serverAddress.textProperty().isEqualTo("")); startButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { try { if (serverRadioButton.isSelected()) { cleanup(); mainFactory.setHttpGuiCopperDataProvider(serverAddress.getText(), user.getText(), password.getText()); } } catch (Exception e) { throw new RuntimeException(e); } } }); serverAddress.textProperty().bindBidirectional(settingsModelSingleton.lastConnectedServer); }
tfDistance.disableProperty().bind(Bindings.or( rbAutoCalcDistance.selectedProperty(), exerciseViewModel.sportTypeRecordDistance.not())); tfAvgSpeed.disableProperty().bind(Bindings.or( rbAutoCalcAvgSpeed.selectedProperty(), exerciseViewModel.sportTypeRecordDistance.not())); tfDuration.disableProperty().bind(Bindings.and( rbAutoCalcDuration.selectedProperty(), exerciseViewModel.sportTypeRecordDistance));
filterField.disableProperty().bind(tableView.disabledProperty().or(tableView.itemsProperty().isNull())); filterField.setMinWidth(50);
newValueTextField.disableProperty().bind(keyField.textProperty().isEmpty().or(validKey.not())); newValueTextField.textProperty().addListener((observable, oldValue, newValue1) -> { if (!Strings.isNullOrEmpty(keyField.getText())){
textField.disableProperty().bind(showButton.disabledProperty());
@Override public Node createValueVisualisation() { HBox hBox = new HBox(3); hBox.setAlignment(Pos.CENTER_LEFT); Label label = new Label(); label.textProperty().bindBidirectional(observableAttributeValue, new DurationStringConverter()); ComboBox<ChronoUnit> comboBox = new ComboBox<>(); comboBox.setEditable(false); comboBox.getItems().addAll(ChronoUnit.NANOS, ChronoUnit.MICROS, ChronoUnit.MILLIS, ChronoUnit.SECONDS, ChronoUnit.MINUTES, ChronoUnit.HOURS, ChronoUnit.HALF_DAYS, ChronoUnit.DAYS); TextField textField = new TextField(); TypedTextFieldHelper.setupLongTextField(textField); textField.disableProperty().bind(comboBox.valueProperty().isNull()); HBox.setHgrow(textField, Priority.ALWAYS); // boundTo.addListener((observable, oldValue, newValue) -> { // if(newValue == null || !newValue.equals(oldValue)) // setFields(newValue, textField, comboBox); // }); comboBox.valueProperty().addListener((observable, oldValue, newValue) -> setDuration(observableAttributeValue, textField, comboBox)); textField.textProperty().addListener((observable, oldValue, newValue) -> setDuration(observableAttributeValue, textField, comboBox)); hBox.getChildren().addAll(label, comboBox, textField); hBox.disableProperty().bind(readOnly); return hBox; }
public JFXTextFieldSkin(T textField) { super(textField); textPane = (Pane) this.getChildren().get(0); // 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()); }