当前位置: 首页>>代码示例>>Java>>正文


Java CheckBoxTreeItem.setExpanded方法代码示例

本文整理汇总了Java中javafx.scene.control.CheckBoxTreeItem.setExpanded方法的典型用法代码示例。如果您正苦于以下问题:Java CheckBoxTreeItem.setExpanded方法的具体用法?Java CheckBoxTreeItem.setExpanded怎么用?Java CheckBoxTreeItem.setExpanded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.control.CheckBoxTreeItem的用法示例。


在下文中一共展示了CheckBoxTreeItem.setExpanded方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CheckBoxTreeViewSample

import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
public CheckBoxTreeViewSample() {
    final CheckBoxTreeItem<String> treeRoot = new CheckBoxTreeItem<String>("Root node");
    treeRoot.getChildren().addAll(Arrays.asList(new CheckBoxTreeItem<String>("Child Node 1"),
            new CheckBoxTreeItem<String>("Child Node 2"), new CheckBoxTreeItem<String>("Child Node 3")));

    treeRoot.getChildren().get(2).getChildren()
            .addAll(Arrays.asList(new CheckBoxTreeItem<String>("Child Node 4"), new CheckBoxTreeItem<String>("Child Node 5"),
                    new CheckBoxTreeItem<String>("Child Node 6"), new CheckBoxTreeItem<String>("Child Node 7"),
                    new TreeItem<String>("Child Node 8"), new CheckBoxTreeItem<String>("Child Node 9"),
                    new CheckBoxTreeItem<String>("Child Node 10"), new CheckBoxTreeItem<String>("Child Node 11"),
                    new CheckBoxTreeItem<String>("Child Node 12")));

    final TreeView treeView = new TreeView();
    treeView.setCellFactory(CheckBoxTreeCell.forTreeView());
    treeView.setShowRoot(true);
    treeView.setRoot(treeRoot);
    treeRoot.setExpanded(true);

    getChildren().add(treeView);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:21,代码来源:CheckBoxTreeViewSample.java

示例2: buildItem

import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
private CheckBoxTreeItem<String> buildItem(Relation node) {
    final CheckBoxTreeItem<String> item = new CheckBoxTreeItem<String>(node.getLabel());
    item.setExpanded(true);
    item.setIndependent(true);
    item.setSelected(!node.isFold());
    item.selectedProperty()
        .addListener((o, p, c) -> {
            node.setFold(!c);
        });
    node.getChildren()
        .stream()
        .filter(c -> c instanceof Relation)
        .map(c -> (Relation) c)
        .forEach(c -> {
            item.getChildren()
                .add(buildItem(c));
        });
    return item;
}
 
开发者ID:ChiralBehaviors,项目名称:Kramer,代码行数:20,代码来源:SchemaView.java

示例3: initialize

import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
/**
 * Native init method.
 * Create VUFS folders tree view
 * @param location
 * @param resources
 */
@Override
public void initialize(URL location, ResourceBundle resources) {
    //TODO: replace to getting elements from Repository
    CheckBoxTreeItem<String> root = new CheckBoxTreeItem<>("Root");
    root.setExpanded(true);
    CheckBoxTreeItem<String> folder1 = new CheckBoxTreeItem<>("Folder1");
    folder1.getChildren().addAll(
            new CheckBoxTreeItem<>("MyFoto"),
            new CheckBoxTreeItem<>("OtherFiles")
    );
    root.getChildren().addAll(
            folder1,
            new CheckBoxTreeItem<>("Documents"),
            new CheckBoxTreeItem<>("WorkFiles"),
            new CheckBoxTreeItem<>("Projects"));

    // Create the CheckTreeView with the data
    final CheckTreeView<String> checkTreeView = new CheckTreeView<>(root);
    checkTreeView.getCheckModel().getCheckedItems().addListener((ListChangeListener<TreeItem<String>>) c -> {
        System.out.println(checkTreeView.getCheckModel().getCheckedItems());
    });
    checkTreeView.setId("sync-tree-view");
    container.getChildren().add(checkTreeView);
}
 
开发者ID:StnetixDevTeam,项目名称:ariADDna,代码行数:31,代码来源:SyncSettingsController.java

示例4: addNewRepoFile

import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
private void addNewRepoFile(RepoFile repoFile, CheckBoxTreeItem<RepoFile> newItem, TreeItem<RepoFile> root) {
    Path pathToParent = repoFile.getFilePath().getParent();
    if (pathToParent != null) {
        // Check if the file should be added to an existing directory
        CheckBoxTreeItem<RepoFile> parentDirectory = null;
        for (TreeItem<RepoFile> directory : root.getChildren()) {
            if (!directory.equals(checkBox) && directory.getValue().toString().equals(pathToParent.toString())) {
                parentDirectory = (CheckBoxTreeItem<RepoFile>) directory;
                break;
            }
        }
        if (parentDirectory == null) {
            // Create a new directory and add it to the root
            DirectoryRepoFile parent = new DirectoryRepoFile(pathToParent, this.sessionModel.getCurrentRepoHelper());
            parent.setShowFullPath(true);
            parentDirectory = new CheckBoxTreeItem<>(parent);
            parentDirectory.setExpanded(true);
            root.getChildren().add(parentDirectory);
        }
        parentDirectory.getChildren().add(newItem);
    } else {
        root.getChildren().add(newItem);
    }
}
 
开发者ID:dmusican,项目名称:Elegit,代码行数:25,代码来源:WorkingTreePanelView.java

示例5: TreeViewSample

import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
public TreeViewSample() {
    String dir = "./src";
    final CheckBoxTreeItem<File> treeRoot = buildRoot(dir);

    treeView = new TreeView<File>();
    treeView.setCellFactory(CheckBoxTreeCell.<File> forTreeView());
    treeView.setShowRoot(true);
    treeView.setRoot(treeRoot);
    treeRoot.setExpanded(true);

    getChildren().add(treeView);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:13,代码来源:TreeViewSample.java

示例6: initTreeView

import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
private void initTreeView(){

        CheckBoxTreeItem<FileItem> root = new CheckBoxTreeItem<>( dataManager.getRoot());
        setTreeChildren(root);
        treeView = new CheckTreeView<>(root);
        treeViewPane.getChildren().add(treeView);
        root.setExpanded(true);
        treeView.setShowRoot(true);
        treeView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
        treeView.getCheckModel().getCheckedItems().addListener(this::onCheckListener);
        selected.forEach(item -> item.setSelected(true));

    }
 
开发者ID:StnetixDevTeam,项目名称:CloudRaid-DesktopApp,代码行数:14,代码来源:SyncManagerController.java

示例7: selectAndExpandTreeItem

import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
private void selectAndExpandTreeItem(CheckBoxTreeItem<ModifiedPath> item) {
    item.setSelected(true);
    item.setExpanded(true);
}
 
开发者ID:JordanMartinez,项目名称:JGitFX,代码行数:5,代码来源:SelectableFileViewer.java

示例8: initialize

import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
/**
 * Initializer for OutputController. Call constructor before initializing.
 * Initializes elements and loads settings.
 * @param url not in use
 * @param rb the given resource bundle
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    this.rb=rb;
    //type.getItems().addAll("ODBC","MySQL","PostgreSQL");
    for(DriverType driver : DriverType.values()) {
        type.getItems().add(driver.toString());
    }
    CheckBoxTreeItem<String> rootItem = new CheckBoxTreeItem<>(rb.getString("key.alloutputs"));
    rootItem.setExpanded(true);
    outputselection.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    outputselection.setCellFactory(CheckBoxTreeCell.<String>forTreeView());    
    rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.base")));
    rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.carboncountry")));
    rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.carbonsoil")));
    rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.fellingmatrix")));
    rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.fellingresidues")));
    rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.naturalmortality")));
    rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.thinningmatrix")));
    rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.thinningresidues")));
    rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.treecarbon")));
    rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.generalregions")));
    rootItem.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.generalspecies")));
    rootItem.selectedProperty().set(true);
    
    outputselection.setRoot(rootItem);
    CheckBoxTreeItem<String> rootItem2 = new CheckBoxTreeItem<>(rb.getString("key.alloutputs"));
    rootItem2.setExpanded(true);
    databaseTree.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    databaseTree.setCellFactory(CheckBoxTreeCell.<String>forTreeView());    
    rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.base")));
    rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.carboncountry")));
    rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.carbonsoil")));
    rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.deadwood")));
    rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.fellingmatrix")));
    rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.fellingresidues")));
    rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.naturalmortality")));
    rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.thinningmatrix")));
    rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.thinningresidues")));
    rootItem2.getChildren().add(new CheckBoxTreeItem<>(rb.getString("key.treecarbon")));
    rootItem2.selectedProperty().set(true);
    
    databaseTree.setRoot(rootItem2);
    rootItem.selectedProperty().set(true);
    update();
    chooser = new DirectoryChooser();
    chooser.setTitle(rb.getString("key.outputpath"));
}
 
开发者ID:EuropeanForestInstitute,项目名称:efiscen,代码行数:54,代码来源:OutputController.java

示例9: reset

import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
protected void reset() {
    CheckBoxTreeItem<String> root = new CheckBoxTreeItem<String>("Root");

    root.setExpanded(true);

    addLevel(root, DATA_ITEMS_DEPTH);

    treeView.setRoot(root);
    treeView.setShowRoot(true);
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:11,代码来源:CheckBoxTreeApp.java


注:本文中的javafx.scene.control.CheckBoxTreeItem.setExpanded方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。