register JavaCodeStyleSettingsFacade in JavaCoreEnvironment

This commit is contained in:
Dmitry Jemerov
2012-05-08 18:10:53 +02:00
parent 2da821f9e0
commit 9a636bcdae
2 changed files with 56 additions and 2 deletions
@@ -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;
}
}
@@ -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);