protected void addListeners() { VirtualFileManager.getInstance().addVirtualFileManagerListener(myRefreshListener); SModelRepository.getInstance().addModelRepositoryListener(mySModelRepositoryListener); ModelAccess.instance().addCommandListener(myModelAccessListener); MPSModuleRepository.getInstance().addModuleRepositoryListener(myRepositoryListener); if (IMakeService.INSTANCE.isSessionActive()) { IMakeService.INSTANCE.get().addListener(myMakeNotificationListener); } ClassLoaderManager.getInstance().addReloadHandler(myReloadListener); }
protected void removeListeners() { ClassLoaderManager.getInstance().removeReloadHandler(myReloadListener); SModelRepository.getInstance().removeModelRepositoryListener(mySModelRepositoryListener); ModelAccess.instance().removeCommandListener(myModelAccessListener); MPSModuleRepository.getInstance().removeModuleRepositoryListener(myRepositoryListener); if (IMakeService.INSTANCE.hasMakeService()) { IMakeService.INSTANCE.get().removeListener(myMakeNotificationListener); } VirtualFileManager.getInstance().removeVirtualFileManagerListener(myRefreshListener); }
public void editNode(final SNode node, final IOperationContext context, final boolean focus) { ModelAccess.assertLegalWrite(); NavigationSupport.getInstance() .openNode(context, node, focus, !(node.getModel() != null && node.getModel().isRoot(node))); }