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


Java ProjectSettingsService.getInstance方法代码示例

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


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

示例1: navigate

import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService; //导入方法依赖的package包/类
@Override
public void navigate(final boolean requestFocus) {
  Module module = ModuleUtil.findModuleForPsiElement(getValue());
  if (module != null) {
    final VirtualFile file = getVirtualFile();
    final Project project = getProject();
    ProjectSettingsService service = ProjectSettingsService.getInstance(myProject);
    if (ProjectRootsUtil.isModuleContentRoot(file, project)) {
      service.openModuleSettings(module);
    }
    else if (ProjectRootsUtil.isLibraryRoot(file, project)) {
      final OrderEntry orderEntry = LibraryUtil.findLibraryEntry(file, module.getProject());
      if (orderEntry != null) {
        service.openLibraryOrSdkSettings(orderEntry);
      }
    }
    else {
      service.openContentEntriesSettings(module);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:PsiDirectoryNode.java

示例2: canNavigate

import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService; //导入方法依赖的package包/类
@Override
public boolean canNavigate() {
  VirtualFile file = getVirtualFile();
  Project project = getProject();

  ProjectSettingsService service = ProjectSettingsService.getInstance(myProject);
  return file != null && ((ProjectRootsUtil.isModuleContentRoot(file, project) && service.canOpenModuleSettings()) ||
                          (ProjectRootsUtil.isModuleSourceRoot(file, project)  && service.canOpenContentEntriesSettings()) ||
                          (ProjectRootsUtil.isLibraryRoot(file, project) && service.canOpenModuleLibrarySettings()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:PsiDirectoryNode.java

示例3: execute

import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService; //导入方法依赖的package包/类
@Override
protected void execute(@NotNull Project project) {
  ProjectSettingsService service = ProjectSettingsService.getInstance(project);
  if (service instanceof AndroidProjectSettingsService) {
    ((AndroidProjectSettingsService)service).openAndSelectDependency(myModule, myDependency);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ProjectSyncMessages.java

示例4: actionPerformed

import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  Module module = getTargetModule(e);
  if (module != null) {
    ProjectSettingsService service = ProjectSettingsService.getInstance(module.getProject());
    if (service instanceof AndroidProjectSettingsService) {
      actionPerformed(module, ((AndroidProjectSettingsService)service), e);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:AbstractProjectStructureAction.java

示例5: openSdkSettings

import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService; //导入方法依赖的package包/类
@Nullable
private static OpenProjectStructureHyperlink openSdkSettings(@NotNull Project project, @NotNull String hyperlinkText) {
  ProjectSettingsService service = ProjectSettingsService.getInstance(project);
  if (service instanceof AndroidProjectSettingsService) {
    return new OpenProjectStructureHyperlink(hyperlinkText);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:OpenProjectStructureHyperlink.java

示例6: execute

import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService; //导入方法依赖的package包/类
@Override
protected void execute(@NotNull Project project) {
  ProjectSettingsService service = ProjectSettingsService.getInstance(project);
  if (service instanceof AndroidProjectSettingsService) {
    ((AndroidProjectSettingsService)service).openSdkSettings();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:OpenProjectStructureHyperlink.java

示例7: canNavigate

import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService; //导入方法依赖的package包/类
@Override
public boolean canNavigate() {
  VirtualFile file = getVirtualFile();
  Project project = getProject();

  ProjectSettingsService service = ProjectSettingsService.getInstance(myProject);
  return file != null && ((ProjectRootsUtil.isModuleContentRoot(file, project) && service.canOpenModuleSettings()) ||
                          (ProjectRootsUtil.isSourceOrTestRoot(file, project)  && service.canOpenContentEntriesSettings()) ||
                          (ProjectRootsUtil.isLibraryRoot(file, project) && service.canOpenModuleLibrarySettings()));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:PsiDirectoryNode.java

示例8: hasCorrectJdkVersion

import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService; //导入方法依赖的package包/类
static boolean hasCorrectJdkVersion(@NotNull Module module, @NotNull IdeaAndroidProject model) {
  AndroidProject androidProject = model.getDelegate();
  String compileTarget = androidProject.getCompileTarget();

  AndroidVersion version = AndroidTargetHash.getPlatformVersion(compileTarget);
  if (version != null && version.getFeatureLevel() >= 21) {
    Sdk jdk = IdeSdks.getJdk();
    if (jdk != null && !isApplicableJdk(jdk, LanguageLevel.JDK_1_7)) {
      Project project = module.getProject();

      List<NotificationHyperlink> hyperlinks = Lists.newArrayList();
      hyperlinks.add(new OpenUrlHyperlink(Jdks.DOWNLOAD_JDK_7_URL, "Download JDK 7"));

      ProjectSettingsService service = ProjectSettingsService.getInstance(project);
      if (service instanceof AndroidProjectSettingsService) {
        hyperlinks.add(new SelectJdkHyperlink((AndroidProjectSettingsService)service));
      }
      Message msg;
      String text = "compileSdkVersion " + compileTarget + " requires compiling with JDK 7";
      VirtualFile buildFile = getGradleBuildFile(module);
      String groupName = "Project Configuration";

      if (buildFile != null) {
        int lineNumber = -1;
        int column = -1;
        Document document = FileDocumentManager.getInstance().getDocument(buildFile);
        if (document != null) {
          int offset = findCompileSdkVersionValueOffset(document.getText());
          if (offset > -1) {
            lineNumber = document.getLineNumber(offset);
            if (lineNumber > -1) {
              int lineStartOffset = document.getLineStartOffset(lineNumber);
              column = offset - lineStartOffset;
            }
          }
        }

        hyperlinks.add(new OpenFileHyperlink(buildFile.getPath(), "Open build.gradle File", lineNumber, column));
        msg = new Message(project, groupName, Message.Type.ERROR, buildFile, lineNumber, column, text);
      }
      else {
        msg = new Message(groupName, Message.Type.ERROR, NonNavigatable.INSTANCE, text);
      }

      ProjectSyncMessages messages = ProjectSyncMessages.getInstance(project);
      messages.add(msg, hyperlinks.toArray(new NotificationHyperlink[hyperlinks.size()]));

      setHasWrongJdk(project, true);
      return false;
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:54,代码来源:ProjectJdkChecks.java


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