@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(); }
@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(); }
@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(); }
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); } }
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)); }
@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; }
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(); }
@Override protected void tearDown() throws Exception { ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myOldManager); myManager.closeAllFiles(); ((FileEditorProviderManagerImpl)FileEditorProviderManager.getInstance()).clearSelectedProviders(); super.tearDown(); }
private static void registerChangeListManager(@NotNull ChangeListManager manager) { Project project = getProject(); assert (project instanceof ComponentManagerImpl); ComponentManagerImpl projectComponentManager = (ComponentManagerImpl)project; projectComponentManager.registerComponentInstance(ChangeListManager.class, manager); }
public void setUp() throws Exception { super.setUp(); myManager = new FileEditorManagerImpl(getProject(), DockManager.getInstance(getProject()), EditorHistoryManager.getInstance(getProject())); ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myManager); }
private static void commitJdomExternalizable(@NotNull final JDOMExternalizable component, @NotNull StateStorageManager.ExternalizationSession session) { final String componentName = ComponentManagerImpl.getComponentName(component); session.setStateInOldStorage(component, componentName, component); }
public void setUp() throws Exception { super.setUp(); myManager = new FileEditorManagerImpl(getProject(), DockManager.getInstance(getProject())); myOldManager = ((ComponentManagerImpl)getProject()).registerComponentInstance(FileEditorManager.class, myManager); }
@SuppressWarnings({"UnusedDeclaration"}) public ModuleStoreImpl(final ComponentManagerImpl componentManager, final ModuleImpl module) { super(componentManager); myModule = module; }
public void setUp() throws Exception { super.setUp(); myManager = new FileEditorManagerImpl(getProject(), DockManager.getInstance(getProject())); ((ComponentManagerImpl) getProject()).registerComponentInstance(FileEditorManager.class, myManager); }