Java Code Examples for org.openide.nodes.Node.destroy()

The following are Jave code examples for showing how to use destroy() of the org.openide.nodes.Node class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: incubator-netbeans   File: Browser.java   Source Code and License Vote up 6 votes
/**
 * Cancels all running tasks
 */
private void cancel() {
    SvnProgressSupport[] progressSupports;
    synchronized(supportList) {
        cancelled = true;
        progressSupports = supportList.toArray(new SvnProgressSupport[supportList.size()]);
        supportList.clear();
    }

    Node rootNode = getExplorerManager().getRootContext();
    if(rootNode != null) {
        getExplorerManager().setRootContext(Node.EMPTY);
        try {
            rootNode.destroy();

            if(progressSupports != null && progressSupports.length > 0) {
                for(SvnProgressSupport sps : progressSupports) {
                    sps.cancel();
                }
            }
        } catch (IOException ex) {
            Subversion.LOG.log(Level.INFO, null, ex); // should not happen
        }
    }
}
 
Example 2
Project: incubator-netbeans   File: PackageViewTest.java   Source Code and License Vote up 5 votes
@RandomlyFails // NB-Core-Build #8123
public void testReducedTreeDelete() throws Exception {
    SourceGroup g = sampleGroup();
    Node r = new TreeRootNode(g, true);
    assertTree("TestGroup{org.netbeans{api.stuff{Stuff.java}, modules.stuff{resources{stuff.png}, Bundle.properties, StuffUtils.java}, spi.stuff{support{AbstractStuffImplementation.java}, StuffImplementation.java}}}", r);
    Node n = NodeOp.findPath(r, new String[] {"org.netbeans", "modules.stuff"});
    n.destroy();
    assertTree("TestGroup{org.netbeans{api.stuff{Stuff.java}, spi.stuff{support{AbstractStuffImplementation.java}, StuffImplementation.java}}}", r);
}
 
Example 3
Project: incubator-netbeans   File: CatalogPanel.java   Source Code and License Vote up 5 votes
private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed
    Node [] nodes = manager.getSelectedNodes();
    try {
        for(Node n : nodes) {
            n.destroy();
        }
    } catch (IOException e) {
        Logger.getLogger(CatalogPanel.class.getName()).log(Level.SEVERE, e.getLocalizedMessage(), e);
    }
}