public static class FileGroupingRule.FileUsageGroup extends java.lang.Object implements UsageGroup, TypeSafeDataProvider, NamedPresentably
Constructor and Description |
---|
FileUsageGroup(Project project,
VirtualFile file) |
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).
|
int |
compareTo(UsageGroup otherGroup) |
boolean |
equals(java.lang.Object o) |
FileStatus |
getFileStatus() |
javax.swing.Icon |
getIcon(boolean isOpen) |
java.lang.String |
getPresentableName() |
PsiFile |
getPsiFile() |
java.lang.String |
getText(UsageView view) |
int |
hashCode() |
boolean |
isValid() |
void |
navigate(boolean focus)
Open editor and select/navigate to the object there if possible.
|
void |
update() |
public FileUsageGroup(Project project, VirtualFile file)
public void update()
update
in interface UsageGroup
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public javax.swing.Icon getIcon(boolean isOpen)
getIcon
in interface UsageGroup
public java.lang.String getText(UsageView view)
getText
in interface UsageGroup
public FileStatus getFileStatus()
getFileStatus
in interface UsageGroup
public boolean isValid()
isValid
in interface UsageGroup
public void navigate(boolean focus) throws java.lang.UnsupportedOperationException
Navigatable
navigate
in interface Navigatable
focus
- true
if focus requesting is necessaryjava.lang.UnsupportedOperationException
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 int compareTo(UsageGroup otherGroup)
compareTo
in interface java.lang.Comparable<UsageGroup>
public void calcData(DataKey key, DataSink sink)
calcData
in interface TypeSafeDataProvider
public PsiFile getPsiFile()
public java.lang.String getPresentableName()
getPresentableName
in interface NamedPresentably