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