public class PsiFileNode extends BasePsiNode<PsiFile> implements NavigatableWithText
Modifier and Type | Class and Description |
---|---|
static class |
PsiFileNode.ExtensionSortKey |
PresentableNodeDescriptor.ColoredFragment
NodeDescriptor.NodeComparator<T extends NodeDescriptor<?>>
DEFAULT_WEIGHT, EMPTY_ARRAY, myClosedIcon, myColor, myName, myOpenIcon, myProject
EMPTY_ROOTS
EMPTY_NAVIGATION_ITEM_ARRAY
Constructor and Description |
---|
PsiFileNode(Project project,
PsiFile value,
ViewSettings viewSettings) |
Modifier and Type | Method and Description |
---|---|
boolean |
canNavigate()
Indicates whether this instance supports navigation of any kind.
|
boolean |
canRepresent(java.lang.Object element) |
boolean |
contains(VirtualFile file)
Checks if this node or one of its children represents the specified virtual file.
|
static java.lang.String |
extension(PsiFile file) |
java.util.Collection<AbstractTreeNode<?>> |
getChildrenImpl() |
java.lang.String |
getNavigateActionText(boolean focusEditor) |
java.lang.String |
getTitle() |
java.lang.Comparable<PsiFileNode.ExtensionSortKey> |
getTypeSortKey()
When nodes are sorted by type all objects with same weigh will be sorted using
some common algorithm (e.g alpha comparator).
|
int |
getWeight() |
protected boolean |
isMarkReadOnly() |
void |
navigate(boolean requestFocus)
Open editor and select/navigate to the object there if possible.
|
boolean |
shouldDrillDownOnEmptyElement() |
protected void |
updateImpl(PresentationData data) |
extractPsiFromValue, getFileStatus, getVirtualFile
calcTooltip, canNavigateToSource, computeFileStatus, getChildren, getIconableFlags, getNavigationItem, isDeprecated, isValid, navigate, patchIcon, update, validate
canHaveChildrenMatching, createTreeNode, getDefaultRootsFor, getManualOrderKey, getQualifiedNameSortKey, getRoots, getSettings, getSortKey, getTypeSortWeight, hasProblemFileBeneath, isSortByFirstChild, isValidating, shouldApply, shouldPostprocess, someChildContainsFile, someChildContainsFile, wrap
apply, equals, getChildToHighlightAt, getElement, getEqualityObject, getFileStatusColor, getLeafState, getName, getNullValueSetTrace, getParent, getParentDescriptor, getParentValue, getTestPresentation, getToolTip, getValue, hashCode, isAlwaysExpand, isAlwaysLeaf, isAlwaysShowPlus, postprocess, setParent, setValue, shouldUpdateData, toTestString, valueIsCut
apply, apply, applyFrom, createPresentation, getHighlightColor, getPresentation, getTemplatePresentation, isAncestorOrSelf, isContentHighlighted, isHighlightableContentNode, isParentOf, update
expandOnDoubleClick, getChildrenSortingStamp, getClosedIcon, getColor, getIcon, getIndex, getOpenIcon, getProject, getUpdateCount, isWasDeclaredAlwaysLeaf, setChildrenSortingStamp, setIcon, setIndex, setUpdateCount, setWasDeclaredAlwaysLeaf, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
canNavigateToSource
getPresentation
public PsiFileNode(Project project, PsiFile value, ViewSettings viewSettings)
public java.util.Collection<AbstractTreeNode<?>> getChildrenImpl()
getChildrenImpl
in class AbstractPsiBasedNode<PsiFile>
protected void updateImpl(PresentationData data)
updateImpl
in class AbstractPsiBasedNode<PsiFile>
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
canNavigate
in class AbstractPsiBasedNode<PsiFile>
false
if navigation is not possible for any reason.public void navigate(boolean requestFocus)
Navigatable
navigate
in interface Navigatable
navigate
in class AbstractPsiBasedNode<PsiFile>
requestFocus
- true
if focus requesting is necessarypublic java.lang.String getNavigateActionText(boolean focusEditor)
getNavigateActionText
in interface NavigatableWithText
public int getWeight()
getWeight
in class NodeDescriptor<AbstractTreeNode<PsiFile>>
public java.lang.String getTitle()
getTitle
in class ProjectViewNode<PsiFile>
protected boolean isMarkReadOnly()
isMarkReadOnly
in class AbstractPsiBasedNode<PsiFile>
public java.lang.Comparable<PsiFileNode.ExtensionSortKey> getTypeSortKey()
ProjectViewNode
getTypeSortKey
in class ProjectViewNode<PsiFile>
public static java.lang.String extension(PsiFile file)
public boolean shouldDrillDownOnEmptyElement()
shouldDrillDownOnEmptyElement
in class ProjectViewNode<PsiFile>
public boolean canRepresent(java.lang.Object element)
canRepresent
in class AbstractTreeNode<PsiFile>
public boolean contains(VirtualFile file)
ProjectViewNode
contains
in class AbstractPsiBasedNode<PsiFile>
file
- the file to check for.