public class PsiElement2UsageTargetAdapter extends java.lang.Object implements PsiElementUsageTarget, TypeSafeDataProvider, PsiElementNavigationItem, ItemPresentation, ConfigurableUsageTarget
| Modifier and Type | Field and Description |
|---|---|
protected FindUsagesOptions |
myOptions |
EMPTY_ARRAY| Constructor and Description |
|---|
PsiElement2UsageTargetAdapter(PsiElement element) |
PsiElement2UsageTargetAdapter(PsiElement element,
FindUsagesOptions options) |
| Modifier and Type | Method and Description |
|---|---|
void |
calcData(DataKey key,
DataSink sink) |
boolean |
canNavigate()
Indicates whether this instance supports navigation of any kind.
|
boolean |
canNavigateToSource()
Indicates whether this instance supports navigation to source (that means some kind of editor).
|
static PsiElement2UsageTargetAdapter [] |
convert(PsiElement [] psiElements) |
void |
findUsages()
Should open usage view and look for usages
|
void |
findUsagesInEditor(FileEditor editor)
Should look for usages in one specific editor.
|
PsiElement |
getElement() |
VirtualFile[] |
getFiles() |
javax.swing.Icon |
getIcon(boolean open)
Returns the icon representing the object.
|
java.lang.String |
getLocationString()
Returns the location of the object (for example, the package of a class).
|
java.lang.String |
getLongDescriptiveName() |
java.lang.String |
getName() |
java.lang.String |
getPresentableText()
Returns the name of the object to be presented in most renderers across the program.
|
ItemPresentation |
getPresentation() |
Project |
getProject() |
KeyboardShortcut |
getShortcut() |
PsiElement |
getTargetElement() |
void |
highlightUsages(PsiFile file,
Editor editor,
boolean clearHighlights) |
boolean |
isReadOnly() |
boolean |
isValid() |
void |
navigate(boolean requestFocus)
Open editor and select/navigate to the object there if possible.
|
void |
showSettings() |
java.lang.String |
toString() |
void |
update() |
protected final FindUsagesOptions myOptions
public PsiElement2UsageTargetAdapter(PsiElement element, FindUsagesOptions options)
public PsiElement2UsageTargetAdapter(PsiElement element)
public java.lang.String getName()
getName in interface NavigationItempublic ItemPresentation getPresentation()
getPresentation in interface NavigationItempublic void navigate(boolean requestFocus)
Navigatablenavigate in interface NavigatablerequestFocus - true if focus requesting is necessarypublic boolean canNavigate()
NavigatableNavigatable.canNavigateToSource() returns true.
We assume that this method should return true in such case,
so implement this method respectively.canNavigate in interface Navigatablefalse if navigation is not possible for any reason.public boolean canNavigateToSource()
Navigatablefalse.
In such cases it is not recommended to do batch navigation for all navigatables
available via CommonDataKeys.NAVIGATABLE_ARRAY,
because it may lead to opening several modal dialogs.
Use OpenSourceUtil.navigate(com.intellij.pom.Navigatable...) to process such arrays correctly.canNavigateToSource in interface Navigatablefalse if navigation to source is not possible for any reason.public PsiElement getTargetElement()
getTargetElement in interface PsiElementNavigationItempublic java.lang.String toString()
toString in class java.lang.Objectpublic void findUsages()
UsageTargetfindUsages in interface UsageTargetpublic PsiElement getElement()
getElement in interface PsiElementUsageTargetpublic void findUsagesInEditor(FileEditor editor)
UsageTargetfindUsagesInEditor in interface UsageTargetpublic void highlightUsages(PsiFile file, Editor editor, boolean clearHighlights)
highlightUsages in interface UsageTargetpublic boolean isValid()
isValid in interface UsageTargetpublic boolean isReadOnly()
isReadOnly in interface UsageTargetpublic VirtualFile[] getFiles()
getFiles in interface UsageTargetpublic static PsiElement2UsageTargetAdapter [] convert(PsiElement [] psiElements)
public void calcData(DataKey key, DataSink sink)
calcData in interface TypeSafeDataProviderpublic KeyboardShortcut getShortcut()
getShortcut in interface ConfigurableUsageTargetpublic java.lang.String getLongDescriptiveName()
getLongDescriptiveName in interface ConfigurableUsageTargetpublic void showSettings()
showSettings in interface ConfigurableUsageTargetpublic void update()
update in interface UsageTargetpublic java.lang.String getPresentableText()
ItemPresentationgetPresentableText in interface ItemPresentationpublic java.lang.String getLocationString()
ItemPresentationgetLocationString in interface ItemPresentationpublic javax.swing.Icon getIcon(boolean open)
ItemPresentationgetIcon in interface ItemPresentationopen - Used to mean if open/close icons for tree renderer. No longer in use. The parameter is only there for API compatibility reason.public Project getProject()