@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;
}
java类javafx.beans.property.SimpleSetProperty的实例源码
WizardStepBuilder.java 文件源码
项目:MineIDE
阅读 28
收藏 0
点赞 0
评论 0
SetPropertyTypeAdapter.java 文件源码
项目:fx-gson
阅读 33
收藏 0
点赞 0
评论 0
@NotNull
@Override
protected SetProperty<T> createProperty(ObservableSet<T> deserializedValue) {
return new SimpleSetProperty<>(deserializedValue);
}
TestClassesWithProp.java 文件源码
项目:fx-gson
阅读 27
收藏 0
点赞 0
评论 0
WithSetProp(ObservableSet<CustomObject> value) {
this.prop = new SimpleSetProperty<>(value);
}
ZoneIdSelectionDialog.java 文件源码
项目:timezone-converter
阅读 39
收藏 0
点赞 0
评论 0
@SuppressWarnings("unused")
public ZoneIdSelectionDialog() {
zoneIdCheckboxes = newArrayList();
pendingSelectedZoneIds = new SimpleSetProperty<>();
}
PathItem.java 文件源码
项目:PeerWasp
阅读 28
收藏 0
点赞 0
评论 0
public PathItem(Path path, boolean isFile, Set<UserPermission> userPermissions) {
this.path = path;
setIsFile(isFile);
this.permissions = new SimpleSetProperty<UserPermission>(FXCollections.observableSet(userPermissions));
}