public abstract class NavigatableAdapter extends java.lang.Object implements Navigatable
canNavigate
and canNavigateToSource
return true
. This adapter class lets focus on navigation
routine only.Constructor and Description |
---|
NavigatableAdapter() |
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).
|
static void |
navigate(Project project,
VirtualFile file,
boolean requestFocus) |
static void |
navigate(Project project,
VirtualFile file,
int offset,
boolean requestFocus) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
navigate
public 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 static void navigate(Project project, VirtualFile file, boolean requestFocus)
public static void navigate(Project project, VirtualFile file, int offset, boolean requestFocus)