public synchronized void dispose() { if (!(myInitialized)) { return; } myInitialized = false; if (myGlobalModelListener != null) { GlobalSModelEventsManager.getInstance().removeGlobalModelListener(myGlobalModelListener); } FileStatusManager.getInstance(myRegistry.getProject()) .removeFileStatusListener(myFileStatusListener); myTree.removeTreeNodeListener(myTreeNodeListener); myMap.removeListener(myFeatureListener); myQueue.dispose(); }
public synchronized void init() { if (myInitialized) { return; } myInitialized = true; myMap.addListener(myFeatureListener); myTree.addTreeNodeListener(myTreeNodeListener); FileStatusManager.getInstance(myRegistry.getProject()) .addFileStatusListener(myFileStatusListener); if (myGlobalModelListener != null) { GlobalSModelEventsManager.getInstance().addGlobalModelListener(myGlobalModelListener); } ModelAccess.instance() .runReadInEDT( new Runnable() { public void run() { registerNodeRecursively(myTree.getRootNode()); } }); }
@Override public void dispose() { clearHighlighting(); super.dispose(); }