本文整理汇总了Java中org.openide.nodes.Children.remove方法的典型用法代码示例。如果您正苦于以下问题:Java Children.remove方法的具体用法?Java Children.remove怎么用?Java Children.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.nodes.Children
的用法示例。
在下文中一共展示了Children.remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadingVCSStarted
import org.openide.nodes.Children; //导入方法依赖的package包/类
synchronized void loadingVCSStarted() {
Children children = getChildren();
if(loadNextNode != null) {
children.remove(new Node[] { loadNextNode });
}
addWaitNode();
}
示例2: loadingVCSFinished
import org.openide.nodes.Children; //导入方法依赖的package包/类
synchronized void loadingVCSFinished(Date dateFrom) {
Children children = getChildren();
removeWaitNode();
if(loadNextNode != null) {
children.remove(new Node[] { loadNextNode });
}
if(dateFrom != null && !HistorySettings.getInstance().getLoadAll()) {
loadNextNode = new LoadNextNode(dateFrom);
children.add(new Node[] {loadNextNode});
}
}
示例3: testRemoveAndAddNodes
import org.openide.nodes.Children; //导入方法依赖的package包/类
/**
* Removes selected node by calling Children.Array.remove
*/
public void testRemoveAndAddNodes() {
final Children c = new Array();
Node n = new AbstractNode (c);
final PListView lv = new PListView();
final ExplorerPanel p = new ExplorerPanel();
p.add(lv, BorderLayout.CENTER);
p.getExplorerManager().setRootContext(n);
p.open();
Node[] children = new Node[NO_OF_NODES];
for (int i = 0; i < NO_OF_NODES; i++) {
children[i] = new AbstractNode(Children.LEAF);
children[i].setDisplayName(Integer.toString(i));
children[i].setName(Integer.toString(i));
c.add(new Node[] { children[i] } );
}
//Thread.sleep(2000);
try {
// Waiting for until the view is updated.
// This should not be necessary
try {
SwingUtilities.invokeAndWait( new EmptyRunnable() );
} catch (InterruptedException ie) {
fail ("Caught InterruptedException:" + ie.getMessage ());
} catch (InvocationTargetException ite) {
fail ("Caught InvocationTargetException: " + ite.getMessage ());
}
p.getExplorerManager().setSelectedNodes(new Node[] {children[0]} );
} catch (PropertyVetoException pve) {
fail ("Caught the PropertyVetoException when set selected node " + children[0].getName ()+ ".");
}
for (int i = 0; i < NO_OF_NODES; i++) {
c.remove(new Node [] { children[i] } );
children[i] = new AbstractNode(Children.LEAF);
children[i].setDisplayName(Integer.toString(i));
children[i].setName(Integer.toString(i));
c.add(new Node[] { children[i] } );
//Thread.sleep(350);
}
assertEquals(NO_OF_NODES, c.getNodesCount());
}
示例4: testNodeAddingAndRemoving
import org.openide.nodes.Children; //导入方法依赖的package包/类
/**
* Creates two nodes. Selects one and tries to remove it
* and replace with the other one (several times).
*/
public void testNodeAddingAndRemoving() {
final Children c = new Array();
Node n = new AbstractNode (c);
final PListView lv = new PListView();
final ExplorerPanel p = new ExplorerPanel();
p.add(lv, BorderLayout.CENTER);
p.getExplorerManager().setRootContext(n);
p.open();
final Node c1 = new AbstractNode(Children.LEAF);
c1.setDisplayName("First");
c1.setName("First");
c.add(new Node[] { c1 });
Node c2 = new AbstractNode(Children.LEAF);
c2.setDisplayName("Second");
c2.setName("Second");
//Thread.sleep(500);
for (int i = 0; i < 5; i++) {
c.remove(new Node[] { c1 });
c.add(new Node[] { c2 });
// Waiting for until the view is updated.
// This should not be necessary
try {
SwingUtilities.invokeAndWait( new EmptyRunnable() );
} catch (InterruptedException ie) {
fail ("Caught InterruptedException:" + ie.getMessage ());
} catch (InvocationTargetException ite) {
fail ("Caught InvocationTargetException: " + ite.getMessage ());
}
try {
p.getExplorerManager().setSelectedNodes(new Node[] {c2} );
} catch (PropertyVetoException pve) {
fail ("Caught the PropertyVetoException when set selected node " + c2.getName ()+ ".");
}
c.remove(new Node[] { c2 });
c.add(new Node[] { c1 });
//Thread.sleep(350);
}
}