public class PsiDirectoryNode extends BasePsiNode<PsiDirectory> implements NavigatableWithText
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 |
---|
PsiDirectoryNode(Project project,
PsiDirectory value,
ViewSettings viewSettings) |
PsiDirectoryNode(Project project,
PsiDirectory value,
ViewSettings viewSettings,
PsiFileSystemItemFilter filter) |
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).
|
boolean |
canRepresent(java.lang.Object element) |
boolean |
contains(VirtualFile file)
Checks if this node or one of its children represents the specified virtual file.
|
java.util.Collection<AbstractTreeNode<?>> |
getChildrenImpl() |
PsiFileSystemItemFilter |
getFilter() |
java.lang.String |
getNavigateActionText(boolean focusEditor) |
java.lang.String |
getQualifiedNameSortKey() |
java.lang.Comparable |
getSortKey()
When nodes aren't sorted by type all objects with same weigh will be sorted using
some common algorithm (e.g alpha comparator).
|
java.lang.String |
getTestPresentation() |
java.lang.String |
getTitle() |
java.lang.Comparable |
getTypeSortKey()
When nodes are sorted by type all objects with same weigh will be sorted using
some common algorithm (e.g alpha comparator).
|
int |
getTypeSortWeight(boolean sortByType) |
int |
getWeight() |
boolean |
isAlwaysShowPlus() |
boolean |
isFQNameShown() |
boolean |
isValid() |
void |
navigate(boolean requestFocus)
Open editor and select/navigate to the object there if possible.
|
protected void |
setupIcon(PresentationData data,
PsiDirectory psiDirectory) |
boolean |
shouldDrillDownOnEmptyElement() |
protected boolean |
shouldShowModuleName() |
protected boolean |
shouldShowSourcesRoot() |
protected void |
updateImpl(PresentationData data) |
extractPsiFromValue, getFileStatus, getVirtualFile
calcTooltip, computeFileStatus, getChildren, getIconableFlags, getNavigationItem, isDeprecated, isMarkReadOnly, navigate, patchIcon, update, validate
canHaveChildrenMatching, createTreeNode, getDefaultRootsFor, getManualOrderKey, getRoots, getSettings, hasProblemFileBeneath, isSortByFirstChild, isValidating, shouldApply, shouldPostprocess, someChildContainsFile, someChildContainsFile, wrap
apply, equals, getChildToHighlightAt, getElement, getEqualityObject, getFileStatusColor, getLeafState, getName, getNullValueSetTrace, getParent, getParentDescriptor, getParentValue, getToolTip, getValue, hashCode, isAlwaysExpand, isAlwaysLeaf, 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
getPresentation
public PsiDirectoryNode(Project project, PsiDirectory value, ViewSettings viewSettings)
public PsiDirectoryNode(Project project, PsiDirectory value, ViewSettings viewSettings, PsiFileSystemItemFilter filter)
public PsiFileSystemItemFilter getFilter()
protected boolean shouldShowModuleName()
protected boolean shouldShowSourcesRoot()
protected void updateImpl(PresentationData data)
updateImpl
in class AbstractPsiBasedNode<PsiDirectory>
protected void setupIcon(PresentationData data, PsiDirectory psiDirectory)
public java.util.Collection<AbstractTreeNode<?>> getChildrenImpl()
getChildrenImpl
in class AbstractPsiBasedNode<PsiDirectory>
public java.lang.String getTestPresentation()
getTestPresentation
in class AbstractTreeNode<PsiDirectory>
public boolean isFQNameShown()
public boolean contains(VirtualFile file)
ProjectViewNode
contains
in class AbstractPsiBasedNode<PsiDirectory>
file
- the file to check for.public boolean canRepresent(java.lang.Object element)
canRepresent
in class AbstractTreeNode<PsiDirectory>
public boolean isValid()
isValid
in interface ValidateableNode
isValid
in class AbstractPsiBasedNode<PsiDirectory>
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<PsiDirectory>
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
canNavigateToSource
in class AbstractPsiBasedNode<PsiDirectory>
false
if navigation to source is not possible for any reason.public void navigate(boolean requestFocus)
Navigatable
navigate
in interface Navigatable
navigate
in class AbstractPsiBasedNode<PsiDirectory>
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<PsiDirectory>>
public java.lang.String getTitle()
getTitle
in class ProjectViewNode<PsiDirectory>
public java.lang.Comparable getSortKey()
ProjectViewNode
getSortKey
in class ProjectViewNode<PsiDirectory>
public java.lang.Comparable getTypeSortKey()
ProjectViewNode
getTypeSortKey
in class ProjectViewNode<PsiDirectory>
public java.lang.String getQualifiedNameSortKey()
getQualifiedNameSortKey
in class ProjectViewNode<PsiDirectory>
public int getTypeSortWeight(boolean sortByType)
getTypeSortWeight
in class ProjectViewNode<PsiDirectory>
public boolean shouldDrillDownOnEmptyElement()
shouldDrillDownOnEmptyElement
in class ProjectViewNode<PsiDirectory>
public boolean isAlwaysShowPlus()
isAlwaysShowPlus
in class AbstractTreeNode<PsiDirectory>