• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CheckBoxTreeItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: selectTreeItemCheckBoxSelectedSelected

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
@Test public void selectTreeItemCheckBoxSelectedSelected() {
    TreeView<?> treeViewNode = (TreeView<?>) getPrimaryStage().getScene().getRoot().lookup(".tree-view");
    CheckBoxTreeItem<?> treeItem = (CheckBoxTreeItem<?>) treeViewNode.getTreeItem(2);
    treeItem.setSelected(true);
    JSONObject o = new JSONObject();
    o.put("select", "/Root node/Child Node 2");
    IJavaFXElement item = treeView.findElementByCssSelector(".::select-by-properties('" + o.toString() + "')");
    IJavaFXElement cb = item.findElementByCssSelector(".::editor");
    cb.marathon_select("Child Node 2:checked");
    new Wait("Wait for tree item check box to be selected") {
        @Override public boolean until() {
            String selected = cb.getAttribute("selected");
            return selected.equals("true");
        }
    };
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:17,代码来源:JavaFXTreeViewCheckBoxTreeCellElementTest.java


示例2: selectTreeItemCheckBoxSelectedNotSelected

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
@Test public void selectTreeItemCheckBoxSelectedNotSelected() {
    TreeView<?> treeViewNode = (TreeView<?>) getPrimaryStage().getScene().getRoot().lookup(".tree-view");
    CheckBoxTreeItem<?> treeItem = (CheckBoxTreeItem<?>) treeViewNode.getTreeItem(2);
    treeItem.setSelected(true);
    JSONObject o = new JSONObject();
    o.put("select", "/Root node/Child Node 2");
    IJavaFXElement item = treeView.findElementByCssSelector(".::select-by-properties('" + o.toString() + "')");
    IJavaFXElement cb = item.findElementByCssSelector(".::editor");
    cb.marathon_select("Child Node 2:unchecked");
    new Wait("Wait for tree item check box to be deselected") {
        @Override public boolean until() {
            String selected = cb.getAttribute("selected");
            return selected.equals("false");
        }
    };
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:17,代码来源:JavaFXTreeViewCheckBoxTreeCellElementTest.java


示例3: 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


示例4: select

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
@Test public void select() {
    TreeView<?> treeView = (TreeView<?>) getPrimaryStage().getScene().getRoot().lookup(".tree-view");
    LoggingRecorder lr = new LoggingRecorder();
    Platform.runLater(new Runnable() {
        @Override public void run() {
            Point2D point = getPoint(treeView, 1);
            RFXTreeView rfxListView = new RFXTreeView(treeView, null, point, lr);
            rfxListView.focusGained(rfxListView);
            CheckBoxTreeItem<?> treeItem = (CheckBoxTreeItem<?>) treeView.getTreeItem(1);
            treeItem.setSelected(true);
            rfxListView.focusLost(rfxListView);
        }
    });
    List<Recording> recordings = lr.waitAndGetRecordings(1);
    Recording recording = recordings.get(0);
    AssertJUnit.assertEquals("recordSelect", recording.getCall());
    AssertJUnit.assertEquals("Child Node 1:checked", recording.getParameters()[0]);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:RFXTreeViewCheckBoxTreeCellTest.java


示例5: selectSelectedTreeItemCheckBox

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
@Test public void selectSelectedTreeItemCheckBox() {
    TreeView<?> treeView = (TreeView<?>) getPrimaryStage().getScene().getRoot().lookup(".tree-view");
    LoggingRecorder lr = new LoggingRecorder();
    Platform.runLater(new Runnable() {
        @Override public void run() {
            Point2D point = getPoint(treeView, 1);
            RFXTreeView rfxListView = new RFXTreeView(treeView, null, point, lr);
            CheckBoxTreeItem<?> treeItem = (CheckBoxTreeItem<?>) treeView.getTreeItem(1);
            treeItem.setSelected(true);
            rfxListView.focusGained(rfxListView);
            treeItem.setSelected(false);
            rfxListView.focusLost(rfxListView);
        }
    });
    List<Recording> recordings = lr.waitAndGetRecordings(1);
    Recording recording = recordings.get(0);
    AssertJUnit.assertEquals("recordSelect", recording.getCall());
    AssertJUnit.assertEquals("Child Node 1:unchecked", recording.getParameters()[0]);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:20,代码来源:RFXTreeViewCheckBoxTreeCellTest.java


示例6: 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


示例7: GitFileStatusTreeCell

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
public GitFileStatusTreeCell() {
    super(
            treeItem -> ((CheckBoxTreeItem<ModifiedPath>) treeItem).selectedProperty(),
            CONVERTER
    );

    getStyleClass().add("git-file-status-tree-cell");

    // set up pseudo style classes
    unchanged   = new SimpleBooleanProperty(false);
    added       = new SimpleBooleanProperty(false);
    modified    = new SimpleBooleanProperty(false);
    removed     = new SimpleBooleanProperty(false);

    unchanged   .addListener(c -> pseudoClassStateChanged(UNCHANGED,    unchanged.get()));
    added       .addListener(c -> pseudoClassStateChanged(ADDED,        added.get()));
    modified    .addListener(c -> pseudoClassStateChanged(MODIFIED,     modified.get()));
    removed     .addListener(c -> pseudoClassStateChanged(REMOVED,      removed.get()));
}
 
开发者ID:JordanMartinez,项目名称:JGitFX,代码行数:20,代码来源:GitFileStatusTreeCell.java


示例8: setTreeChildren

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
private void setTreeChildren(CheckBoxTreeItem<FileItem> parent){
    FileItem parentItem = parent.getValue();
    CopyOnWriteArrayList<FileItem> items = new CopyOnWriteArrayList<>(dataManager.getContent(parentItem));
    for (FileItem i :items) {
        if (i.isDir()){
            CheckBoxTreeItem<FileItem> item = new CheckBoxTreeItem<>(i);

            parent.getChildren().add(item);
            setTreeChildren(item);
            if (i.isSync()){
                /*
                нельзя сразу сделать setSelected(true) для элемента
                ибо к ним не привяжется слушатель. Поэтому вначале добавляю их в список
                и после инициализации TreeView делаю их selected
                 */
                selected.add(item);
            }
        }


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


示例9: selectionChecker

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
protected void selectionChecker(final Boolean selected) {
    tree.waitState(new State<Boolean>() {
        public Boolean reached() {
            final Lookup<CheckBoxTreeItem> lookup = treeAsParent.lookup(CheckBoxTreeItem.class, new LookupCriteria<CheckBoxTreeItem>() {
                public boolean check(CheckBoxTreeItem item) {
                    return getLevel(item) > 0;
                }
            });
            for (int i = 0; i < lookup.size(); i++) {
                final int _i = i;
                if (selected != new GetAction<Boolean>() {
                    @Override
                    public void run(Object... os) throws Exception {
                        setResult(lookup.get(_i).isSelected());
                    }
                }.dispatch(tree.getEnvironment())) {
                    return Boolean.FALSE;
                }
            }
            return Boolean.TRUE;
        }
    }, Boolean.TRUE);
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:24,代码来源:CheckBoxTreeItemTest.java


示例10: 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


示例11: onPriorityAction

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
private void onPriorityAction(final RadioMenuItem priorityMenuItem) {
	final CheckBoxTreeItem<TorrentFileEntry> treeItem = (CheckBoxTreeItem<TorrentFileEntry>)getTreeItem();
	final FilePriority newPriorityValue = FilePriority.values()[Integer.parseInt(priorityMenuItem.getId())];
	if(treeItem.getValue().getPriority() != newPriorityValue) { 
		if(treeItem.isIndeterminate()) {
			treeItem.setSelected(true);
			treeItem.getValue().selectedProperty().set(newPriorityValue != FilePriority.SKIP);
		}
		else {
			treeItem.setSelected(newPriorityValue != FilePriority.SKIP);
		}
							
		if(!treeItem.isLeaf()) {
			fileTreeViewer.onUpdateChildrenPriority(treeItem, newPriorityValue);
		}
		treeItem.getValue().priorityProperty().set(newPriorityValue);
		fileTreeViewer.onUpdateParentPriority(treeItem.getParent());
		fileTreeViewer.selectItem(treeItem);
	}
}
 
开发者ID:veroslav,项目名称:jfx-torrent,代码行数:21,代码来源:TorrentContentTreeRow.java


示例12: 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


示例13: 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


示例14: buildNode

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
private CheckBoxTreeItem<File> buildNode(File file) {
    CheckBoxTreeItem<File> node = new CheckBoxTreeItem<File>(file);
    if (file.isDirectory()) {
        ObservableList<TreeItem<File>> children = node.getChildren();
        File[] listFiles = file.listFiles();
        for (File f : listFiles) {
            children.add(buildNode(f));
        }
    }
    return node;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:12,代码来源:TreeViewSample.java


示例15: buildRoot

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
private void buildRoot() {
    root.getChildren().clear();

    for (ModifiedPath firstLevelPath : getNamesAtIndex(0)) {
        CheckBoxTreeItem<ModifiedPath> firstLevelItem = new CheckBoxTreeItem<>(firstLevelPath);
        if (changedFiles.contains(firstLevelPath)) {
            fileSelectionStates.add(Tuples.t(firstLevelPath, firstLevelItem.selectedProperty()));
        } else {
            buildTreeRecursively(firstLevelPath, firstLevelItem, 1);
        }
        selectAndExpandTreeItem(firstLevelItem);
        root.getChildren().add(firstLevelItem);
    }
}
 
开发者ID:JordanMartinez,项目名称:JGitFX,代码行数:15,代码来源:SelectableFileViewer.java


示例16: 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


示例17: setUp

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
@Before
public void setUp() {
    parent.lookup(Button.class, new ByID<Button>(CheckBoxTreeItemApp.RESET_SCENE_BTN_ID)).wrap().mouse().click();
    new TreeViewTest().expand(treeAsParent.lookup());

    treeAsSelectable.selector().select(treeAsSelectable.getStates().get(0));
    Wrap<? extends TreeItem> item = treeAsParent.lookup(new LookupCriteria<TreeItem>() {
        public boolean check(TreeItem cntrl) {
            return treeAsSelectable.getStates().get(0).equals(cntrl);
        }
    }).wrap();
    propertyTableHelper = new PropertyGridHelper<CheckBoxTreeItem>((Wrap<? extends CheckBoxTreeItem>) item, parent.lookup(PropertyCheckingGrid.class).wrap());
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:14,代码来源:CheckBoxTreeItemTest.java


示例18: checkChildDependency

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
protected void checkChildDependency(boolean select) {
    Lookup<CheckBoxTreeItem> lookup = levelLookup(CheckBoxTreeItemApp.DATA_ITEMS_DEPTH);
    for (int i = 0; i < lookup.size(); i++) {
        Wrap<? extends CheckBox> check = lookup.wrap(i).as(Parent.class, Node.class).lookup(CheckBox.class).wrap();
        check.as(Selectable.class, Boolean.class).selector().select(select);
    }
    selectionChecker(select);
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:9,代码来源:CheckBoxTreeItemTest.java


示例19: levelLookup

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
protected Lookup<CheckBoxTreeItem> levelLookup(final int level) {
    return treeAsParent.lookup(CheckBoxTreeItem.class, new LookupCriteria<CheckBoxTreeItem>() {
        public boolean check(CheckBoxTreeItem item) {
            return getLevel(item) == level;
        }
    });
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:8,代码来源:CheckBoxTreeItemTest.java


示例20: addLevel

import javafx.scene.control.CheckBoxTreeItem; //导入依赖的package包/类
protected void addLevel(CheckBoxTreeItem<String> parent, int level) {
    if (level == 0) {
        return;
    }
    for (int i = 0; i < DATA_ITEMS_SIZE; i++) {
        final CheckBoxTreeItem<String> checkBoxTreeItem = new CheckBoxTreeItem<String>("DataItem " + i + " Level " + (DATA_ITEMS_DEPTH - level));
        parent.getChildren().add(checkBoxTreeItem);
        addLevel(checkBoxTreeItem, level - 1);
    }
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:11,代码来源:CheckBoxTreeApp.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Style类代码示例发布时间:2022-05-22
下一篇:
Java Instruction21ih类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap