Java 类javafx.beans.property.SimpleSetProperty 实例源码

项目:MineIDE    文件:WizardStepBuilder.java   
@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;
}
项目:fx-gson    文件:SetPropertyTypeAdapter.java   
@NotNull
@Override
protected SetProperty<T> createProperty(ObservableSet<T> deserializedValue) {
    return new SimpleSetProperty<>(deserializedValue);
}
项目:fx-gson    文件:TestClassesWithProp.java   
WithSetProp(ObservableSet<CustomObject> value) {
    this.prop = new SimpleSetProperty<>(value);
}
项目:timezone-converter    文件:ZoneIdSelectionDialog.java   
@SuppressWarnings("unused")
public ZoneIdSelectionDialog() {
    zoneIdCheckboxes = newArrayList();
    pendingSelectedZoneIds = new SimpleSetProperty<>();
}
项目:PeerWasp    文件:PathItem.java   
public PathItem(Path path, boolean isFile, Set<UserPermission> userPermissions) {
    this.path = path;
    setIsFile(isFile);
    this.permissions = new SimpleSetProperty<UserPermission>(FXCollections.observableSet(userPermissions));
}