Java Code Examples for javafx.scene.control.CheckBoxTreeItem#setSelected()
The following examples show how to use
javafx.scene.control.CheckBoxTreeItem#setSelected() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConditionTreeView.java From MyBox with Apache License 2.0 | 6 votes |
public void setSelection(TreeItem<ConditionNode> item) { try { if (item == null || !(item instanceof CheckBoxTreeItem)) { return; } CheckBoxTreeItem<ConditionNode> citem = (CheckBoxTreeItem<ConditionNode>) item; ConditionNode node = item.getValue(); if (selectedTitles.contains(node.getTitle())) { citem.setSelected(true); return; } else if (item.isLeaf()) { return; } for (TreeItem<ConditionNode> child : item.getChildren()) { setSelection(child); } } catch (Exception e) { logger.debug(e.toString()); } }
Example 2
Source File: JavaFXTreeViewCheckBoxTreeCellElementTest.java From marathonv5 with Apache License 2.0 | 6 votes |
@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"); } }; }
Example 3
Source File: JavaFXTreeViewCheckBoxTreeCellElementTest.java From marathonv5 with Apache License 2.0 | 6 votes |
@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"); } }; }
Example 4
Source File: ConditionTreeView.java From MyBox with Apache License 2.0 | 4 votes |
public void selectAll() { CheckBoxTreeItem<ConditionNode> root = (CheckBoxTreeItem<ConditionNode>) getRoot(); root.setSelected(true); }
Example 5
Source File: ConditionTreeView.java From MyBox with Apache License 2.0 | 4 votes |
public void selectNone() { CheckBoxTreeItem<ConditionNode> root = (CheckBoxTreeItem<ConditionNode>) getRoot(); root.setSelected(false); }