本文整理汇总了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;
}
示例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;
}
示例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);
}