本文整理汇总了Java中com.intellij.openapi.roots.LanguageLevelProjectExtension.isDefault方法的典型用法代码示例。如果您正苦于以下问题:Java LanguageLevelProjectExtension.isDefault方法的具体用法?Java LanguageLevelProjectExtension.isDefault怎么用?Java LanguageLevelProjectExtension.isDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.roots.LanguageLevelProjectExtension
的用法示例。
在下文中一共展示了LanguageLevelProjectExtension.isDefault方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reset
import com.intellij.openapi.roots.LanguageLevelProjectExtension; //导入方法依赖的package包/类
public void reset(Project project) {
removeAllItems();
for (LanguageLevel level : LanguageLevel.values()) {
addItem(level);
}
Sdk sdk = ProjectRootManagerEx.getInstanceEx(project).getProjectSdk();
sdkUpdated(sdk);
LanguageLevelProjectExtension extension = LanguageLevelProjectExtension.getInstance(project);
if (getDefaultLevel() != null && extension.isDefault()) {
setSelectedItem(myDefaultItem);
}
else {
setSelectedItem(extension.getLanguageLevel());
}
}
示例2: isModified
import com.intellij.openapi.roots.LanguageLevelProjectExtension; //导入方法依赖的package包/类
@Override
@SuppressWarnings({"SimplifiableIfStatement"})
public boolean isModified() {
LanguageLevelProjectExtension extension = LanguageLevelProjectExtension.getInstance(myProject);
if (!extension.getLanguageLevel().equals(myLanguageLevelCombo.getSelectedLevel()) ||
extension.isDefault() != myLanguageLevelCombo.isDefault()) {
return true;
}
final String compilerOutput = getOriginalCompilerOutputUrl();
if (!Comparing.strEqual(FileUtil.toSystemIndependentName(VfsUtilCore.urlToPath(compilerOutput)),
FileUtil.toSystemIndependentName(myProjectCompilerOutput.getText()))) return true;
if (myProjectJdkConfigurable.isModified()) return true;
if (myProjectName != null) {
if (!myProjectName.getText().trim().equals(myProject.getName())) return true;
}
return false;
}
示例3: applyJdkToProject
import com.intellij.openapi.roots.LanguageLevelProjectExtension; //导入方法依赖的package包/类
public static void applyJdkToProject(@NotNull Project project, @NotNull Sdk jdk) {
ProjectRootManagerEx rootManager = ProjectRootManagerEx.getInstanceEx(project);
rootManager.setProjectSdk(jdk);
JavaSdkVersion version = JavaSdk.getInstance().getVersion(jdk);
if (version != null) {
LanguageLevel maxLevel = version.getMaxLanguageLevel();
LanguageLevelProjectExtension extension = LanguageLevelProjectExtension.getInstance(ProjectManager.getInstance().getDefaultProject());
LanguageLevelProjectExtension ext = LanguageLevelProjectExtension.getInstance(project);
if (extension.isDefault() || maxLevel.compareTo(ext.getLanguageLevel()) < 0) {
ext.setLanguageLevel(maxLevel);
}
}
}