当前位置: 首页>>代码示例>>Java>>正文


Java Children.remove方法代码示例

本文整理汇总了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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:HistoryRootNode.java

示例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});
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:HistoryRootNode.java

示例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());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:47,代码来源:ListViewTest.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:49,代码来源:ListViewTest.java


注:本文中的org.openide.nodes.Children.remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。