@SuppressWarnings("unchecked") public WizardStepBuilder addFileChoosers(final String fieldName, final String fileChooseLabel, final String startDir, final FileChooser.ExtensionFilter... filters) { final WizardStep current = this.current; final HBox box = new HBox(); final JFXButton button = new JFXButton(fileChooseLabel); button.setStyle("-fx-text-fill: BLACK;-fx-font-size: 18px;-fx-opacity: 0.7;"); final FileChooser fileChooser = new FileChooser(); fileChooser.setTitle(fileChooseLabel); fileChooser.setInitialDirectory(new File(startDir)); fileChooser.getExtensionFilters().addAll(filters); this.current.getData().put(fieldName, new SimpleSetProperty<File>()); button.setOnAction(e -> current.getData().get(fieldName) .setValue(fileChooser.showOpenMultipleDialog(MineIDE.primaryStage))); final Label label = new Label(fieldName); GridPane.setHalignment(label, HPos.RIGHT); GridPane.setHalignment(button, HPos.LEFT); this.current.add(label, 0, this.current.getData().size() - 1); final JFXTextField text = new JFXTextField(); text.setEditable(false); ((SimpleSetProperty<File>) this.current.getData().get(fieldName)) .addListener((SetChangeListener<File>) change -> { text.setText(""); change.getSet().forEach(file -> text.appendText(file.getAbsolutePath() + ", ")); text.setText(text.getText().substring(0, text.getText().length() - 2)); }); box.getChildren().addAll(text, button); this.current.add(box, 1, this.current.getData().size() - 1); return this; }
@NotNull @Override protected SetProperty<T> createProperty(ObservableSet<T> deserializedValue) { return new SimpleSetProperty<>(deserializedValue); }
WithSetProp(ObservableSet<CustomObject> value) { this.prop = new SimpleSetProperty<>(value); }
@SuppressWarnings("unused") public ZoneIdSelectionDialog() { zoneIdCheckboxes = newArrayList(); pendingSelectedZoneIds = new SimpleSetProperty<>(); }
public PathItem(Path path, boolean isFile, Set<UserPermission> userPermissions) { this.path = path; setIsFile(isFile); this.permissions = new SimpleSetProperty<UserPermission>(FXCollections.observableSet(userPermissions)); }