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

The following examples show how to use org.openide.nodes.Node#destroy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Browser.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * 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
Source File: PackageViewTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@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
Source File: CatalogPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
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);
    }
}