com.intellij.openapi.components.StorageScheme Java Examples
The following examples show how to use
com.intellij.openapi.components.StorageScheme.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlazeProjectCreator.java From intellij with Apache License 2.0 | 4 votes |
private void doCreate() throws IOException { String projectFilePath = wizardContext.getProjectFileDirectory(); File projectDir = new File(projectFilePath).getParentFile(); logger.assertTrue( projectDir != null, "Cannot create project in '" + projectFilePath + "': no parent file exists"); FileUtil.ensureExists(projectDir); if (wizardContext.getProjectStorageFormat() == StorageScheme.DIRECTORY_BASED) { final File ideaDir = new File(projectFilePath, Project.DIRECTORY_STORE_FOLDER); FileUtil.ensureExists(ideaDir); } String name = wizardContext.getProjectName(); Project newProject = projectBuilder.createProject(name, projectFilePath); if (newProject == null) { return; } if (!ApplicationManager.getApplication().isUnitTestMode()) { newProject.save(); } if (!projectBuilder.validate(null, newProject)) { return; } projectBuilder.commit(newProject, null, ModulesProvider.EMPTY_MODULES_PROVIDER); StartupManager.getInstance(newProject) .registerPostStartupActivity( () -> { // ensure the dialog is shown after all startup activities are done //noinspection SSBasedInspection SwingUtilities.invokeLater( () -> { if (newProject.isDisposed() || ApplicationManager.getApplication().isUnitTestMode()) { return; } ApplicationManager.getApplication() .invokeLater( () -> { if (newProject.isDisposed()) { return; } final ToolWindow toolWindow = ToolWindowManager.getInstance(newProject) .getToolWindow(ToolWindowId.PROJECT_VIEW); if (toolWindow != null) { toolWindow.activate(null); } }, ModalityState.NON_MODAL); }); }); ProjectUtil.updateLastProjectLocation(projectFilePath); if (WindowManager.getInstance().isFullScreenSupportedInCurrentOS()) { IdeFocusManager instance = IdeFocusManager.findInstance(); IdeFrame lastFocusedFrame = instance.getLastFocusedFrame(); if (lastFocusedFrame instanceof IdeFrameEx) { boolean fullScreen = ((IdeFrameEx) lastFocusedFrame).isInFullScreen(); if (fullScreen) { newProject.putUserData(IdeFrameImpl.SHOULD_OPEN_IN_FULL_SCREEN, Boolean.TRUE); } } } BaseSdkCompat.openProject(newProject, Paths.get(projectFilePath)); if (!ApplicationManager.getApplication().isUnitTestMode()) { SaveAndSyncHandler.getInstance().scheduleProjectSave(newProject); } }