com.intellij.lang.findUsages
Class EmptyFindUsagesProvider

java.lang.Object
  extended by com.intellij.lang.findUsages.EmptyFindUsagesProvider
All Implemented Interfaces:
FindUsagesProvider

public class EmptyFindUsagesProvider
extends java.lang.Object
implements FindUsagesProvider

The default empty implementation of the FindUsagesProvider interface.


Constructor Summary
EmptyFindUsagesProvider()
           
 
Method Summary
 boolean canFindUsagesFor(PsiElement psiElement)
          Checks if it makes sense to search for usages of the specified element.
 java.lang.String getDescriptiveName(PsiElement element)
          Returns an expanded user-visible name of the specified element, shown in the "Find Usages" dialog.
 java.lang.String getHelpId(PsiElement psiElement)
          Returns the ID of the help topic which is shown when the specified element is selected in the "Find Usages" dialog.
 java.lang.String getNodeText(PsiElement element, boolean useFullName)
          Returns the text representing the specified PSI element in the Find Usages tree.
 java.lang.String getType(PsiElement element)
          Returns the user-visible type of the specified element, shown in the "Find Usages" dialog (for example, "class" or "variable").
 WordsScanner getWordsScanner()
          Gets the word scanner for building a word index for the specified language.
 boolean mayHaveReferences(IElementType token, short searchContext)
          Checks if tokens of the specified type can contain references when the search is done with the specified context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmptyFindUsagesProvider

public EmptyFindUsagesProvider()
Method Detail

mayHaveReferences

public boolean mayHaveReferences(IElementType token,
                                 short searchContext)
Description copied from interface: FindUsagesProvider
Checks if tokens of the specified type can contain references when the search is done with the specified context.

Specified by:
mayHaveReferences in interface FindUsagesProvider
Parameters:
token - the token type to check for references.
searchContext - represents find usages request, a combination of constants in UsageSearchContext

getWordsScanner

@Nullable
public WordsScanner getWordsScanner()
Description copied from interface: FindUsagesProvider
Gets the word scanner for building a word index for the specified language.

Specified by:
getWordsScanner in interface FindUsagesProvider
Returns:
the word scanner implementation, or null if Find Usages is not supported for the language.

canFindUsagesFor

public boolean canFindUsagesFor(PsiElement psiElement)
Description copied from interface: FindUsagesProvider
Checks if it makes sense to search for usages of the specified element.

Specified by:
canFindUsagesFor in interface FindUsagesProvider
Parameters:
psiElement - the element for which usages are searched.
Returns:
true if the search is allowed, false otherwise.
See Also:
FindManager.canFindUsages(com.intellij.psi.PsiElement)

getHelpId

@Nullable
public java.lang.String getHelpId(PsiElement psiElement)
Description copied from interface: FindUsagesProvider
Returns the ID of the help topic which is shown when the specified element is selected in the "Find Usages" dialog.

Specified by:
getHelpId in interface FindUsagesProvider
Parameters:
psiElement - the element for which the help topic is requested.
Returns:
the help topic ID, or null if no help is available.

getType

@NotNull
public java.lang.String getType(PsiElement element)
Description copied from interface: FindUsagesProvider
Returns the user-visible type of the specified element, shown in the "Find Usages" dialog (for example, "class" or "variable"). The type name should not be upper-cased.

Specified by:
getType in interface FindUsagesProvider
Parameters:
element - the element for which the type is requested.
Returns:
the type of the element.

getDescriptiveName

@NotNull
public java.lang.String getDescriptiveName(PsiElement element)
Description copied from interface: FindUsagesProvider
Returns an expanded user-visible name of the specified element, shown in the "Find Usages" dialog. For classes, this can return a fully qualified name of the class; for methods - a signature of the method with parameters.

Specified by:
getDescriptiveName in interface FindUsagesProvider
Parameters:
element - the element for which the name is requested.
Returns:
the user-visible name.

getNodeText

@NotNull
public java.lang.String getNodeText(PsiElement element,
                                            boolean useFullName)
Description copied from interface: FindUsagesProvider
Returns the text representing the specified PSI element in the Find Usages tree.

Specified by:
getNodeText in interface FindUsagesProvider
Parameters:
element - the element for which the node text is requested.
useFullName - if true, the returned text should use fully qualified names
Returns:
the text representing the element.