@Override public String getValue() { return delegate.getValue(); }
public String getCssUrl() { return cssUrlProperty.getValue(); }
@Override public final Optional<String> getAsString(String key) { final StringProperty prop = (StringProperty) properties.get(key); if (prop == null) { return Optional.empty(); } else { return Optional.ofNullable(prop.getValue()); } }
public final String getGlyphStyle() { return glyphStyleProperty().getValue(); }
public class FXMLsecondController { private StringProperty text ; @FXML private void handleButtonAction(ActionEvent event) { System.out.println(text.getValue()); } public void initialize() { text = new SimpleStringProperty(this, "text"); } public StringProperty textProperty() { return text ; } public String getText() { return text.get(); } }
/** * Creates a new {@link StringField} with the given property. * * @param binding * The property from the model to be bound with. * * @return Returns a new {@link StringField}. */ public static StringField ofStringType(StringProperty binding) { return new StringField(new SimpleStringProperty(binding.getValue()), new SimpleStringProperty(binding.getValue())).bind(binding); }
/** * Creates a new {@link PasswordField} with the given property. * * @param binding * The property from the model to be bound with. * * @return Returns a new {@link PasswordField}. */ public static PasswordField ofPasswordType(StringProperty binding) { return new PasswordField(new SimpleStringProperty(binding.getValue()), new SimpleStringProperty(binding.getValue())).bind(binding); }
/** * Creates a new Note domain object from the edited JavaFX properties. * * @return Note */ public Note getNote() { final Note note = new Note(id); note.setDateTime(LocalDateTime.of(date.get(), time.get())); note.setComment(comment.getValue().trim()); return note; } }
/** * The constructor of {@code StringField}. * * @param valueProperty * The property that is used to store the current valid value * of the field. * @param persistentValueProperty * The property that is used to store the latest persisted * value of the field. */ protected StringField(SimpleStringProperty valueProperty, SimpleStringProperty persistentValueProperty) { super(valueProperty, persistentValueProperty); stringConverter = new AbstractStringConverter<String>() { @Override public String fromString(String string) { return string; } }; renderer = new SimpleTextControl(); userInput.set(stringConverter.toString(value.getValue())); }
@Override public boolean doAdd(final StringProperty text, final Wave wave) { this.todoList.addTodo(Todo.of().text(text.getValue()).done(false)); return true; }
/** * {@inheritDoc} */ @Override public void initializeParts() { super.initializeParts(); getStyleClass().add("simple-checkbox-control"); fieldLabel = new Label(field.labelProperty().getValue()); box = new VBox(); createCheckboxes(); }
/** * {@inheritDoc} */ @Override public void initializeParts() { super.initializeParts(); getStyleClass().add("simple-radio-control"); fieldLabel = new Label(field.labelProperty().getValue()); toggleGroup = new ToggleGroup(); box = new VBox(); createRadioButtons(); }
/** * {@inheritDoc} */ @Override public void initializeParts() { super.initializeParts(); getStyleClass().add("simple-boolean-control"); fieldLabel = new Label(field.labelProperty().getValue()); checkBox = new CheckBox(); container = new VBox(); checkBox.setSelected(field.getValue()); }
/** * {@inheritDoc} */ @Override public void initializeParts() { super.initializeParts(); getStyleClass().add("simple-password-control"); stack = new StackPane(); editableField = new javafx.scene.control.PasswordField(); editableField.setText(field.getValue()); readOnlyLabel = new Label(obfuscate(field.getValue())); fieldLabel = new Label(field.labelProperty().getValue()); editableField.setPromptText(field.placeholderProperty().getValue()); }
/** * {@inheritDoc} */ @Override public void initializeParts() { super.initializeParts(); getStyleClass().add("simple-text-control"); stack = new StackPane(); editableField = new TextField(field.getValue()); editableArea = new TextArea(field.getValue()); readOnlyLabel = new Label(field.getValue()); fieldLabel = new Label(field.labelProperty().getValue()); editableField.setPromptText(field.placeholderProperty().getValue()); }
/** * Action handler for viewing the selected HRM. It starts the ExerciseViewer sub-application, which * parses the HRM file and displays the data. */ @FXML private void onViewHrmFile(final ActionEvent event) { final String hrmFile = StringUtils.getTrimmedTextOrNull(exerciseViewModel.hrmFile.getValue()); if (hrmFile != null) { final SportType selectedSportType = exerciseViewModel.sportType.get(); final SpeedMode speedMode = selectedSportType == null ? document.getOptions().getPreferredSpeedMode() : selectedSportType.getSpeedMode(); dialogProvider.prExerciseViewer.get().showExercise(hrmFile, context.getPrimaryStage(), true, speedMode); } }
/** * Creates a new SportType domain object from the edited JavaFX properties. * * @return SportType */ public SportType getSportType() { final SportType sportType = new SportType(id); sportType.setName(name.getValue().trim()); sportType.setRecordDistance(recordDistance.getValue()); sportType.setSpeedMode(speedMode.getValue().getSpeedMode()); sportType.setIcon(StringUtils.getTrimmedTextOrNull(icon.getValue())); sportType.setColor(color.getValue()); sportSubtypes.forEach(sportSubType -> sportType.getSportSubTypeList().set(sportSubType)); equipments.forEach(equipment -> sportType.getEquipmentList().set(equipment)); return sportType; } }
/** * {@inheritDoc} */ @Override public void initializeParts() { super.initializeParts(); getStyleClass().add("simple-select-control"); fieldLabel = new Label(field.labelProperty().getValue()); readOnlyLabel = new Label(); stack = new StackPane(); comboBox = new ComboBox<>(field.getItems()); comboBox.getSelectionModel().select(field.getItems().indexOf(field.getSelection())); }
/** * Creates a new Weight domain object from the edited JavaFX properties. * * @return Weight */ public Weight getWeight() { final Weight weight = new Weight(id); weight.setDateTime(LocalDateTime.of(date.get(), time.get())); weight.setValue(value.get()); // ignore empty comment for optional inputs weight.setComment(StringUtils.getTrimmedTextOrNull(comment.getValue())); // convert weight value when english unit system is enabled if (unitSystem == FormatUtils.UnitSystem.ENGLISH) { weight.setValue((float) ConvertUtils.convertLbs2Kilogram(weight.getValue())); } return weight; } }
/** * {@inheritDoc} */ @Override public void initializeParts() { super.initializeParts(); getStyleClass().add("simple-listview-control"); fieldLabel = new Label(field.labelProperty().getValue()); listView.setItems(field.getItems()); listView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); for (int i = 0; i < field.getItems().size(); i++) { if (field.getSelection().contains(field.getItems().get(i))) { listView.getSelectionModel().select(i); } else { listView.getSelectionModel().clearSelection(i); } } }