当前位置: 首页>>代码示例>>Java>>正文


Java ModuleWizardStep类代码示例

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


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

示例1: getWizard

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
private AddModuleWizard getWizard(final Project project) throws ConfigurationException {
    final HybrisProjectImportProvider provider = getHybrisProjectImportProvider();
    final String basePath = project.getBasePath();
    final String projectName = project.getName();
    final Sdk jdk = ProjectRootManager.getInstance(project).getProjectSdk();
    final String compilerOutputUrl = CompilerProjectExtension.getInstance(project).getCompilerOutputUrl();
    final HybrisProjectSettings settings = HybrisProjectSettingsComponent.getInstance(project).getState();

    final AddModuleWizard wizard = new AddModuleWizard(null, basePath, provider) {

        protected void init() {
            // non GUI mode
        }
    };
    final WizardContext wizardContext = wizard.getWizardContext();
    wizardContext.setProjectJdk(jdk);
    wizardContext.setProjectName(projectName);
    wizardContext.setCompilerOutputDirectory(compilerOutputUrl);
    final StepSequence stepSequence = wizard.getSequence();
    for (ModuleWizardStep step : stepSequence.getAllSteps()) {
        if (step instanceof NonGuiSupport) {
            ((NonGuiSupport) step).nonGuiModeImport(settings);
        }
    }
    return wizard;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:27,代码来源:ProjectRefreshAction.java

示例2: importFromSources

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
protected void importFromSources(File dir) {
  myRootDir = dir;
  try {
    myProject = doCreateProject(getIprFile());
    myBuilder.setBaseProjectPath(dir.getAbsolutePath());
    List<DetectedRootData> list = RootDetectionProcessor.detectRoots(dir);
    MultiMap<ProjectStructureDetector,DetectedProjectRoot> map = RootDetectionProcessor.createRootsMap(list);
    myBuilder.setupProjectStructure(map);
    for (ProjectStructureDetector detector : map.keySet()) {
      List<ModuleWizardStep> steps = detector.createWizardSteps(myBuilder, myBuilder.getProjectDescriptor(detector), EmptyIcon.ICON_16);
      for (ModuleWizardStep step : steps) {
        if (step instanceof AbstractStepWithProgress<?>) {
          performStep((AbstractStepWithProgress<?>)step);
        }
      }
    }
    myBuilder.commit(myProject, null, ModulesProvider.EMPTY_MODULES_PROVIDER);
  }
  catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ImportFromSourcesTestCase.java

示例3: runWizard

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
protected void runWizard(@Nullable Consumer<Step> adjuster) {
  while (true) {
    ModuleWizardStep currentStep = myWizard.getCurrentStepObject();
    if (adjuster != null) {
      adjuster.consume(currentStep);
    }
    if (myWizard.isLast()) {
      break;
    }
    myWizard.doNextAction();
    if (currentStep == myWizard.getCurrentStepObject()) {
      throw new RuntimeException(currentStep + " is not validated");
    }
  }
  myWizard.doFinishAction();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ProjectWizardTestCase.java

示例4: getSelectedSteps

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
public List<ModuleWizardStep> getSelectedSteps() {
  if (mySelectedSteps == null) {
    mySelectedSteps = new ArrayList<ModuleWizardStep>();
    mySelectedSteps.addAll(myCommonSteps);
    for (String type : myTypes) {
      Collection<ModuleWizardStep> steps = mySpecificSteps.get(type);
      mySelectedSteps.addAll(steps);
    }
    for (Pair<ModuleWizardStep, Set<String>> pair : myCommonFinishingSteps) {
      Set<String> types = pair.getSecond();
      if (types == null || ContainerUtil.intersects(myTypes, types)) {
        mySelectedSteps.add(pair.getFirst());
      }
    }
    ContainerUtil.removeDuplicates(mySelectedSteps);
  }

  return mySelectedSteps;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:StepSequence.java

示例5: getNextStep

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
@Override
protected final int getNextStep(final int step) {
  ModuleWizardStep nextStep = null;
  final StepSequence stepSequence = getSequence();
  if (stepSequence != null) {
    ModuleWizardStep current = mySteps.get(step);
    if (isStepWithNotCompletedSubSteps(current)) {
      return step;
    }

    nextStep = stepSequence.getNextStep(current);
    while (nextStep != null && !nextStep.isStepVisible()) {
      nextStep = stepSequence.getNextStep(nextStep);
    }
  }
  return nextStep == null ? step : mySteps.indexOf(nextStep);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:AbstractProjectWizard.java

示例6: getPreviousStep

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
@Override
protected final int getPreviousStep(final int step) {
    ModuleWizardStep previousStep = null;
    final StepSequence stepSequence = getSequence();
    if (stepSequence != null) {
      final ModuleWizardStep current = mySteps.get(step);
      if (isNotFirstSubStepInStep(current)) {
        return step;
      }

      previousStep = stepSequence.getPreviousStep(current);
      while (previousStep != null && !previousStep.isStepVisible()) {
        previousStep = stepSequence.getPreviousStep(previousStep);
      }
    }
    return previousStep == null ? 0 : mySteps.indexOf(previousStep);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:AbstractProjectWizard.java

示例7: init

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
protected void init(@NotNull ModulesProvider modulesProvider) {
  myWizardContext.setNewWizard(true);
  myWizardContext.setModulesProvider(modulesProvider);
  ProjectTypeStep projectTypeStep = new ProjectTypeStep(myWizardContext, this, modulesProvider);
  Disposer.register(getDisposable(), projectTypeStep);
  mySequence.addCommonStep(projectTypeStep);
  ChooseTemplateStep chooseTemplateStep = new ChooseTemplateStep(myWizardContext, projectTypeStep);
  mySequence.addCommonStep(chooseTemplateStep);
  mySequence.addCommonFinishingStep(new ProjectSettingsStep(myWizardContext), null);
  for (ModuleWizardStep step : mySequence.getAllSteps()) {
    addStep(step);
  }
  if (myWizardContext.isCreatingNewProject()) {
    projectTypeStep.loadRemoteTemplates(chooseTemplateStep);
  }
  super.init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:NewProjectWizard.java

示例8: modifySettingsStep

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
@Nullable
@Override
public ModuleWizardStep modifySettingsStep(@NotNull SettingsStep settingsStep) {
  if (myTemplate == null) {
    return super.modifySettingsStep(settingsStep);
  }
  final WebProjectGenerator.GeneratorPeer peer = myTemplate.getPeer();
  peer.buildUI(settingsStep);
  return new ModuleWizardStep() {
    @Override
    public JComponent getComponent() {
      return null;
    }

    @Override
    public void updateDataModel() {
    }

    @Override
    public boolean validate() throws ConfigurationException {
      ValidationInfo info = peer.validate();
      if (info != null) throw new ConfigurationException(info.message);
      return true;
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:WebModuleBuilder.java

示例9: modifySettingsStep

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
@Nullable
@Override
public ModuleWizardStep modifySettingsStep(@NotNull final SettingsStep settingsStep) {
  if (myProjectType == null) {
    return super.modifyProjectTypeStep(settingsStep);
  }
  switch (myProjectType) {

    case APPLICATION:
      return new AndroidApplicationModifiedSettingsStep(this, settingsStep);
    case LIBRARY:
      return new AndroidLibraryModifiedSettingsStep(this, settingsStep);
    case TEST:
      return new AndroidTestModifiedSettingsStep(this, settingsStep);
    default:
      LOG.error("Unknown project type " + myProjectType);
      return super.modifyProjectTypeStep(settingsStep);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AndroidModuleBuilder.java

示例10: createSteps

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
@Override
public ModuleWizardStep[] createSteps(WizardContext context) {
  if (myProjectImport) {
    return new ModuleWizardStep[]{
      new AdtImportLocationStep(context),
      new AdtImportPrefsStep(context),
      new AdtWorkspaceForm(context),
      new AdtImportSdkStep(context),
      new AdtRepositoriesStep(context),
      new AdtImportWarningsStep(context)
    };
  } else {
    return new ModuleWizardStep[]{
      new AdtImportPrefsStep(context),
      new AdtWorkspaceForm(context),
      new AdtImportSdkStep(context),
      new AdtRepositoriesStep(context),
      new AdtImportWarningsStep(context)
    };
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:AdtImportProvider.java

示例11: WrapArchiveWizardPath

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
public WrapArchiveWizardPath(@NotNull NewModuleWizardState wizardState,
                             @Nullable Project project,
                             @Nullable final TemplateWizardStep.UpdateListener listener,
                             @Nullable Icon sidePanelIcon) {
  myWizardState = wizardState;
  myProject = project;
  steps = Collections.<ModuleWizardStep>singleton(new WrapArchiveOptionsStep(project, wizardState, sidePanelIcon));
  if (listener != null) {
    for (ModuleWizardStep step : steps) {
      step.registerStepListener(new StepListener() {
        @Override
        public void stateChanged() {
          listener.update();
        }
      });
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:WrapArchiveWizardPath.java

示例12: ImportSourceModulePath

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
public ImportSourceModulePath(@Nullable VirtualFile importSource,
                              @NotNull NewModuleWizardState wizardState,
                              @NotNull WizardContext context,
                              @Nullable Icon sidePanelIcon,
                              @Nullable TemplateWizardStep.UpdateListener listener) {
  myWizardState = wizardState;
  myContext = context;
  List<ModuleWizardStep> steps = Lists.newLinkedList();
  ImportSourceLocationStep locationStep = new ImportSourceLocationStep(context, importSource,
                                                                       wizardState, sidePanelIcon, listener);
  steps.add(locationStep);
  for (ModuleImporter importer : ModuleImporter.getAllImporters(myContext)) {
    steps.addAll(importer.createWizardSteps());
  }
  mySteps = steps;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ImportSourceModulePath.java

示例13: testConstructor

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
public void testConstructor() throws Exception {
  // Null project means creating a new project
  TemplateWizardModuleBuilder moduleBuilder1 = new TemplateWizardModuleBuilder(
      null, null, null, null, new ArrayList<ModuleWizardStep>(), getTestRootDisposable(), false);
  assertTrue(moduleBuilder1.myWizardState.getBoolean(ATTR_IS_LAUNCHER));
  assertEquals(NewProjectWizardState.getProjectFileDirectory(), moduleBuilder1.myWizardState.get(ATTR_PROJECT_LOCATION));
  assertDoesntContain(moduleBuilder1.myWizardState.myHidden, ATTR_MODULE_NAME);

  assertNotNull(moduleBuilder1.myWizardState.get(ATTR_GRADLE_VERSION));
  assertNotNull(moduleBuilder1.myWizardState.get(ATTR_GRADLE_PLUGIN_VERSION));

  assertEquals(AssetStudioAssetGenerator.AssetType.LAUNCHER.name(), moduleBuilder1.myWizardState.getString(ATTR_ASSET_TYPE));
  assertTrue(moduleBuilder1.myInitializationComplete);

  // Non-null project means we're adding a module to an existing project
  TemplateWizardModuleBuilder moduleBuilder2 = new TemplateWizardModuleBuilder(
      null, null, getProject(), null, new ArrayList<ModuleWizardStep>(), getTestRootDisposable(), true);
  assertFalse(moduleBuilder2.myWizardState.getBoolean(ATTR_IS_LAUNCHER));
  assertContainsElements(moduleBuilder2.myWizardState.myHidden, ATTR_MODULE_NAME);

  assertNotNull(moduleBuilder2.myWizardState.get(ATTR_PROJECT_LOCATION));
  assertEquals(FileUtil.toSystemIndependentName(getProject().getBasePath()),
               moduleBuilder2.myWizardState.getString(ATTR_PROJECT_LOCATION));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:TemplateWizardModuleBuilderTest.java

示例14: setUpModuleCreator

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
private TemplateWizardModuleBuilder setUpModuleCreator(String templateName) {
  myProjectRoot = new File(getProject().getBasePath());
  File templateFile = new File(TemplateManager.getTemplateRootFolder(),
                               FileUtil.join(CATEGORY_PROJECTS, templateName));
  assertTrue(templateFile.exists());

  final TemplateWizardModuleBuilder moduleBuilder = new TemplateWizardModuleBuilder(
    templateFile, null, getProject(), null, new ArrayList<ModuleWizardStep>(), getTestRootDisposable(), false);

  moduleBuilder.myWizardState.put(ATTR_IS_LIBRARY_MODULE, false);
  moduleBuilder.myWizardState.put(ATTR_PACKAGE_NAME, "com.test.foo");
  moduleBuilder.myWizardState.put(ATTR_CREATE_ACTIVITY, false);
  moduleBuilder.myWizardState.put(ATTR_MODULE_NAME, "app");
  moduleBuilder.myWizardState.put(ATTR_CREATE_ICONS, false);

  return moduleBuilder;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:TemplateWizardModuleBuilderTest.java

示例15: modifySettingsStep

import com.intellij.ide.util.projectWizard.ModuleWizardStep; //导入依赖的package包/类
@Nullable
@Override
public ModuleWizardStep modifySettingsStep(@NotNull SettingsStep settingsStep) {
  if (settingsStep instanceof ProjectSettingsStep) {
    final ProjectSettingsStep projectSettingsStep = (ProjectSettingsStep)settingsStep;
    if (myProjectId != null) {
      final JTextField moduleNameField = settingsStep.getModuleNameField();
      if (moduleNameField != null) {
        moduleNameField.setText(myProjectId.getArtifactId());
      }
      projectSettingsStep.setModuleName(myProjectId.getArtifactId());
    }
    projectSettingsStep.bindModuleSettings();
  }
  return super.modifySettingsStep(settingsStep);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:GradleModuleBuilder.java


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