org.openide.nodes.NodeEvent Java Examples

The following examples show how to use org.openide.nodes.NodeEvent. 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: MatchingObjectNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public void nodeDestroyed(NodeEvent ev) {
    EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
            setInvalidOriginal();
            /**
             * Check if the object is valid again. It can happen when a
             * module with real data loader is enabled.
             */
            RP.post(new Runnable() {

                @Override
                public void run() {
                    checkFileObjectValid();
                }
            }, 2500);
        }
    });
}
 
Example #2
Source File: NavigatorController.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/****** NodeListener implementation *****/

    public void nodeDestroyed(NodeEvent ev) {
        LOG.fine("Node destroyed reaction...");
        // #121944: don't react on node destroy when we are active
        if (navigatorTC.getTopComponent().equals(WindowManager.getDefault().getRegistry().getActivated())) {
            LOG.fine("NavigatorTC active, skipping node destroyed reaction.");
            return;
        }
        LOG.fine("invokeLater on updateContext from node destroyed reaction...");
        // #122257: update content later to fight possible deadlocks
        Lookup globalContext = Utilities.actionsGlobalContext();
        NavigatorLookupPanelsPolicy panelsPolicy = globalContext.lookup(NavigatorLookupPanelsPolicy.class);
        Collection<? extends NavigatorLookupHint> lkpHints = globalContext.lookupAll(NavigatorLookupHint.class);
        EventQueue.invokeLater(getUpdateRunnable(true, panelsPolicy, lkpHints));
    }
 
Example #3
Source File: NbSheet.java    From netbeans with Apache License 2.0 6 votes vote down vote up
final void handleNodeDestroyed(NodeEvent ev) {
    assert EventQueue.isDispatchThread();
    
    Node destroyedNode = ev.getNode();
    NodeListener listener = listenerMap.get(destroyedNode);
    PropertyChangeListener pListener = pListenerMap.get(destroyedNode);
    // stop to listen to destroyed node
    destroyedNode.removeNodeListener(listener);
    destroyedNode.removePropertyChangeListener(pListener);
    listenerMap.remove(destroyedNode);
    pListenerMap.remove(destroyedNode);
    // close top component (our outer class) if last node was destroyed
    if (listenerMap.isEmpty() && !global) {
        //fix #39251 start - posting the closing of TC to awtevent thread
        close();
        //fix #39251 end
    } else {
        setNodes(
            (listenerMap.keySet().toArray(new Node[listenerMap.size()])), false, "handleNodeDestroyed" // NOI18N
        );
    }
}
 
Example #4
Source File: NodeOperationImpl.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Fired when the node is deleted.
 * @param ev event describing the node
 */
@Override
public void nodeDestroyed(NodeEvent ev) {
    Node destroyedNode = ev.getNode();
    // stop to listen to destroyed node
    destroyedNode.removeNodeListener(this);
    listenerSet.remove(destroyedNode);
    // close top component (our outer class) if last node was destroyed
    if (listenerSet.isEmpty()) {
        // #68943 - stop to listen, as we are waving goodbye :-)
        tc.removePropertyChangeListener(this);
        Mutex.EVENT.readAccess(new Runnable() {
            @Override
            public void run() {
                if (dialog != null) {
                    dialog.setVisible(false);
                    dialog.dispose();
                    dialog = null;
                }
            }
        });
    }
}
 
Example #5
Source File: AuthoritativeSourcesNodeFactory.java    From BART with MIT License 5 votes vote down vote up
@Override
public void nodeDestroyed(NodeEvent ev) {
    String autoritaiveSource = ev.getNode().getLookup().lookup(String.class);
    if(autoritaiveSource != null)   {
        boolean esito = egt.getAuthoritativeSources().remove(autoritaiveSource);
        if(esito)dto.setEgtModified(true);
    }
    refresh(true);
}
 
