public interface Navigatable
PsiElement
s implement this interface (see NavigatablePsiElement
). To create an
instance which opens a file in editor and put caret to a specific location use OpenFileDescriptor
.Modifier and Type | Method and Description |
---|---|
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 |
navigate(boolean requestFocus)
Open editor and select/navigate to the object there if possible.
|
void navigate(boolean requestFocus)
requestFocus
- true
if focus requesting is necessaryboolean canNavigate()
canNavigateToSource()
returns true
.
We assume that this method should return true
in such case,
so implement this method respectively.false
if navigation is not possible for any reason.boolean canNavigateToSource()
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.false
if navigation to source is not possible for any reason.