本文整理汇总了Java中javafx.scene.control.CheckBoxTreeItem.setSelected方法的典型用法代码示例。如果您正苦于以下问题:Java CheckBoxTreeItem.setSelected方法的具体用法?Java CheckBoxTreeItem.setSelected怎么用?Java CheckBoxTreeItem.setSelected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.CheckBoxTreeItem
的用法示例。
在下文中一共展示了CheckBoxTreeItem.setSelected方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
}
};
}
示例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");
}
};
}
示例3: 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;
}
示例4: 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);
}
}
示例5: onUnselectAction
import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
private void onUnselectAction() {
final CheckBoxTreeItem<TorrentFileEntry> checkBoxItem = (CheckBoxTreeItem<TorrentFileEntry>)getTreeItem();
if(checkBoxItem.isIndeterminate()) {
checkBoxItem.setSelected(true);
}
getItem().setSelected(false);
selectMenuItem.setDisable(false);
}
示例6: onSelectAction
import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
private void onSelectAction() {
final CheckBoxTreeItem<TorrentFileEntry> checkBoxItem = (CheckBoxTreeItem<TorrentFileEntry>)getTreeItem();
if(checkBoxItem.isIndeterminate()) {
checkBoxItem.setSelected(false);
}
getItem().setSelected(true);
unselectMenuItem.setDisable(false);
}
示例7: initTreeItem
import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
private TreeItem<TorrentFileEntry> initTreeItem(final TorrentFileEntry fileEntry) {
final CheckBoxTreeItem<TorrentFileEntry> treeItem = new CheckBoxTreeItem<>(fileEntry);
treeItem.selectedProperty().bindBidirectional(fileEntry.selectedProperty());
treeItem.setSelected(fileEntry.isSelected());
addTreeItemListener(treeItem);
return treeItem;
}
示例8: setAllFilesSelected
import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
/**
* Sets all displayed items to have the given selected status
* @param selected true to check every box, false to uncheck every box
*/
public void setAllFilesSelected(boolean selected) {
for (TreeItem fileLeaf : displayedFiles) {
CheckBoxTreeItem checkBoxFile = (CheckBoxTreeItem) fileLeaf;
checkBoxFile.setSelected(selected);
}
}
示例9: selectAndExpandTreeItem
import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
private void selectAndExpandTreeItem(CheckBoxTreeItem<ModifiedPath> item) {
item.setSelected(true);
item.setExpanded(true);
}
示例10: updateRepoFile
import javafx.scene.control.CheckBoxTreeItem; //导入方法依赖的package包/类
private void updateRepoFile(CheckBoxTreeItem<RepoFile> oldItem, CheckBoxTreeItem<RepoFile> newItem, int index) {
newItem.setSelected(oldItem.isSelected());
List<TreeItem<RepoFile>> directoryFiles = oldItem.getParent().getChildren();
directoryFiles.set(directoryFiles.indexOf(oldItem), newItem);
displayedFiles.set(index, newItem);
}