Java 类com.intellij.openapi.vfs.ex.VirtualFileManagerAdapter 实例源码

项目:intellij-ce-playground    文件:CommonContentEntriesEditor.java   
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);
    }
  });
}
项目:tools-idea    文件:CommonContentEntriesEditor.java   
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);
    }
  });
}
项目:consulo    文件:ContentEntriesEditor.java   
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);
    }
  });
}