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); }