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


Java ModulesProvider类代码示例

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


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

示例1: actionPerformed

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的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: commit

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的package包/类
@Nullable
@Override
public List<Module> commit(Project project,
                           ModifiableModuleModel modifiableModuleModel,
                           ModulesProvider modulesProvider,
                           ModifiableArtifactModel modifiableArtifactModel) {

    logger.debug("Initializing module builder instance.");
    ProcessingModuleBuilder processingModuleBuilder = new ProcessingModuleBuilder();
    processingModuleBuilder.setGenerateTemplateSketchClass(false);

    logger.debug("Creating modules for project '" + project + "' at path '" + getParameters().projectCreationRoot + "'.");

    List<Module> modules = processingModuleBuilder.commit(project, modifiableModuleModel, modulesProvider);

    Collection<VirtualFile> importablePdeFiles = new LinkedList<>(getParameters().importablePdeFiles);

    logger.info("Identified a total of " + importablePdeFiles.size() + " PDE files for import from '" + getParameters().root + "'.");

    ImportSketchClasses importSketchClasses = new ImportSketchClasses(this, project, modules, importablePdeFiles);
    DumbService.getInstance(project).smartInvokeLater(importSketchClasses);

    return modules;
}
 
开发者ID:mistodev,项目名称:processing-idea,代码行数:25,代码来源:ProcessingImportBuilder.java

示例3: importFromSources

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的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

示例4: init

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的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

