本文整理汇总了Java中org.openide.nodes.Children.findChild方法的典型用法代码示例。如果您正苦于以下问题:Java Children.findChild方法的具体用法?Java Children.findChild怎么用?Java Children.findChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.nodes.Children
的用法示例。
在下文中一共展示了Children.findChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSelectionNodes
import org.openide.nodes.Children; //导入方法依赖的package包/类
private Node[] getSelectionNodes() {
if(selectionNodes == null) {
String[] segments = selectionUrl.getPathSegments();
Node node = (RepositoryPathNode) browser.getExplorerManager().getRootContext();
for (int i = 0; i < segments.length; i++) {
Children children = node.getChildren();
node = children.findChild(segments[i]);
if(node==null) {
break;
}
}
if(node == null) {
selectionNodes = EMPTY_NODES;
} else {
selectionNodes = new Node[] {node};
}
}
return selectionNodes;
}
示例2: setUp
import org.openide.nodes.Children; //导入方法依赖的package包/类
public @Override void setUp() throws Exception {
final FileObject root = TestUtil.makeScratchDir(this);
root.createFolder("testproject");
MockLookup.setInstances(TestUtil.testProjectFactory());
SourceGroup group = GenericSources.group(ProjectManager.getDefault().findProject(root), root.createFolder("src"), "testGroup", "Test Group", null, null);
Children ch = PackageView.createPackageView(group).getChildren();
// Create folder
FileUtil.createFolder(root, "src/foo");
n = ch.findChild("foo");
assertNotNull(n);
}
示例3: findDropedNodes
import org.openide.nodes.Children; //导入方法依赖的package包/类
private Node[] findDropedNodes(Node folder, Node[] dragNodes) {
if ((folder == null) || (dragNodes.length == 0)) {
return null;
}
Node[] dropNodes = new Node[dragNodes.length];
Children children = folder.getChildren();
for (int i = 0; i < dragNodes.length; i++) {
dropNodes[i] = children.findChild(dragNodes[i].getName());
}
return dropNodes;
}