Example #6
Source File: NbSheet.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Fired when the node is deleted.
 * @param ev event describing the node
 */
@Override
public void nodeDestroyed(final NodeEvent ev) {
    Mutex.EVENT.readAccess(new Runnable() {
        @Override
        public void run() {
            handleNodeDestroyed(ev);
        }
    });
}
 
Example #7
Source File: ProjectsRootNodePreferredOpenTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    assertFalse("No event in AWT thread", EventQueue.isDispatchThread());
    events.add(ev);
}
 
Example #8
Source File: ProjectsRootNodePhysicalViewTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    assertFalse("No event in AWT thread", EventQueue.isDispatchThread());
    events.add(ev);
}
 
Example #9
Source File: OpenProjectListSetMain2Test.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    assertFalse("No event in AWT thread", EventQueue.isDispatchThread());
    events.add(ev);
}
 
Example #10
Source File: ProjectsRootNodePreferredFromContextOpenTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    assertFalse("No event in AWT thread", EventQueue.isDispatchThread());
    events.add(ev);
}
 
Example #11
Source File: ProjectsRootNodePreferredFromPopupTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    assertFalse("No event in AWT thread", EventQueue.isDispatchThread());
    events.add(ev);
}
 
Example #12
Source File: ProjectsRootNodePhysicalViewModeSourcesTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    assertFalse("No event in AWT thread", EventQueue.isDispatchThread());
    events.add(ev);
}
 
Example #13
Source File: OpenProjectHookThrowsExceptionTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    assertFalse("No event in AWT thread", EventQueue.isDispatchThread());
    events.add(ev);
}
 
Example #14
Source File: EjbChildren.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    remove(new Node[]{ev.getNode()});
}
 
Example #15
Source File: OpenProjectListSetMainTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    assertFalse("No event in AWT thread", EventQueue.isDispatchThread());
    events.add(ev);
}
 
Example #16
Source File: CloseProjectsTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    assertFalse("No event in AWT thread", EventQueue.isDispatchThread());
    events.add(ev);
}
 
Example #17
Source File: DefaultCategory.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Fired when the node is deleted.
* @param ev event describing the node
*/
public synchronized void nodeDestroyed(NodeEvent ev) {
    categoryNode.removeNodeListener( this );
}
 
Example #18
Source File: SceneEditorController.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
//        setNeedsSave(true);
        toolController.refreshNonSpatialMarkers();
    }
 
Example #19
Source File: TerrainEditorTopComponent.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ne) {
    createTerrainButton.setEnabled(true);
    reinitTextureTable();
}
 
Example #20
Source File: ActionFilterNode.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void nodeDestroyed(NodeEvent ev) {
}
 
Example #21
Source File: ScanInProgressTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    assertFalse("No event in AWT thread", EventQueue.isDispatchThread());
    events.add(ev);
}
 
Example #22
Source File: Tab.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void nodeDestroyed(NodeEvent nodeEvent) {
    //Tab.this.setCloseOperation(TopComponent.CLOSE_EACH);
    Tab.this.close();
}
 
Example #23
Source File: FavoritesNode.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void nodeDestroyed(NodeEvent ev) {
}
 
Example #24
Source File: CookieAction84636Test.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
}
 
Example #25
Source File: PhysicalView.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void nodeDestroyed(NodeEvent ev) {
}
 
Example #26
Source File: HelpCtxProcessor.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public @Override void nodeDestroyed(NodeEvent ev) {
    setEnabled(false);
    updateText();
}
 
Example #27
Source File: ProxyNodeTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    this.ev = ev;
}
 
Example #28
Source File: NodeDeletionTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void nodeDestroyed(NodeEvent ev) {
    destroyed = true;
}
 
Example #29
Source File: PropertiesRowModel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void nodeDestroyed(NodeEvent ev) {}
 
Example #30
Source File: MatchingObjectNodeTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void nodeDestroyed(NodeEvent ev) {
}