2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 package com
.intellij
.codeInspection
.ex
;
23 import com
.intellij
.codeInspection
.HTMLComposer
;
24 import com
.intellij
.codeInspection
.SuppressManager
;
25 import com
.intellij
.codeInspection
.lang
.GlobalInspectionContextExtension
;
26 import com
.intellij
.codeInspection
.lang
.HTMLComposerExtension
;
27 import com
.intellij
.codeInspection
.lang
.InspectionExtensionsFactory
;
28 import com
.intellij
.codeInspection
.lang
.RefManagerExtension
;
29 import com
.intellij
.codeInspection
.reference
.RefJavaManagerImpl
;
30 import com
.intellij
.codeInspection
.reference
.RefManager
;
31 import com
.intellij
.codeInspection
.reference
.RefManagerImpl
;
32 import com
.intellij
.openapi
.project
.Project
;
33 import com
.intellij
.psi
.PsiElement
;
34 import org
.jetbrains
.annotations
.Nullable
;
36 public class JavaInspectionExtensionsFactory
extends InspectionExtensionsFactory
{
38 public GlobalInspectionContextExtension
createGlobalInspectionContextExtension() {
39 return new GlobalJavaInspectionContextImpl();
42 public RefManagerExtension
createRefManagerExtension(final RefManager refManager
) {
43 return new RefJavaManagerImpl((RefManagerImpl
)refManager
);
46 public HTMLComposerExtension
createHTMLComposerExtension(final HTMLComposer composer
) {
47 return new HTMLJavaHTMLComposerImpl((HTMLComposerImpl
)composer
);
50 public boolean isToCheckMember(final PsiElement element
, final String id
) {
51 return SuppressManager
.getInstance().getElementToolSuppressedIn(element
, id
) == null;
55 public String
getSuppressedInspectionIdsIn(final PsiElement element
) {
56 return SuppressManager
.getInstance().getSuppressedInspectionIdsIn(element
);
59 public boolean isProjectConfiguredToRunInspections(final Project project
, final boolean online
) {
60 return GlobalJavaInspectionContextImpl
.isInspectionsEnabled(online
, project
);