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

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

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

ListView.setPlaceholder介绍

暂无

代码示例

代码示例来源:origin: pmd/pmd

@Override
protected void beforeParentInit() {
  xpathAttributesListView.setPlaceholder(new Label("No available attributes"));
  EventStreams.valuesOf(scopeHierarchyTreeView.getSelectionModel().selectedItemProperty())
        .filter(Objects::nonNull)
        .map(TreeItem::getValue)
        .filterMap(o -> o instanceof NameDeclaration, o -> (NameDeclaration) o)
        .filter(nd -> !Objects.equals(nd.getNode(), selectedNode))
        .subscribe(declaration -> Platform.runLater(() -> parent.onNodeItemSelected(declaration.getNode(), true)));
  scopeHierarchyTreeView.setCellFactory(view -> new ScopeHierarchyTreeCell());
  hideCommonAttributesProperty()
    .values()
    .distinct()
    .subscribe(show -> displayAttributes(selectedNode));
}

代码示例来源:origin: org.controlsfx/controlsfx

public TaskProgressViewSkin(TaskProgressView<T> monitor) {
  super(monitor);
  BorderPane borderPane = new BorderPane();
  borderPane.getStyleClass().add("box");
  // list view
  ListView<T> listView = new ListView<>();
  listView.setPrefSize(500, 400);
  listView.setPlaceholder(new Label("No tasks running"));
  listView.setCellFactory(param -> new TaskCell());
  listView.setFocusTraversable(false);
  Bindings.bindContent(listView.getItems(), monitor.getTasks());
  borderPane.setCenter(listView);
  getChildren().add(listView);
}

相关文章