javafx.scene.control.ListView.itemsProperty()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(184)

本文整理了Java中javafx.scene.control.ListView.itemsProperty()方法的一些代码示例,展示了ListView.itemsProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListView.itemsProperty()方法的具体详情如下:
包路径:javafx.scene.control.ListView
类名称:ListView
方法名:itemsProperty

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());
}

相关文章