This commit is contained in:
Roman Shevchenko
2011-06-01 12:03:15 +04:00
parent 9bd7e35085
commit 462af9fd64
4 changed files with 27 additions and 17 deletions
@@ -459,7 +459,7 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
final PsiElement nameElement = ref.getReferenceNameElement();
assert nameElement != null : ref;
final HighlightInfo info = HighlightInfo.createHighlightInfo(HighlightInfoType.WRONG_REF, nameElement, description);
QuickFixAction.registerQuickFixAction(info, SetupJDKFix.getInstnace());
QuickFixAction.registerQuickFixAction(info, SetupJDKFix.getInstance());
myHolder.add(info);
}
else {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2011 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.
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.NotNull;
public class DefaultQuickFixProvider extends UnresolvedReferenceQuickFixProvider<PsiJavaCodeReferenceElement> {
public void registerFixes(PsiJavaCodeReferenceElement ref, QuickFixActionRegistrar registrar) {
registrar.register(new ImportClassFix(ref));
registrar.register(SetupJDKFix.getInstnace());
registrar.register(SetupJDKFix.getInstance());
OrderEntryFix.registerFixes(registrar, ref);
MoveClassToModuleFix.registerFixes(registrar, ref);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2011 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.
@@ -13,15 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Created by IntelliJ IDEA.
* User: mike
* Date: Aug 20, 2002
* Time: 8:49:24 PM
* To change template for new class use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package com.intellij.codeInsight.daemon.impl.quickfix;
import com.intellij.codeInsight.daemon.QuickFixBundle;
@@ -40,14 +31,17 @@ import com.intellij.psi.JavaPsiFacade;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
/**
* @author mike
* Date: Aug 20, 2002
*/
public class SetupJDKFix implements IntentionAction, HighPriorityAction {
private static final SetupJDKFix ourInstance = new SetupJDKFix();
public static SetupJDKFix getInstnace() {
public static SetupJDKFix getInstance() {
return ourInstance;
}
private SetupJDKFix() {
}
private SetupJDKFix() { }
@NotNull
public String getText() {
@@ -1,4 +1,20 @@
/*
* Copyright 2000-2011 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.
*/
/*
* User: anna
* Date: 05-Feb-2007
@@ -37,7 +53,7 @@ public class DefaultResourceBundleManager extends ResourceBundleManager {
if (getResourceBundle() != null) {
return true;
}
throw new ResourceBundleNotFoundException(CodeInsightBundle.message("i18nize.dialog.error.jdk.message"), SetupJDKFix.getInstnace());
throw new ResourceBundleNotFoundException(CodeInsightBundle.message("i18nize.dialog.error.jdk.message"), SetupJDKFix.getInstance());
}
public boolean canShowJavaCodeInfo() {