本文整理匯總了Java中org.openide.nodes.Node.cloneNode方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.cloneNode方法的具體用法?Java Node.cloneNode怎麽用?Java Node.cloneNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.nodes.Node
的用法示例。
在下文中一共展示了Node.cloneNode方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: copyNode
import org.openide.nodes.Node; //導入方法依賴的package包/類
protected Node copyNode (Node node) {
boolean filter = false;
try {
DataObject d = (DataObject) node.getCookie (DataObject.class);
if (d != null) {
InstanceCookie.Of inst = (InstanceCookie.Of)d.getCookie(InstanceCookie.Of.class);
if (inst != null && (inst.instanceOf(Node.class) || inst.instanceOf(Node.Handle.class))) {
// This is just a node, not a real setting. E.g. ModuleNode, LoaderPoolNode. As such,
// it itself should not display any origin information, it would make no sense. However
// its children might have a legitimate DataObject cookie from the SFS.
d = null;
}
}
DataFolder folder = (DataFolder) node.getCookie (DataFolder.class);
FileSystem fs = d == null || folder != null ? null : d.getPrimaryFile ().getFileSystem ();
filter = fs == null ? false : fs.isDefault();
} catch (FileStateInvalidException e) {
// ignore
}
return filter ? new SettingFilterNode (node) :
node.isLeaf() ? node.cloneNode() : new TrivialFilterNode(node);
}
示例2: createNodes
import org.openide.nodes.Node; //導入方法依賴的package包/類
@Override
protected Node[] createNodes(Node obj) {
DataObject dobj = (obj).getLookup().lookup(DataObject.class);
if (dobj != null) {
if (!VisibilityQuery.getDefault().isVisible(dobj.getPrimaryFile())) {
return new Node[0];
}
Node n = new SiteDocsNode(project, obj, false);
return new Node[] {n};
}
Node origos = obj;
return new Node[] { origos.cloneNode() };
}
示例3: createNodeForKey
import org.openide.nodes.Node; //導入方法依賴的package包/類
protected @Override Node createNodeForKey(Node key) {
return key.cloneNode();
}
示例4: createChild
import org.openide.nodes.Node; //導入方法依賴的package包/類
/** A method to allow subclasses to create different child for any other node then folder.
* @param node to create child for
*/
protected Node createChild (Node node) {
return node.cloneNode ();
}