Java 类com.intellij.openapi.components.impl.ComponentManagerImpl 实例源码

项目:intellij-ce-playground    文件:FileEditorManagerTestCase.java   
@Override
public void setUp() throws Exception {
  super.setUp();
  DockManager dockManager = DockManager.getInstance(getProject());
  myOldDockContainers = dockManager.getContainers();
  myManager = new FileEditorManagerImpl(getProject(), dockManager, EditorHistoryManager.getInstance(getProject()));
  myOldManager = ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myManager);
  ((FileEditorProviderManagerImpl)FileEditorProviderManager.getInstance()).clearSelectedProviders();
}
项目:intellij-ce-playground    文件:FileEditorManagerTestCase.java   
@Override
protected void tearDown() throws Exception {
  for (DockContainer container : DockManager.getInstance(getProject()).getContainers()) {
    if (!myOldDockContainers.contains(container)) {
      Disposer.dispose(container);
    }
  }
  myOldDockContainers = null;
  ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myOldManager);
  myManager.closeAllFiles();
  ((FileEditorProviderManagerImpl)FileEditorProviderManager.getInstance()).clearSelectedProviders();
  super.tearDown();
}
项目:intellij-ce-playground    文件:NonProjectFileAccessTest.java   
@Override
public void setUp() throws Exception {
  super.setUp();
  EditorNotifications notifications = new EditorNotificationsImpl(getProject());
  ((ComponentManagerImpl)getProject()).registerComponentInstance(EditorNotifications.class, notifications);
  NonProjectFileWritingAccessProvider.enableChecksInTests(getProject(), true);
  ProjectManagerEx.getInstanceEx().blockReloadingProjectOnExternalChanges();
}
项目:intellij    文件:ServiceHelper.java   
public static <T> void registerApplicationComponent(
    Class<T> key, T implementation, Disposable parentDisposable) {
  Application application = ApplicationManager.getApplication();
  if (application instanceof ComponentManagerImpl) {
    replaceComponentInstance(
        (ComponentManagerImpl) application, key, implementation, parentDisposable);
  } else {
    registerComponentInstance(
        (MutablePicoContainer) application.getPicoContainer(),
        key,
        implementation,
        parentDisposable);
  }
}
项目:intellij    文件:ServiceHelper.java   
private static <T> void replaceComponentInstance(
    ComponentManagerImpl componentManager,
    Class<T> key,
    T implementation,
    Disposable parentDisposable) {
  T old = componentManager.registerComponentInstance(key, implementation);
  Disposer.register(parentDisposable, () -> componentManager.registerComponentInstance(key, old));
}
项目:tools-idea    文件:ComponentStoreImpl.java   
@Nullable
private String initJdomExternalizable(@NotNull JDOMExternalizable component) {
  final String componentName = ComponentManagerImpl.getComponentName(component);

  doAddComponent(componentName, component);

  if (optimizeTestLoading()) return componentName;

  loadJdomDefaults(component, componentName);

  StateStorage stateStorage = getOldStorage(component, componentName, StateStorageOperation.READ);

  if (stateStorage == null) return null;
  Element element = getJdomState(component, componentName, stateStorage);

  if (element == null) return null;

  try {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Loading configuration for " + component.getClass());
    }
    component.readExternal(element);
  }
  catch (InvalidDataException e) {
    throw new InvalidComponentDataException(e);
  }

  validateUnusedMacros(componentName, true);

  return componentName;
}
项目:tools-idea    文件:HeavyFileEditorManagerTestCase.java   
public void setUp() throws Exception {
  super.setUp();
  myManager = new FileEditorManagerImpl(getProject(), DockManager.getInstance(getProject()));
  ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myManager);
  ((IdeDocumentHistoryImpl)IdeDocumentHistory.getInstance(getProject())).projectOpened();
  EditorHistoryManager.getInstance(getProject()).projectOpened();
}
项目:tools-idea    文件:FileEditorManagerTestCase.java   
@Override
protected void tearDown() throws Exception {
  ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myOldManager);
  myManager.closeAllFiles();
  ((FileEditorProviderManagerImpl)FileEditorProviderManager.getInstance()).clearSelectedProviders();
  super.tearDown();
}
项目:consulo    文件:HeavyFileEditorManagerTestCase.java   
public void setUp() throws Exception {
  super.setUp();
  myManager = new FileEditorManagerImpl(getProject(), DockManager.getInstance(getProject()));
  ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myManager);
  ((IdeDocumentHistoryImpl)IdeDocumentHistory.getInstance(getProject())).projectOpened();
  EditorHistoryManager.getInstance(getProject()).projectOpened();
}
项目:consulo    文件:FileEditorManagerTestCase.java   
@Override
protected void tearDown() throws Exception {
  ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myOldManager);
  myManager.closeAllFiles();
  ((FileEditorProviderManagerImpl)FileEditorProviderManager.getInstance()).clearSelectedProviders();
  super.tearDown();
}
项目:intellij-ce-playground    文件:ReformatOnlyVcsChangedTextTest.java   
private static void registerChangeListManager(@NotNull ChangeListManager manager) {
  Project project = getProject();
  assert (project instanceof ComponentManagerImpl);
  ComponentManagerImpl projectComponentManager = (ComponentManagerImpl)project;
  projectComponentManager.registerComponentInstance(ChangeListManager.class, manager);
}
项目:intellij-ce-playground    文件:HeavyFileEditorManagerTestCase.java   
public void setUp() throws Exception {
  super.setUp();
  myManager = new FileEditorManagerImpl(getProject(), DockManager.getInstance(getProject()), EditorHistoryManager.getInstance(getProject()));
  ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myManager);
}
项目:tools-idea    文件:ComponentStoreImpl.java   
private static void commitJdomExternalizable(@NotNull final JDOMExternalizable component,
                                             @NotNull StateStorageManager.ExternalizationSession session) {
  final String componentName = ComponentManagerImpl.getComponentName(component);

  session.setStateInOldStorage(component, componentName, component);
}
项目:tools-idea    文件:FileEditorManagerTestCase.java   
public void setUp() throws Exception {
  super.setUp();
  myManager = new FileEditorManagerImpl(getProject(), DockManager.getInstance(getProject()));
  myOldManager = ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myManager);
}
项目:tools-idea    文件:ModuleStoreImpl.java   
@SuppressWarnings({"UnusedDeclaration"})
public ModuleStoreImpl(final ComponentManagerImpl componentManager, final ModuleImpl module) {
  super(componentManager);
  myModule = module;
}
项目:consulo    文件:FileEditorManagerTestCase.java   
public void setUp() throws Exception {
  super.setUp();
  myManager = new FileEditorManagerImpl(getProject(), DockManager.getInstance(getProject()));
  myOldManager = ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myManager);
}
项目:consulo-java    文件:HeavyFileEditorManagerTestCase.java   
public void setUp() throws Exception
{
    super.setUp();
    myManager = new FileEditorManagerImpl(getProject(), DockManager.getInstance(getProject()));
    ((ComponentManagerImpl) getProject()).registerComponentInstance(FileEditorManager.class, myManager);
}