public CommonContentEntriesEditor(String moduleName, final ModuleConfigurationState state, JpsModuleSourceRootType<?>... rootTypes) { super(state); myState = state; myModuleName = moduleName; myModulesProvider = state.getModulesProvider(); for (JpsModuleSourceRootType<?> type : rootTypes) { ContainerUtil.addIfNotNull(myEditHandlers, ModuleSourceRootEditHandler.getEditHandler(type)); } final VirtualFileManagerAdapter fileManagerListener = new VirtualFileManagerAdapter() { @Override public void afterRefreshFinish(boolean asynchronous) { if (state.getProject().isDisposed()) { return; } final Module module = getModule(); if (module == null || module.isDisposed()) return; for (final ContentEntryEditor editor : myEntryToEditorMap.values()) { editor.update(); } } }; final VirtualFileManager fileManager = VirtualFileManager.getInstance(); fileManager.addVirtualFileManagerListener(fileManagerListener); registerDisposable(new Disposable() { @Override public void dispose() { fileManager.removeVirtualFileManagerListener(fileManagerListener); } }); }
public CommonContentEntriesEditor(String moduleName, final ModuleConfigurationState state, boolean canMarkSources, boolean canMarkTestSources) { super(state); myState = state; myModuleName = moduleName; myCanMarkSources = canMarkSources; myCanMarkTestSources = canMarkTestSources; myModulesProvider = state.getModulesProvider(); final VirtualFileManagerAdapter fileManagerListener = new VirtualFileManagerAdapter() { @Override public void afterRefreshFinish(boolean asynchronous) { if (state.getProject().isDisposed()) { return; } final Module module = getModule(); if (module == null || module.isDisposed()) return; for (final ContentEntryEditor editor : myEntryToEditorMap.values()) { editor.update(); } } }; final VirtualFileManager fileManager = VirtualFileManager.getInstance(); fileManager.addVirtualFileManagerListener(fileManagerListener); registerDisposable(new Disposable() { @Override public void dispose() { fileManager.removeVirtualFileManagerListener(fileManagerListener); } }); }
public ContentEntriesEditor(String moduleName, final ModuleConfigurationState state) { super(state); myState = state; myModuleName = moduleName; myModulesProvider = state.getModulesProvider(); final VirtualFileManagerAdapter fileManagerListener = new VirtualFileManagerAdapter() { @Override public void afterRefreshFinish(boolean asynchronous) { if (state.getProject().isDisposed()) { return; } final Module module = getModule(); if (module == null || module.isDisposed()) return; for (final ContentEntryEditor editor : myEntryToEditorMap.values()) { editor.update(); } } }; final VirtualFileManager fileManager = VirtualFileManager.getInstance(); fileManager.addVirtualFileManagerListener(fileManagerListener); registerDisposable(new Disposable() { @Override public void dispose() { fileManager.removeVirtualFileManagerListener(fileManagerListener); } }); }