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


Java MavenProjectsManager.getExplicitProfiles方法代码示例

本文整理汇总了Java中org.jetbrains.idea.maven.project.MavenProjectsManager.getExplicitProfiles方法的典型用法代码示例。如果您正苦于以下问题:Java MavenProjectsManager.getExplicitProfiles方法的具体用法?Java MavenProjectsManager.getExplicitProfiles怎么用?Java MavenProjectsManager.getExplicitProfiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jetbrains.idea.maven.project.MavenProjectsManager的用法示例。


在下文中一共展示了MavenProjectsManager.getExplicitProfiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkOrPerform

import org.jetbrains.idea.maven.project.MavenProjectsManager; //导入方法依赖的package包/类
private static boolean checkOrPerform(DataContext context, boolean perform) {
  final List<String> goals = MavenDataKeys.MAVEN_GOALS.getData(context);
  if (goals == null || goals.isEmpty()) return false;

  final Project project = MavenActionUtil.getProject(context);
  if(project == null) return false;
  final MavenProject mavenProject = MavenActionUtil.getMavenProject(context);
  if (mavenProject == null) return false;

  if (!perform) return true;

  final MavenProjectsManager projectsManager = MavenActionUtil.getProjectsManager(context);
  if(projectsManager == null) return false;
  MavenExplicitProfiles explicitProfiles = projectsManager.getExplicitProfiles();
  final MavenRunnerParameters params = new MavenRunnerParameters(true,
                                                                 mavenProject.getDirectory(),
                                                                 goals,
                                                                 explicitProfiles.getEnabledProfiles(),
                                                                 explicitProfiles.getDisabledProfiles());
  MavenRunConfigurationType.runConfiguration(project, params, null);

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

示例2: getTargetState

import org.jetbrains.idea.maven.project.MavenProjectsManager; //导入方法依赖的package包/类
@Nullable
private static MavenProfileKind getTargetState(@NotNull MavenProjectsManager projectsManager, Map<String, MavenProfileKind> profiles) {
  MavenExplicitProfiles explicitProfiles = projectsManager.getExplicitProfiles();
  MavenProfileKind targetState = null;
  // all profiles should target to the same state
  for (Map.Entry<String, MavenProfileKind> profile : profiles.entrySet()) {
    MavenProfileKind profileTargetState = getTargetState(profile, explicitProfiles);
    if (targetState == null) {
      targetState = profileTargetState;
    }
    else if (!targetState.equals(profileTargetState)) {
      targetState = null;
      break;
    }
  }
  return targetState;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ToggleProfileAction.java

示例3: actionPerformed

import org.jetbrains.idea.maven.project.MavenProjectsManager; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  final DataContext context = e.getDataContext();
  final Project project = MavenActionUtil.getProject(context);
  if (project == null) return;

  final MavenProjectsManager projectsManager = MavenActionUtil.getProjectsManager(context);
  if(projectsManager == null) return;
  MavenExplicitProfiles explicitProfiles = projectsManager.getExplicitProfiles();
  MavenRunnerParameters params = new MavenRunnerParameters(true,
                                                           myMavenProject.getDirectory(),
                                                           Collections.singletonList(myGoal),
                                                           explicitProfiles.getEnabledProfiles(),
                                                           explicitProfiles.getDisabledProfiles());
  MavenRunConfigurationType.runConfiguration(project, params, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:MavenKeymapExtension.java


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