public static class FindInProjectUtil.StringUsageTarget extends java.lang.Object implements ConfigurableUsageTarget, ItemPresentation, TypeSafeDataProvider
Modifier and Type | Field and Description |
---|---|
protected FindModel |
myFindModel |
protected Project |
myProject |
EMPTY_ARRAY
EMPTY_NAVIGATION_ITEM_ARRAY
Constructor and Description |
---|
StringUsageTarget(Project project,
FindModel findModel) |
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).
|
void |
findUsages()
Should open usage view and look for usages
|
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() |
KeyboardShortcut |
getShortcut() |
boolean |
isValid() |
void |
navigate(boolean requestFocus)
Open editor and select/navigate to the object there if possible.
|
void |
showSettings() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findUsagesInEditor, getFiles, highlightUsages, isReadOnly, update
protected final Project myProject
protected final FindModel myFindModel
public java.lang.String getPresentableText()
ItemPresentation
getPresentableText
in interface ItemPresentation
public java.lang.String getLongDescriptiveName()
getLongDescriptiveName
in interface ConfigurableUsageTarget
public java.lang.String getLocationString()
ItemPresentation
getLocationString
in interface ItemPresentation
public javax.swing.Icon getIcon(boolean open)
ItemPresentation
getIcon
in interface ItemPresentation
open
- Used to mean if open/close icons for tree renderer. No longer in use. The parameter is only there for API compatibility reason.public void findUsages()
UsageTarget
findUsages
in interface UsageTarget
public boolean isValid()
isValid
in interface UsageTarget
public java.lang.String getName()
getName
in interface NavigationItem
public ItemPresentation getPresentation()
getPresentation
in interface NavigationItem
public void navigate(boolean requestFocus)
Navigatable
navigate
in interface Navigatable
requestFocus
- true
if focus requesting is necessarypublic boolean canNavigate()
Navigatable
Navigatable.canNavigateToSource()
returns true
.
We assume that this method should return true
in such case,
so implement this method respectively.canNavigate
in interface Navigatable
false
if navigation is not possible for any reason.public boolean canNavigateToSource()
Navigatable
false
.
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 Navigatable
false
if navigation to source is not possible for any reason.public void showSettings()
showSettings
in interface ConfigurableUsageTarget
public KeyboardShortcut getShortcut()
getShortcut
in interface ConfigurableUsageTarget
public void calcData(DataKey key, DataSink sink)
calcData
in interface TypeSafeDataProvider