From 9a636bcdae1e8a287454da0a0443861b0c8b9a16 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 8 May 2012 18:10:53 +0200 Subject: [PATCH] register JavaCodeStyleSettingsFacade in JavaCoreEnvironment --- .../core/CoreJavaCodeStyleSettingsFacade.java | 53 +++++++++++++++++++ .../intellij/core/JavaCoreEnvironment.java | 5 +- 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 java/java-psi-impl/src/com/intellij/core/CoreJavaCodeStyleSettingsFacade.java diff --git a/java/java-psi-impl/src/com/intellij/core/CoreJavaCodeStyleSettingsFacade.java b/java/java-psi-impl/src/com/intellij/core/CoreJavaCodeStyleSettingsFacade.java new file mode 100644 index 000000000000..53f481221e4e --- /dev/null +++ b/java/java-psi-impl/src/com/intellij/core/CoreJavaCodeStyleSettingsFacade.java @@ -0,0 +1,53 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.core; + +import com.intellij.psi.codeStyle.JavaCodeStyleSettingsFacade; + +/** + * @author yole + */ +public class CoreJavaCodeStyleSettingsFacade extends JavaCodeStyleSettingsFacade { + @Override + public int getNamesCountToUseImportOnDemand() { + return 0; + } + + @Override + public boolean useFQClassNames() { + return false; + } + + @Override + public boolean isJavaDocLeadingAsterisksEnabled() { + return false; + } + + @Override + public int getIndentSize() { + return 4; + } + + @Override + public boolean isGenerateFinalParameters() { + return false; + } + + @Override + public boolean isGenerateFinalLocals() { + return false; + } +} diff --git a/java/java-psi-impl/src/com/intellij/core/JavaCoreEnvironment.java b/java/java-psi-impl/src/com/intellij/core/JavaCoreEnvironment.java index d6f0e06de710..46aa4080730f 100644 --- a/java/java-psi-impl/src/com/intellij/core/JavaCoreEnvironment.java +++ b/java/java-psi-impl/src/com/intellij/core/JavaCoreEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,13 +24,13 @@ import com.intellij.lang.java.JavaLanguage; import com.intellij.lang.java.JavaParserDefinition; import com.intellij.openapi.Disposable; import com.intellij.openapi.extensions.Extensions; -import com.intellij.openapi.projectRoots.JavaSdkVersion; import com.intellij.openapi.projectRoots.JavaVersionService; import com.intellij.openapi.roots.LanguageLevelProjectExtension; import com.intellij.openapi.roots.PackageIndex; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; import com.intellij.psi.augment.PsiAugmentProvider; +import com.intellij.psi.codeStyle.JavaCodeStyleSettingsFacade; import com.intellij.psi.impl.EmptySubstitutorImpl; import com.intellij.psi.impl.JavaPsiFacadeImpl; import com.intellij.psi.impl.JavaPsiImplementationHelper; @@ -78,6 +78,7 @@ public class JavaCoreEnvironment extends CoreEnvironment { myProject.registerService(LanguageLevelProjectExtension.class, new CoreLanguageLevelProjectExtension()); myProject.registerService(PackageIndex.class, myFileManager); myProject.registerService(JavaResolveCache.class, new JavaResolveCache(null)); + myProject.registerService(JavaCodeStyleSettingsFacade.class, new CoreJavaCodeStyleSettingsFacade()); JavaPsiFacadeImpl javaPsiFacade = new JavaPsiFacadeImpl(myProject, myPsiManager, myFileManager, null); myProject.registerService(CoreJavaFileManager.class, myFileManager);