本文整理了Java中org.openide.nodes.Children.add()
方法的一些代码示例,展示了Children.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Children.add()
方法的具体详情如下:
包路径:org.openide.nodes.Children
类名称:Children
方法名:add
[英]Add nodes this container. The parent node of these nodes is changed to the parent node of this list. Each node can be added only once. If there is some reason a node cannot be added, for example if the node expects only a special type of subnodes, the method should do nothing and return false
to signal that the addition has not been successful.
This method should be implemented by subclasses to filter some nodes, etc.
[中]将节点添加到此容器。这些节点的父节点将更改为此列表的父节点。每个节点只能添加一次。如果由于某种原因无法添加节点,例如,如果节点只需要一种特殊类型的子节点,则该方法不应执行任何操作,并返回false
以表示添加未成功。
这个方法应该通过子类来实现,以过滤一些节点等。
代码示例来源:origin: org.netbeans.api/org-openide-nodes
@Override
@Deprecated
public boolean add(Node[] arr) {
return original.getChildren().add(arr);
}
代码示例来源:origin: org.netbeans.api/org-openide-nodes
@Override
public boolean add(Node[] nodes) {
return getOriginal().add(nodes);
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
public boolean add (Node[] arr) {
return original.getChildren ().add (arr);
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
public boolean add (Node[] arr) {
return original.getChildren ().add (arr);
}
代码示例来源:origin: it.tidalwave.semantic/it-tidalwave-semantic-node
public Transferable paste()
throws IOException
{
getChildren().add(new Node[]{tagNode.cloneNode()});
return null; // ExTransferable.EMPTY?
}
};
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-navigation
@Override
public void run() {
children.remove(children.getNodes());
children.add(new Node[] { ElementNode.getWaitNode(NbBundle.getMessage(ClassHierarchyPanel.class, "PleaseWait")) });
}
});
代码示例来源:origin: org.netbeans.api/org-openide-explorer
public MyIndexedRootNode(Node[] ch) {
getChildren().add(ch);
setName("IndexedRoot"); // NOI18N
setDisplayName(NbBundle.getMessage(IndexedPropertyEditor.class, "CTL_Index"));
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-navigation
@Override
public void run() {
children.remove(children.getNodes());
children.add(new Node[]{node});
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
menuAvaliable.set(true);
updateButtons();
((BeanTreeView) hierarchyPane).expandNode(node);
Node selected = findSelection();
try {
getExplorerManager().setSelectedNodes(new Node[]{selected});
} catch (PropertyVetoException ex) {
}
}
});
}
});
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-ddui
public void setChildren(LinkedList<SectionNode> children) {
if(children.peek() != null) {
SectionNode firstNode = children.removeFirst();
setRootNode(firstNode);
if(children.peek() != null) {
SectionNode [] remainingNodes = children.toArray(new SectionNode[0]);
Node rootNode = getRoot();
rootNode.getChildren().add(remainingNodes);
for(int i = 0; i < remainingNodes.length; i++) {
addSection(remainingNodes[i].getSectionNodePanel());
}
}
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
public MyIndexedRootNode(Node[] ch) {
getChildren().add(ch);
setName("IndexedRoot"); // NOI18N
setDisplayName(NbBundle.getBundle(IndexedPropertyEditor.class).getString("CTL_Index"));
}
代码示例来源:origin: it.tidalwave.netbeans/it-tidalwave-netbeans-nodes
/*******************************************************************************************************************
*
*
******************************************************************************************************************/
public void retry()
{
if (node != null)
{
node.getChildren().add(new Node[] {createWaitNode()});
}
super.refresh(false);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-navigation
@Override
public void run() {
children.remove(children.getNodes());
children.add(new Node[]{new LoadingNode()});
}
});
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
public MyIndexedRootNode(Node[] ch) {
getChildren().add(ch);
setName("IndexedRoot"); // NOI18N
setDisplayName(NbBundle.getBundle(IndexedPropertyEditor.class).getString("CTL_Index"));
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
public void create() {
if (array != null) {
Object[] newArray = (Object[]) Array.newInstance(getConvertedType(), array.length + 1);
System.arraycopy(array, 0, newArray, 0, array.length);
// throw away the old array!
array = newArray;
array[array.length - 1] = defaultValue();
} else {
// throw away the old array!
array = (Object[]) Array.newInstance(getConvertedType(), 1);
array[0] = defaultValue();
}
IndexedPropertyEditor.this.firePropertyChange();
DisplayIndexedNode din = new DisplayIndexedNode(array.length - 1);
getChildren().add(new Node[] { din });
Index i = getCookie(Index.class);
i.addChangeListener(org.openide.util.WeakListeners.change(din, i));
}
};
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-jboss4
public JBTargetNode(Lookup lookup) {
super(new Children.Array());
getChildren().add(new Node[] {new JBItemNode(new JBApplicationsChildren(lookup), NbBundle.getMessage(JBTargetNode.class, "LBL_Apps"))});
}
代码示例来源:origin: nl.cloudfarming.client/geoviewer-data
@Override
public Transferable paste() {
try {
// adds the new node to the selected parent (current node)
dropNode.getParentNode().getChildren().add(new Node[]{new LayerNode(selectedLayer,getLookup().lookup(MapController.class))});
} catch (IntrospectionException ex) {
Exceptions.printStackTrace(ex);
}
// remove the node from the old location
dropNode.getParentNode().getChildren().remove(new Node[]{dropNode});
return null;
}
};
代码示例来源:origin: it.tidalwave.netbeans/it-tidalwave-netbeans-nodes
/*******************************************************************************************************************
*
*
******************************************************************************************************************/
@Override
public void handleException (final @CheckForNull Node node,
final @Nonnull ChildFactory<?> childFactory,
final @Nonnull Throwable throwable)
{
logger.fine("handleException(%s, %s, %s)", node, childFactory, throwable);
logger.warning("While populating children nodes: ", throwable);
logger.throwing(CLASS, "handleException()", throwable);
if (node != null)
{
final Retrier retrier = new Retrier(node.getChildren(), (SafeChildFactory<?>) childFactory);
node.getChildren().add(new Node[]{new ErrorNode(errorMessage, errorIconPath, throwable, retrier)});
}
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-ddui
/** API to set the child nodes (subpanels) of this view node without creating
* an extra top level root node.
*/
public void setChildren(SectionNode [] children) {
int size = children.length;
if(size > 0) {
setRootNode(children[0]);
if(--size > 0) {
SectionNode [] remainingNodes = new SectionNode[size];
System.arraycopy(children, 1, remainingNodes, 0, size);
Node rootNode = getRoot();
rootNode.getChildren().add(remainingNodes);
for(int i = 0; i < size; i++) {
addSection(remainingNodes[i].getSectionNodePanel());
}
}
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-navigation
@Override
public void run() {
children.remove(children.getNodes());
HierarchyModel curModel = model;
if (curModel != null) {
final Node node = new HierarchyNode(csmClass, curModel, null);
children.add(new Node[]{node});
try {
getExplorerManager().setSelectedNodes(new Node[]{node});
} catch (PropertyVetoException ex) {
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
menuAvaliable.set(true);
updateButtons();
((BeanTreeView) hierarchyPane).expandNode(node);
}
});
}
}
});
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-wizards
if (m.isData() && "wsmode".equals(m.getExt())) {
ModeNode mn = new ModeNode(m, data);
ch.add(new Node[] { mn });
one = true;
empty.setDisplayName(Bundle.LBL_NoModesFound());
empty.setShortDescription(Bundle.MSG_NoModesFound());
ch.add(new Node[] { empty });
markInvalid();
} else {
内容来源于网络,如有侵权,请联系作者删除!