• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ProjectBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.ide.util.projectWizard.ProjectBuilder的典型用法代码示例。如果您正苦于以下问题:Java ProjectBuilder类的具体用法?Java ProjectBuilder怎么用?Java ProjectBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProjectBuilder类属于com.intellij.ide.util.projectWizard包,在下文中一共展示了ProjectBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
    final Project project = getEventProject(anActionEvent);

    if (project == null) {
        return;
    }
    removeOldProjectData(project);

    try {
        collectStatistics();
        final AddModuleWizard wizard = getWizard(project);
        final ProjectBuilder projectBuilder = wizard.getProjectBuilder();

        if (projectBuilder instanceof AbstractHybrisProjectImportBuilder) {
            ((AbstractHybrisProjectImportBuilder) projectBuilder).setRefresh(true);
        }
        projectBuilder.commit(project, null, ModulesProvider.EMPTY_MODULES_PROVIDER);
    } catch (ConfigurationException e) {
        Messages.showErrorDialog(
            anActionEvent.getProject(),
            e.getMessage(),
            HybrisI18NBundleUtils.message("hybris.project.import.error.unable.to.proceed")
        );
    }
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:27,代码来源:ProjectRefreshAction.java


示例2: createLessonContent

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@Override
public PsiDirectory createLessonContent(@NotNull Project project, @NotNull Lesson lesson, @Nullable IdeView view, @NotNull PsiDirectory parentDirectory) {
  NewModuleAction newModuleAction = new NewModuleAction();
  String courseDirPath = parentDirectory.getVirtualFile().getPath();
  Module utilModule = ModuleManager.getInstance(project).findModuleByName(EduIntelliJNames.UTIL);
  if (utilModule == null) {
    return null;
  }
  newModuleAction.createModuleFromWizard(project, null, new AbstractProjectWizard("", project, "") {
    @Override
    public StepSequence getSequence() {
      return null;
    }

    @Override
    public ProjectBuilder getProjectBuilder() {
      return new EduLessonModuleBuilder(courseDirPath, lesson, utilModule);
    }
  });
  return parentDirectory.findSubdirectory(EduNames.LESSON + lesson.getIndex());
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:22,代码来源:EduPluginConfiguratorBase.java


示例3: createFromWizard

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
public static List<Module> createFromWizard(@Nullable Project project, AbstractProjectWizard wizard) {
  if (project == null) {
    Project newProject = NewProjectUtil.createFromWizard(wizard, null);
    return newProject == null ? Collections.<Module>emptyList() : Arrays.asList(ModuleManager.getInstance(newProject).getModules());
  }

  final ProjectBuilder projectBuilder = wizard.getProjectBuilder();
  try {
    if (wizard.getStepCount() > 0) {
      Module module = new NewModuleAction().createModuleFromWizard(project, null, wizard);
      return Collections.singletonList(module);
    }
    else {
      return projectBuilder.commit(project);
    }
  }
  finally {
    if (projectBuilder != null) {
      projectBuilder.cleanup();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ImportModuleAction.java


示例4: createFromWizard

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
public static List<Module> createFromWizard(Project project, AddModuleWizard wizard) {
  if (project == null && wizard.getStepCount() > 0) {
    Project newProject = NewProjectUtil.createFromWizard(wizard, project);
    return newProject == null ? Collections.<Module>emptyList() : Arrays.asList(ModuleManager.getInstance(newProject).getModules());
  }

  final ProjectBuilder projectBuilder = wizard.getProjectBuilder();
  try {
    if (wizard.getStepCount() > 0) {
      Module module = new NewModuleAction().createModuleFromWizard(project, null, wizard);
      return Collections.singletonList(module);
    }
    else {
      return projectBuilder.commit(project);
    }
  }
  finally {
    if (projectBuilder != null) {
      projectBuilder.cleanup();
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:ImportModuleAction.java


示例5: createModuleFromWizard

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@Nullable
public Module createModuleFromWizard(Project project, @Nullable Object dataFromContext, AbstractProjectWizard wizard) {
  final ProjectBuilder builder = wizard.getProjectBuilder();
  if (builder instanceof ModuleBuilder) {
    final ModuleBuilder moduleBuilder = (ModuleBuilder)builder;
    if (moduleBuilder.getName() == null) {
      moduleBuilder.setName(wizard.getProjectName());
    }
    if (moduleBuilder.getModuleFilePath() == null) {
      moduleBuilder.setModuleFilePath(wizard.getModuleFilePath());
    }
  }
  if (!builder.validate(project, project)) {
    return null;
  }
  Module module;
  if (builder instanceof ModuleBuilder) {
    module = ((ModuleBuilder) builder).commitModule(project, null);
    if (module != null) {
      processCreatedModule(module, dataFromContext);
    }
    return module;
  }
  else {
    List<Module> modules = builder.commit(project, null, new DefaultModulesProvider(project));
    if (builder.isOpenProjectSettingsAfter()) {
      ModulesConfigurator.showDialog(project, null, null);
    }
    module = modules == null || modules.isEmpty() ? null : modules.get(0);
  }
  project.save();
  return module;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:NewModuleAction.java


示例6: addModule

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@Nullable
public List<Module> addModule(Component parent, boolean anImport) {
  if (myProject.isDefault()) return null;
  final ProjectBuilder builder = runModuleWizard(parent, anImport);
  if (builder != null ) {
    final List<Module> modules = new ArrayList<Module>();
    DumbService.allowStartingDumbModeInside(DumbModePermission.MAY_START_BACKGROUND, new Runnable() {
      @Override
      public void run() {
        final List<Module> committedModules;
        if (builder instanceof ProjectImportBuilder<?>) {
          final ModifiableArtifactModel artifactModel =
            ProjectStructureConfigurable.getInstance(myProject).getArtifactsStructureConfigurable().getModifiableArtifactModel();
          committedModules = ((ProjectImportBuilder<?>)builder).commit(myProject, myModuleModel, ModulesConfigurator.this, artifactModel);
        }
        else {
          committedModules = builder.commit(myProject, myModuleModel, ModulesConfigurator.this);
        }
        if (committedModules != null) {
          modules.addAll(committedModules);
        }
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          @Override
          public void run() {
            for (Module module : modules) {
              getOrCreateModuleEditor(module);
            }
          }
        });
      }
    });
    return modules;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:ModulesConfigurator.java


示例7: updateStep

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@Override
public void updateStep() {
  ProjectBuilder builder = myContext.getProjectBuilder();
  if (builder instanceof ModuleBuilder) {
    myBuilder.updateFrom((ModuleBuilder)builder);
    ((ModuleBuilder)builder).addModuleConfigurationUpdater(myConfigurationUpdater);
  }
  myFrameworkSupportModel.fireWizardStepUpdated();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SupportForFrameworksStep.java


示例8: getMostRecentSuitableSdk

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@Nullable
public static Sdk getMostRecentSuitableSdk(final WizardContext context) {
  if (context.getProject() == null) {
    @Nullable final ProjectBuilder projectBuilder = context.getProjectBuilder();
    return ProjectJdkTable.getInstance().findMostRecentSdk(new Condition<Sdk>() {
      public boolean value(Sdk sdk) {
        return projectBuilder == null || projectBuilder.isSuitableSdkType(sdk.getSdkType());
      }
    });
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:AddModuleWizard.java


示例9: doCreate

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
private static void doCreate(@NotNull AddModuleWizard wizard) throws IOException {
  // TODO: Now we need to add as module if file does not exist
  ProjectBuilder projectBuilder = wizard.getProjectBuilder();

  try {
    File projectFilePath = new File(wizard.getNewProjectFilePath());
    File projectDirPath = projectFilePath.isDirectory() ? projectFilePath : projectFilePath.getParentFile();
    LOG.assertTrue(projectDirPath != null, "Cannot create project in '" + projectFilePath + "': no parent file exists");
    ensureExists(projectDirPath);

    if (StorageScheme.DIRECTORY_BASED == wizard.getStorageScheme()) {
      File ideaDirPath = new File(projectDirPath, DIRECTORY_STORE_FOLDER);
      ensureExists(ideaDirPath);
    }

    boolean unitTestMode = ApplicationManager.getApplication().isUnitTestMode();
    ProjectManagerEx projectManager = ProjectManagerEx.getInstanceEx();
    Project project = projectManager.newProject(wizard.getProjectName(), projectDirPath.getPath(), true, false);
    if (project == null) {
      return;
    }
    if (!unitTestMode) {
      project.save();
    }
    if (projectBuilder != null) {
      if (!projectBuilder.validate(null, project)) {
        return;
      }
      projectBuilder.commit(project, null, EMPTY_MODULES_PROVIDER);
    }
    if (!unitTestMode) {
      project.save();
    }
  }
  finally {
    if (projectBuilder != null) {
      projectBuilder.cleanup();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:AndroidImportProjectAction.java


示例10: preselectTargetAndBuildApi

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
private void preselectTargetAndBuildApi() {
  // In IntelliJ user chooses SDK entry, which also contains api level, in the first step,
  // so we preselect "compile with" and "target api" options.
  // This code shouldn't be executed in Android Studio: myWizardContext should be null.
  if (myWizardContext != null) {
    final ProjectBuilder builder = myWizardContext.getProjectBuilder();

    if (builder instanceof ModuleBuilder) {
      Sdk sdk = ((ModuleBuilder)builder).getModuleJdk();

      if (sdk == null) {
        sdk = myWizardContext.getProjectJdk();
      }
      if (sdk != null && sdk.getSdkType() instanceof AndroidSdkType) {
        final AndroidPlatform platform = AndroidPlatform.getInstance(sdk);

        if (platform != null) {
          AndroidVersion version = platform.getTarget().getVersion();
          final int apiLevel = version.getFeatureLevel();
          myTemplateState.put(ATTR_TARGET_API, apiLevel);
          myTemplateState.put(ATTR_TARGET_API_STRING, version.getApiString());
          myTemplateState.put(ATTR_BUILD_API, apiLevel);
          myTemplateState.put(ATTR_BUILD_API_STRING, TemplateMetadata.getBuildApiString(version));
          myCompileWith.setEnabled(false);
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:ConfigureAndroidModuleStep.java


示例11: testCreateLibrary

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
public void testCreateLibrary() throws Exception {
  createProjectFromTemplate(AndroidProjectTemplatesFactory.ANDROID, AndroidProjectTemplatesFactory.LIBRARY_MODULE,
                            new Consumer<ModuleWizardStep>() {
                              @Override
                              public void consume(ModuleWizardStep step) {
                                if (step instanceof AndroidModuleWizardStep) {
                                  ProjectBuilder builder = myWizard.getProjectBuilder();
                                  assertTrue(builder instanceof AndroidModuleBuilder);
                                  String name = ((AndroidModuleBuilder)builder).getName();
                                  assertTrue(name, StringUtil.isNotEmpty(name));
                                }
                              }
                            });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AndroidProjectWizardTest.java


示例12: updateDataModel

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@Override
public void updateDataModel() {
    final ProjectBuilder projectBuilder = myContext.getProjectBuilder();
    if (projectBuilder instanceof VueModuleBuilder) {
        ((VueModuleBuilder)projectBuilder).setWizardData(myPeer.getSettings());
    }
}
 
开发者ID:henjue,项目名称:vue-for-idea,代码行数:8,代码来源:VueModuleWizardStep.java


示例13: createModuleFromWizard

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@Nullable
public Module createModuleFromWizard(Project project, @Nullable Object dataFromContext, AddModuleWizard wizard) {
  final ProjectBuilder builder = wizard.getProjectBuilder();
  if (builder instanceof ModuleBuilder) {
    final ModuleBuilder moduleBuilder = (ModuleBuilder)builder;
    if (moduleBuilder.getName() == null) {
      moduleBuilder.setName(wizard.getProjectName());
    }
    if (moduleBuilder.getModuleFilePath() == null) {
      moduleBuilder.setModuleFilePath(wizard.getModuleFilePath());
    }
  }
  if (!builder.validate(project, project)) {
    return null;
  }
  Module module;
  if (builder instanceof ModuleBuilder) {
    module = ((ModuleBuilder) builder).commitModule(project, null);
    if (module != null) {
      processCreatedModule(module, dataFromContext);
    }
    return module;
  }
  else {
    List<Module> modules = builder.commit(project, null, new DefaultModulesProvider(project));
    if (builder.isOpenProjectSettingsAfter()) {
      ModulesConfigurator.showDialog(project, null, null);
    }
    module = modules == null || modules.isEmpty() ? null : modules.get(0);
  }
  project.save();
  return module;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:34,代码来源:NewModuleAction.java


示例14: addModule

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@Nullable
public List<Module> addModule(Component parent, boolean anImport) {
  if (myProject.isDefault()) return null;
  final ProjectBuilder builder = runModuleWizard(parent, anImport);
  if (builder != null ) {
    final List<Module> modules = new ArrayList<Module>();
    final List<Module> commitedModules;
    if (builder instanceof ProjectImportBuilder<?>) {
      final ModifiableArtifactModel artifactModel =
          ProjectStructureConfigurable.getInstance(myProject).getArtifactsStructureConfigurable().getModifiableArtifactModel();
      commitedModules = ((ProjectImportBuilder<?>)builder).commit(myProject, myModuleModel, this, artifactModel);
    }
    else {
      commitedModules = builder.commit(myProject, myModuleModel, this);
    }
    if (commitedModules != null) {
      modules.addAll(commitedModules);
    }
    ApplicationManager.getApplication().runWriteAction(new Runnable() {
       @Override
       public void run() {
         for (Module module : modules) {
           getOrCreateModuleEditor(module);
         }
       }
     });
    return modules;
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:ModulesConfigurator.java


示例15: getDirectoryProjectGenerator

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@NotNull
@Override
public DirectoryProjectGenerator getDirectoryProjectGenerator() {
  return new DirectoryProjectGenerator() {
    @Nls
    @NotNull
    @Override
    public String getName() {
      return "Kotlin Koans generator";
    }

    @Nullable
    @Override
    public Icon getLogo() {
      return KotlinIcons.SMALL_LOGO;
    }

    @Override
    public void generateProject(@NotNull Project project, @NotNull VirtualFile baseDir, @Nullable Object settings, @NotNull Module module) {
      new NewModuleAction().createModuleFromWizard(project, null, new AbstractProjectWizard("", project, baseDir.getPath()) {
        @Override
        public StepSequence getSequence() {
          return null;
        }

        @Override
        public ProjectBuilder getProjectBuilder() {
          return new EduKotlinKoansModuleBuilder(myCourse);
        }
      });
      setJdk(project);
      setCompilerOutput(project);

    }

    @NotNull
    @Override
    public ValidationResult validate(@NotNull String baseDirPath) {
      return ValidationResult.OK;
    }
  };

}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:44,代码来源:EduKotlinCourseProjectGenerator.java


示例16: getModuleBuilder

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@Override
public ProjectBuilder getModuleBuilder() {
  myProjectBuilder.setBaseProjectPath(myPathPanel.getText().trim());
  return myProjectBuilder;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:CreateModuleFromSourcesMode.java


示例17: getModuleBuilder

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
public ProjectBuilder getModuleBuilder() {
  return myProjectBuilder;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:CreateFromSourcesMode.java


示例18: getModuleBuilder

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
public ProjectBuilder getModuleBuilder() {
  return setUpLoader(FileUtil.toSystemIndependentName(myModulePathFieldPanel.getText().trim()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ImportImlMode.java


示例19: getModuleBuilder

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@Nullable
public ProjectBuilder getModuleBuilder() {
  return myBuilder;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ImportMode.java


示例20: getModuleBuilder

import com.intellij.ide.util.projectWizard.ProjectBuilder; //导入依赖的package包/类
@Nullable
public abstract ProjectBuilder getModuleBuilder();
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:WizardMode.java



注:本文中的com.intellij.ide.util.projectWizard.ProjectBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AlipayTradeQueryRequest类代码示例发布时间:2022-05-22
下一篇:
Java ParticleGroup类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap