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


Java CheckBoxTreeItem.setSelected方法代码示例

本文整理汇总了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");
        }
    };
}
 
开发者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: 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

示例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);
	}
}
 
开发者ID:veroslav,项目名称:jfx-torrent,代码行数:21,代码来源:TorrentContentTreeRow.java

示例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);
}
 
开发者ID:veroslav,项目名称:jfx-torrent,代码行数:9,代码来源:TorrentContentTreeRow.java

示例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);
}
 
开发者ID:veroslav,项目名称:jfx-torrent,代码行数:9,代码来源:TorrentContentTreeRow.java

示例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;
}
 
开发者ID:veroslav,项目名称:jfx-torrent,代码行数:10,代码来源:FileTreeViewer.java

示例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);
    }
}
 
开发者ID:dmusican,项目名称:Elegit,代码行数:11,代码来源:WorkingTreePanelView.java

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

示例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);
}
 
开发者ID:dmusican,项目名称:Elegit,代码行数:7,代码来源:WorkingTreePanelView.java


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