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