本文整理了Java中javafx.scene.control.TreeView.setShowRoot()
方法的一些代码示例,展示了TreeView.setShowRoot()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TreeView.setShowRoot()
方法的具体详情如下:
包路径:javafx.scene.control.TreeView
类名称:TreeView
方法名:setShowRoot
暂无
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.code.editor.fx
private TreeView<OutlineItem> createView() {
TreeView<OutlineItem> outlineView = new TreeView<>();
outlineView.setShowRoot(false);
outlineView.setCellFactory(this::createCell);
return outlineView;
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.code.editor.fx
private TreeView<OutlineItem> createView() {
TreeView<OutlineItem> outlineView = new TreeView<>();
outlineView.setShowRoot(false);
outlineView.setCellFactory(this::createCell);
return outlineView;
}
代码示例来源:origin: org.copper-engine/copper-monitoring-client
treeView.setShowRoot(false);
treeView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<TreeItem<DisplayableNode>>() {
@Override
代码示例来源:origin: org.copper-engine/copper-monitoring-client
public void refresh(List<WorkflowVersion> newItems) {
treeView.setShowRoot(false);
TreeItem<DisplayWorkflowClassesModel> rootItem = new TreeItem<DisplayWorkflowClassesModel>();
rootItem.getChildren().addAll(groupToTreeItem(newItems));
treeView.setRoot(rootItem);
treeView.setCellFactory(new Callback<TreeView<DisplayWorkflowClassesModel>, TreeCell<DisplayWorkflowClassesModel>>() {
@Override
public TreeCell<DisplayWorkflowClassesModel> call(TreeView<DisplayWorkflowClassesModel> listView) {
return new TextFieldTreeCell<DisplayWorkflowClassesModel>(new StringConverter<DisplayWorkflowClassesModel>() {
@Override
public DisplayWorkflowClassesModel fromString(String string) {
return null;
}
@Override
public String toString(DisplayWorkflowClassesModel object) {
return object.displayName;
}
});
}
});
rootItem.setExpanded(true);
}
代码示例来源:origin: eu.agrosense.client/util-javafx
@Override
public void addNotify() {
super.addNotify();
em = ExplorerManager.find(this);
if (em != null) {
TreeItem<Node> rootItem = createFromNode(em.getRootContext());
rootItem.setExpanded(true);
final TreeView<Node> treeView = new TreeView<>(rootItem);
treeView.setEditable(true);
treeView.setShowRoot(rootVisible);
treeView.setCellFactory(
new Callback<TreeView<Node>, TreeCell<Node>>() {
@Override
public TreeCell<Node> call(final TreeView<Node> p) {
return new TextFieldTreeCellImpl();
}
});
Platform.runLater(new Runnable() {
@Override
public void run() {
StackPane root = new StackPane();
root.getChildren().add(treeView);
Scene scene = new Scene(root, 300, 250);
setScene(scene);
}
});
}
}
// for custom cell editor with edit capabilities:
代码示例来源:origin: nl.cloudfarming.client/calendar-api
treeView.setShowRoot(false);
treeView.getStyleClass().add("node-list");
treeViewPane.setCenter(treeView);
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
/**
* Create a new skin
*
* @param control
* the control
* @param selectedItems
* the selected items
*/
public ResourceTreeViewSkin(ResourceTreeView control,
ObservableList<ResourceItem> selectedItems) {
super(control);
this.selectedItems = selectedItems;
this.tree = new TreeView<>();
this.tree.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
this.tree.setCellFactory((v) -> new SimpleTreeCell<@NonNull ResourceItem>(
ResourceTreeViewSkin::handleDirLabel, this::handleStyleclass));
this.tree.setShowRoot(false);
this.tree.getSelectionModel().getSelectedItems()
.addListener(this::handleSelectionChange);
this.tree.setOnMouseClicked( e -> {
if( e.getClickCount() > 1 ) {
openSelectedResources();
}
});
getChildren().add(this.tree);
control.rootDirectoriesProperty().addListener(this::rebuildTable);
control.iconSizeProperty().addListener(this::rebuildTable);
rebuildTable(control.rootDirectoriesProperty());
}
代码示例来源:origin: sc.fiji/OMEVisual
testTree.setShowRoot(false);
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
/**
* Create a new skin
*
* @param control
* the control
* @param selectedItems
* the selected items
*/
public DirectoryTreeViewSkin(DirectoryTreeView control,
ObservableList<DirItem> selectedItems) {
super(control);
this.selectedItems = selectedItems;
this.tree = new TreeView<>();
this.tree.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
this.tree.setCellFactory((v) -> new SimpleTreeCell<@NonNull DirItem>(
DirectoryTreeViewSkin::handleDirLabel, this::handleStyleclass));
this.tree.setShowRoot(false);
this.tree.getSelectionModel().getSelectedItems()
.addListener(this::handleSelectionChange);
this.tree.setOnMouseClicked( e -> {
if( e.getClickCount() > 1 ) {
openSelectedResources();
}
});
getChildren().add(this.tree);
control.rootDirectoriesProperty().addListener(this::rebuildTable);
control.iconSizeProperty().addListener(this::rebuildTable);
rebuildTable(control.rootDirectoriesProperty());
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
/**
* Create a new skin
*
* @param control
* the control
* @param selectedItems
* the selected items
*/
public DirectoryTreeViewSkin(DirectoryTreeView control,
ObservableList<DirItem> selectedItems) {
super(control);
this.selectedItems = selectedItems;
this.tree = new TreeView<>();
this.tree.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
this.tree.setCellFactory((v) -> new SimpleTreeCell<@NonNull DirItem>(
DirectoryTreeViewSkin::handleDirLabel, this::handleStyleclass));
this.tree.setShowRoot(false);
this.tree.getSelectionModel().getSelectedItems()
.addListener(this::handleSelectionChange);
this.tree.setOnMouseClicked( e -> {
if( e.getClickCount() > 1 ) {
openSelectedResources();
}
});
getChildren().add(this.tree);
control.rootDirectoriesProperty().addListener(this::rebuildTable);
control.iconSizeProperty().addListener(this::rebuildTable);
rebuildTable(control.rootDirectoriesProperty());
}
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
/**
* Create a new skin
*
* @param control
* the control
* @param selectedItems
* the selected items
*/
public ResourceTreeViewSkin(ResourceTreeView control,
ObservableList<ResourceItem> selectedItems) {
super(control);
this.selectedItems = selectedItems;
this.tree = new TreeView<>();
this.tree.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
this.tree.setCellFactory((v) -> new SimpleTreeCell<@NonNull ResourceItem>(
ResourceTreeViewSkin::handleDirLabel, this::handleStyleclass));
this.tree.setShowRoot(false);
this.tree.getSelectionModel().getSelectedItems()
.addListener(this::handleSelectionChange);
this.tree.setOnMouseClicked( e -> {
if( e.getClickCount() > 1 ) {
openSelectedResources();
}
});
getChildren().add(this.tree);
control.rootDirectoriesProperty().addListener(this::rebuildTable);
control.iconSizeProperty().addListener(this::rebuildTable);
rebuildTable(control.rootDirectoriesProperty());
}
代码示例来源:origin: com.powsybl/powsybl-gse-afs-ext-base
contingencyTree.setShowRoot(false);
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
treeView.setShowRoot(false);
代码示例来源:origin: com.aquafx-project/aquafx
treeView.setShowRoot(true);
treeView.setPrefSize(width, 300);
treeView.getSelectionModel().selectRange(5, 8);
内容来源于网络,如有侵权,请联系作者删除!