@NotNull @Override public IProjectStore getStateStore() { IProjectStore componentStore = myComponentStore; if (componentStore != null) return componentStore; synchronized (this) { componentStore = myComponentStore; if (componentStore == null) { myComponentStore = componentStore = (IProjectStore)getPicoContainer().getComponentInstance(IComponentStore.class); } return componentStore; } }
@Override protected void bootstrapPicoContainer(@NotNull String name) { Extensions.instantiateArea(ExtensionAreas.IDEA_MODULE, this, (AreaInstance)getParentComponentManager()); super.bootstrapPicoContainer(name); getPicoContainer().registerComponentImplementation(IComponentStore.class, ModuleStoreImpl.class); getPicoContainer().registerComponentImplementation(ModulePathMacroManager.class); }
@NotNull public synchronized IModuleStore getStateStore() { if (myComponentStore == null) { myComponentStore = (IModuleStore)getPicoContainer().getComponentInstance(IComponentStore.class); } return myComponentStore; }
@NotNull Class<? extends IComponentStore> getProjectStoreClass(boolean isDefaultProject);
@NotNull @Deprecated public IComponentStore getStateStore() { return ServiceKt.getStateStore(this); }
@Override public void initializeComponent(@NotNull Object component, boolean service) { if (!service || !(component instanceof PathMacroManager || component instanceof IComponentStore)) { ServiceKt.getStateStore(this).initComponent(component, service); } }
public static boolean isDirectoryBased(@NotNull Project project) { IComponentStore store = ServiceKt.getStateStore(project); return store instanceof IProjectStore && StorageScheme.DIRECTORY_BASED.equals(((IProjectStore)store).getStorageScheme()); }
public void reloadProjectImpl(@NotNull final Project p, final boolean clearCopyToRestore) { if (clearCopyToRestore) { mySavedCopies.clear(); mySavedTimestamps.clear(); } final Project[] project = {p}; ProjectReloadState.getInstance(project[0]).onBeforeAutomaticProjectReload(); final Application application = ApplicationManager.getApplication(); application.invokeLater(new Runnable() { @Override public void run() { LOG.debug("Reloading project."); ProjectImpl projectImpl = (ProjectImpl)project[0]; if (projectImpl.isDisposed()) return; IProjectStore projectStore = projectImpl.getStateStore(); final String location = projectImpl.getPresentableUrl(); final List<IFile> original; try { final IComponentStore.SaveSession saveSession = projectStore.startSave(); original = saveSession.getAllStorageFiles(true); saveSession.finishSave(); } catch (IOException e) { LOG.error(e); return; } if (project[0].isDisposed() || ProjectUtil.closeAndDispose(project[0])) { application.runWriteAction(new Runnable() { @Override public void run() { for (final IFile originalFile : original) { restoreCopy(LocalFileSystem.getInstance().refreshAndFindFileByIoFile(originalFile)); } } }); project[0] = null; // Let it go. ProjectUtil.openProject(location, null, true); } } }, ModalityState.NON_MODAL); }
@Override protected void bootstrapPicoContainer(@Nonnull String name) { super.bootstrapPicoContainer(name); getPicoContainer().registerComponentImplementation(IComponentStore.class, ApplicationStoreImpl.class); getPicoContainer().registerComponentImplementation(ApplicationPathMacroManager.class); }
@Nonnull @Override public IApplicationStore getStateStore() { return (IApplicationStore)getPicoContainer().getComponentInstance(IComponentStore.class); }
@Override @Nonnull public IApplicationStore getStateStore() { return (IApplicationStore)getPicoContainer().getComponentInstance(IComponentStore.class); }
Class<? extends IComponentStore> getProjectStoreClass(final boolean isDefaultProject);