本文整理匯總了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;
}