本文整理了Java中javafx.scene.control.ListView.itemsProperty()
方法的一些代码示例,展示了ListView.itemsProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListView.itemsProperty()
方法的具体详情如下:
包路径:javafx.scene.control.ListView
类名称:ListView
方法名:itemsProperty
暂无
代码示例来源:origin: pmd/pmd
@Override
public void initialize(URL location, ResourceBundle resources) {
BooleanBinding noSelection = fileListView.getSelectionModel().selectedItemProperty().isNull();
removeFileButton.disableProperty().bind(noSelection);
moveItemUpButton.disableProperty().bind(noSelection.or(fileListView.getSelectionModel().selectedIndexProperty().isEqualTo(0)));
// we can't just map the val because we need an ObservableNumberValue
IntegerBinding lastIndexBinding = Bindings.createIntegerBinding(() -> fileListView.getItems().size() - 1,
Val.wrap(fileListView.itemsProperty()).flatMap(LiveList::sizeOf));
moveItemDownButton.disableProperty().bind(noSelection.or(fileListView.getSelectionModel().selectedIndexProperty().isEqualTo(lastIndexBinding)));
fileListView.setCellFactory(DesignerUtil.simpleListCellFactory(File::getName, File::getAbsolutePath));
selectFilesButton.setOnAction(e -> onSelectFileClicked());
removeFileButton.setOnAction(e -> onRemoveFileClicked());
moveItemUpButton.setOnAction(e -> moveUp());
moveItemDownButton.setOnAction(e -> moveDown());
}
代码示例来源:origin: Tristan971/Lyrebird
@Override
public void initialize() {
super.initialize();
listView.itemsProperty().bind(new ReadOnlyListWrapper<>(timelineBase.loadedTweets()));
}
代码示例来源:origin: Tristan971/Lyrebird
public void setPal(final User pal) {
LOG.debug("Messages for [{}] loaded!", pal.getScreenName());
this.currentPal.setValue(pal);
listView.itemsProperty().bind(new ReadOnlyListWrapper<>(directMessages.directMessages().get(pal)));
}
代码示例来源:origin: Tristan971/Lyrebird
@Override
public void initialize() {
super.initialize();
LOG.debug("Loading credits...");
listView.itemsProperty().bind(new ReadOnlyListWrapper<>(creditsService.creditedWorks()));
bindButtonToOpenHrefEnvProperty(licenseButton, "credits.license");
bindButtonToOpenHrefEnvProperty(sourceCodeButton, "credits.sourceCode");
bindButtonToOpenHrefEnvProperty(knownIssuesButton, "credits.knownIssues");
displayApplicationAuthor();
}
代码示例来源:origin: org.controlsfx/controlsfx
private void updateButtons() {
moveToTarget.getStyleClass().add("move-to-target-button");
moveToTargetAll.getStyleClass().add("move-to-target-all-button");
moveToSource.getStyleClass().add("move-to-source-button");
moveToSourceAll.getStyleClass().add("move-to-source-all-button");
moveToTarget.setMaxWidth(Double.MAX_VALUE);
moveToTargetAll.setMaxWidth(Double.MAX_VALUE);
moveToSource.setMaxWidth(Double.MAX_VALUE);
moveToSourceAll.setMaxWidth(Double.MAX_VALUE);
getSourceListView().itemsProperty().addListener(
it -> bindMoveAllButtonsToDataModel());
getTargetListView().itemsProperty().addListener(
it -> bindMoveAllButtonsToDataModel());
getSourceListView().selectionModelProperty().addListener(
it -> bindMoveButtonsToSelectionModel());
getTargetListView().selectionModelProperty().addListener(
it -> bindMoveButtonsToSelectionModel());
bindMoveButtonsToSelectionModel();
bindMoveAllButtonsToDataModel();
moveToTarget.setOnAction(evt -> moveToTarget());
moveToTargetAll.setOnAction(evt -> moveToTargetAll());
moveToSource.setOnAction(evt -> moveToSource());
moveToSourceAll.setOnAction(evt -> moveToSourceAll());
}
内容来源于网络,如有侵权,请联系作者删除!