示例5: findModule

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的package包/类
@Override
@Nullable
public Module findModule(PackagingElementResolvingContext context) {
  if (myModulePointer != null) {
    final Module module = myModulePointer.getModule();
    final ModulesProvider modulesProvider = context.getModulesProvider();
    if (module != null) {
      if (modulesProvider instanceof DefaultModulesProvider//optimization
         || ArrayUtil.contains(module, modulesProvider.getModules())) {
        return module;
      }
    }
    return modulesProvider.getModule(myModulePointer.getModuleName());
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ModuleOutputPackagingElementBase.java

示例6: findLibrary

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的package包/类
@Nullable
public Library findLibrary(@NotNull PackagingElementResolvingContext context) {
  if (myModuleName == null) {
    return context.findLibrary(myLevel, myLibraryName);
  }
  final ModulesProvider modulesProvider = context.getModulesProvider();
  final Module module = modulesProvider.getModule(myModuleName);
  if (module != null) {
    for (OrderEntry entry : modulesProvider.getRootModel(module).getOrderEntries()) {
      if (entry instanceof LibraryOrderEntry) {
        final LibraryOrderEntry libraryEntry = (LibraryOrderEntry)entry;
        if (libraryEntry.isModuleLevel()) {
          final String libraryName = libraryEntry.getLibraryName();
          if (libraryName != null && libraryName.equals(myLibraryName)) {
            return libraryEntry.getLibrary();
          }
        }
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:LibraryPackagingElement.java

示例7: createWizardSteps

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的package包/类
@Override
public ModuleWizardStep[] createWizardSteps(WizardContext wizardContext, ModulesProvider modulesProvider) {
    RoboVmModuleWizardStep wizardStep = new RoboVmModuleWizardStep(this, wizardContext, modulesProvider);

    if (!robovmDir.isEmpty()) {
        wizardStep.disableBuildSystem();
        buildSystem = BuildSystem.Gradle;
    }

    if (!robovmDir.isEmpty() && !RoboVmPlugin.isAndroidSdkSetup()) {
        RoboVmAndroidModuleWizardStep androidStep = new RoboVmAndroidModuleWizardStep(this, wizardContext,
                modulesProvider);
        return new ModuleWizardStep[] { androidStep, wizardStep };
    } else {
        return new ModuleWizardStep[] { wizardStep };
    }
}
 
开发者ID:robovm,项目名称:robovm-idea,代码行数:18,代码来源:RoboVmModuleBuilder.java

示例8: commit

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的package包/类
@Nullable
@Override public List<Module> commit(@NotNull final Project project, final ModifiableModuleModel model,
                                     final ModulesProvider modulesProvider) {
    final LanguageLevelProjectExtension extension =
        LanguageLevelProjectExtension.getInstance(ProjectManager.getInstance().getDefaultProject());
    @Nullable final Boolean aDefault = extension.getDefault();
    final LanguageLevelProjectExtension instance = LanguageLevelProjectExtension.getInstance(project);
    if(aDefault != null && !aDefault) {
        instance.setLanguageLevel(extension.getLanguageLevel());
        instance.setDefault(false);
    } else {
        instance.setDefault(true);
    }

    return super.commit(project, model, modulesProvider);
}
 
开发者ID:metaborg,项目名称:spoofax-intellij,代码行数:17,代码来源:MetaborgModuleBuilder.java

示例9: commit

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的package包/类
@NotNull
@Override
public List<Module> commit(@NotNull UnityModuleImportContext context,
		@NotNull Project project,
		@Nullable ModifiableModuleModel originalModel,
		@NotNull ModulesProvider modulesProvider,
		@Nullable ModifiableArtifactModel artifactModel)
{
	Sdk unitySdk = context.getSdk();
	UnityOpenFilePostHandlerRequest requestor = context.getRequestor();

	boolean fromProjectStructure = originalModel != null;

	final ModifiableModuleModel newModel = fromProjectStructure ? originalModel : ModuleManager.getInstance(project).getModifiableModel();

	Module rootModule = newModel.newModule(project.getName(), project.getBasePath());

	if(!fromProjectStructure)
	{
		WriteAction.run(newModel::commit);
	}

	StartupManager.getInstance(project).registerPostStartupActivity(() -> Unity3dProjectImportUtil.syncProjectStep1(project, unitySdk, requestor, true));
	return Arrays.asList(rootModule);
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:26,代码来源:Unity3dModuleImportProvider.java

示例10: createNewProject

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的package包/类
public static void createNewProject(Project projectToClose, @Nullable final String defaultPath) {
  final boolean proceed = ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
    public void run() {
      ProjectManager.getInstance().getDefaultProject(); //warm up components
    }
  }, ProjectBundle.message("project.new.wizard.progress.title"), true, null);
  if (!proceed) return;
  final AddModuleWizard dialog = Registry.is("new.project.wizard")
                                 ? new AddModuleWizardPro(null, ModulesProvider.EMPTY_MODULES_PROVIDER, defaultPath)
                                 : new AddModuleWizard(null, ModulesProvider.EMPTY_MODULES_PROVIDER, defaultPath);
  dialog.show();
  if (!dialog.isOK()) {
    return;
  }

  createFromWizard(dialog, projectToClose);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:NewProjectUtil.java

示例11: init

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的package包/类
protected void init(@NotNull Project project, @NotNull ModulesProvider modulesProvider) {
        WizardContext myWizardContext = new WizardContext(project);
        myWizardContext.setNewWizard(true);

        // TODO: Would be nice if we could have a setting step open a Dialog to ask for project options!!
//        ProjectSettingsStep settingsStep = new ProjectSettingsStep(myWizardContext);
//        mySequence.addCommonFinishingStep(settingsStep, null);
//        for (ModuleWizardStep step : mySequence.getAllSteps()) {
//            addStep(step);
//        }

        if (myWizardContext.isCreatingNewProject()) {
            createNewProject(project);
        }
        // here or?
        super.init();
    }
 
开发者ID:kristianmandrup,项目名称:emberjs-plugin,代码行数:18,代码来源:NewEmberProjectWizard.java

示例12: findLibrary

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的package包/类
@Nullable
public Library findLibrary(@Nonnull PackagingElementResolvingContext context) {
  if (myModuleName == null) {
    return context.findLibrary(myLevel, myLibraryName);
  }
  final ModulesProvider modulesProvider = context.getModulesProvider();
  final Module module = modulesProvider.getModule(myModuleName);
  if (module != null) {
    for (OrderEntry entry : modulesProvider.getRootModel(module).getOrderEntries()) {
      if (entry instanceof LibraryOrderEntry) {
        final LibraryOrderEntry libraryEntry = (LibraryOrderEntry)entry;
        if (libraryEntry.isModuleLevel()) {
          final String libraryName = libraryEntry.getLibraryName();
          if (libraryName != null && libraryName.equals(myLibraryName)) {
            return libraryEntry.getLibrary();
          }
        }
      }
    }
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:LibraryPackagingElement.java

示例13: createNewProject

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的package包/类
public static void createNewProject(Project projectToClose, @Nullable final String defaultPath) {
  final boolean proceed = ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
    @Override
    public void run() {
      ProjectManager.getInstance().getDefaultProject(); //warm up components
    }
  }, ProjectBundle.message("project.new.wizard.progress.title"), true, null);
  if (!proceed) return;
  final AddModuleWizard dialog = new AddModuleWizard(null, ModulesProvider.EMPTY_MODULES_PROVIDER, defaultPath);
  dialog.show();
  if (!dialog.isOK()) {
    return;
  }

  createFromWizard(dialog, projectToClose);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:NewProjectUtil.java

示例14: init

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的package包/类
protected void init() {
  myWizardContext.setModulesProvider(ModulesProvider.EMPTY_MODULES_PROVIDER);
  MyChooseCourseStep step = new MyChooseCourseStep();
  mySequence.addCommonStep(step);
  mySequence.addCommonFinishingStep(new ProjectSettingsStep(myWizardContext), null);
  mySequence.getAllSteps().forEach(this::addStep);
  super.init();
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:9,代码来源:EduSelectCourseProjectWizard.java

示例15: createWizardSteps

import com.intellij.openapi.roots.ui.configuration.ModulesProvider; //导入依赖的package包/类
@Override
public ModuleWizardStep[] createWizardSteps(@NotNull WizardContext wizardContext,
                                            @NotNull ModulesProvider modulesProvider) {
    ConfigureProcessingProject projectConfig =  new ConfigureProcessingProject(wizardContext);

    ModuleWizardStep[] wizardSteps = new ModuleWizardStep[1];
    wizardSteps[0] = projectConfig;

    return wizardSteps;
}
 
开发者ID:mistodev,项目名称:processing-idea,代码行数:11,代码来源:ProcessingModuleBuilder.java


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