diff --git a/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java b/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java index 3172e68918a9..be3122d57e7d 100644 --- a/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java +++ b/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -223,7 +223,7 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{ } @Override - protected boolean isSearchForTextOccurencesAvailable(@NotNull PsiElement psiElement, boolean isSingleFile) { + protected boolean isSearchForTextOccurrencesAvailable(@NotNull PsiElement psiElement, boolean isSingleFile) { return !isSingleFile && new JavaNonCodeSearchElementDescriptionProvider().getElementDescription(psiElement, NonCodeSearchDescriptionLocation.NON_JAVA) != null; } diff --git a/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesHandler.java b/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesHandler.java index cb449f9602b7..e4a4d9180db3 100644 --- a/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesHandler.java +++ b/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -41,7 +41,7 @@ import java.util.Collections; /** * @author peter - * @see com.intellij.find.findUsages.FindUsagesHandlerFactory + * @see FindUsagesHandlerFactory */ public abstract class FindUsagesHandler { // return this handler if you want to cancel the search @@ -57,8 +57,8 @@ public abstract class FindUsagesHandler { @NotNull public AbstractFindUsagesDialog getFindUsagesDialog(boolean isSingleFile, boolean toShowInNewTab, boolean mustOpenInNewTab) { - return new CommonFindUsagesDialog(myPsiElement, getProject(), getFindUsagesOptions(DataManager.getInstance().getDataContext()), - toShowInNewTab, mustOpenInNewTab, isSingleFile, this); + @SuppressWarnings("deprecation") DataContext ctx = DataManager.getInstance().getDataContext(); + return new CommonFindUsagesDialog(myPsiElement, getProject(), getFindUsagesOptions(ctx), toShowInNewTab, mustOpenInNewTab, isSingleFile, this); } @NotNull @@ -102,7 +102,7 @@ public abstract class FindUsagesHandler { @NotNull public FindUsagesOptions getFindUsagesOptions(@Nullable final DataContext dataContext) { FindUsagesOptions options = createFindUsagesOptions(getProject(), dataContext); - options.isSearchForTextOccurrences &= isSearchForTextOccurencesAvailable(getPsiElement(), false); + options.isSearchForTextOccurrences &= isSearchForTextOccurrencesAvailable(getPsiElement(), false); return options; } @@ -165,6 +165,13 @@ public abstract class FindUsagesHandler { return Collections.singleton(element.getText()); } + @SuppressWarnings("deprecation") + protected boolean isSearchForTextOccurrencesAvailable(@NotNull PsiElement psiElement, boolean isSingleFile) { + return isSearchForTextOccurencesAvailable(psiElement, isSingleFile); + } + + /** @deprecated use/override {@link #isSearchForTextOccurrencesAvailable(PsiElement, boolean)} instead (to be removed in IDEA 18) */ + @SuppressWarnings({"SpellCheckingInspection", "UnusedParameters"}) protected boolean isSearchForTextOccurencesAvailable(@NotNull PsiElement psiElement, boolean isSingleFile) { return false; } @@ -236,7 +243,7 @@ public abstract class FindUsagesHandler { } @Override - protected boolean isSearchForTextOccurencesAvailable(@NotNull PsiElement psiElement, boolean isSingleFile) { + protected boolean isSearchForTextOccurrencesAvailable(@NotNull PsiElement psiElement, boolean isSingleFile) { throw new IncorrectOperationException(); } diff --git a/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesUtil.java b/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesUtil.java index 1521f72e0d61..c32ba7813a42 100644 --- a/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesUtil.java +++ b/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package com.intellij.find.findUsages; import com.intellij.psi.PsiElement; @@ -21,10 +20,9 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public class FindUsagesUtil { - private FindUsagesUtil() { - } + private FindUsagesUtil() { } public static boolean isSearchForTextOccurrencesAvailable(@NotNull PsiElement element, boolean isSingleFile, @Nullable FindUsagesHandler handler) { - return !isSingleFile && handler != null && handler.isSearchForTextOccurencesAvailable(element, isSingleFile); + return !isSingleFile && handler != null && handler.isSearchForTextOccurrencesAvailable(element, isSingleFile); } -} +} \ No newline at end of file diff --git a/python/src/com/jetbrains/python/findUsages/PyClassFindUsagesHandler.java b/python/src/com/jetbrains/python/findUsages/PyClassFindUsagesHandler.java index 5dcb8850c114..bde1b0851bbd 100644 --- a/python/src/com/jetbrains/python/findUsages/PyClassFindUsagesHandler.java +++ b/python/src/com/jetbrains/python/findUsages/PyClassFindUsagesHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -47,7 +47,7 @@ public class PyClassFindUsagesHandler extends FindUsagesHandler { } @Override - protected boolean isSearchForTextOccurencesAvailable(@NotNull PsiElement psiElement, boolean isSingleFile) { + protected boolean isSearchForTextOccurrencesAvailable(@NotNull PsiElement psiElement, boolean isSingleFile) { return true; } diff --git a/python/src/com/jetbrains/python/findUsages/PyFunctionFindUsagesHandler.java b/python/src/com/jetbrains/python/findUsages/PyFunctionFindUsagesHandler.java index 7e8cb92df3fb..4a337cc55789 100644 --- a/python/src/com/jetbrains/python/findUsages/PyFunctionFindUsagesHandler.java +++ b/python/src/com/jetbrains/python/findUsages/PyFunctionFindUsagesHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -38,7 +38,7 @@ public class PyFunctionFindUsagesHandler extends FindUsagesHandler { } @Override - protected boolean isSearchForTextOccurencesAvailable(@NotNull PsiElement psiElement, boolean isSingleFile) { + protected boolean isSearchForTextOccurrencesAvailable(@NotNull PsiElement psiElement, boolean isSingleFile) { return true; }