public abstract class AbstractTreeNode<T> extends PresentableNodeDescriptor<AbstractTreeNode<T>> implements NavigationItem, Queryable.Contributor, LeafState.Supplier
PresentableNodeDescriptor.ColoredFragment
NodeDescriptor.NodeComparator<T extends NodeDescriptor<?>>
DEFAULT_WEIGHT, EMPTY_ARRAY, myClosedIcon, myColor, myName, myOpenIcon, myProject
EMPTY_NAVIGATION_ITEM_ARRAY
Modifier | Constructor and Description |
---|---|
protected |
AbstractTreeNode(Project project,
T value) |
Modifier and Type | Method and Description |
---|---|
void |
apply(java.util.Map<java.lang.String,java.lang.String> info) |
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 |
equals(java.lang.Object object) |
abstract java.util.Collection<? extends AbstractTreeNode<?>> |
getChildren() |
PresentableNodeDescriptor |
getChildToHighlightAt(int index) |
AbstractTreeNode<T> |
getElement() |
java.lang.Object |
getEqualityObject() |
FileStatus |
getFileStatus() |
java.awt.Color |
getFileStatusColor(FileStatus status) |
LeafState |
getLeafState() |
java.lang.String |
getName() |
protected java.lang.Throwable |
getNullValueSetTrace() |
AbstractTreeNode |
getParent() |
NodeDescriptor |
getParentDescriptor() |
protected java.lang.Object |
getParentValue() |
java.lang.String |
getTestPresentation()
Deprecated.
use
toTestString(Queryable.PrintInfo) instead |
protected java.lang.String |
getToolTip()
Deprecated.
use
PresentableNodeDescriptor.getPresentation() instead |
T |
getValue() |
protected VirtualFile |
getVirtualFile() |
int |
hashCode() |
protected boolean |
hasProblemFileBeneath() |
boolean |
isAlwaysExpand() |
boolean |
isAlwaysLeaf() |
boolean |
isAlwaysShowPlus() |
void |
navigate(boolean requestFocus)
Open editor and select/navigate to the object there if possible.
|
protected void |
postprocess(PresentationData presentation) |
void |
setParent(AbstractTreeNode parent) |
void |
setValue(T value) |
protected boolean |
shouldUpdateData() |
java.lang.String |
toTestString(Queryable.PrintInfo printInfo) |
protected boolean |
valueIsCut() |
apply, apply, applyFrom, createPresentation, getHighlightColor, getPresentation, getTemplatePresentation, isAncestorOrSelf, isContentHighlighted, isHighlightableContentNode, isParentOf, shouldApply, shouldPostprocess, update, update
expandOnDoubleClick, getChildrenSortingStamp, getClosedIcon, getColor, getIcon, getIndex, getOpenIcon, getProject, getUpdateCount, getWeight, isWasDeclaredAlwaysLeaf, setChildrenSortingStamp, setIcon, setIndex, setUpdateCount, setWasDeclaredAlwaysLeaf, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPresentation
public abstract java.util.Collection<? extends AbstractTreeNode<?>> getChildren()
protected boolean hasProblemFileBeneath()
protected boolean valueIsCut()
public PresentableNodeDescriptor getChildToHighlightAt(int index)
getChildToHighlightAt
in class PresentableNodeDescriptor<AbstractTreeNode<T>>
protected void postprocess(PresentationData presentation)
postprocess
in class PresentableNodeDescriptor<AbstractTreeNode<T>>
protected boolean shouldUpdateData()
shouldUpdateData
in class PresentableNodeDescriptor<AbstractTreeNode<T>>
public LeafState getLeafState()
getLeafState
in interface LeafState.Supplier
TreeModel.isLeaf(Object)
public boolean isAlwaysShowPlus()
public boolean isAlwaysLeaf()
public boolean isAlwaysExpand()
public final AbstractTreeNode<T> getElement()
getElement
in class NodeDescriptor<AbstractTreeNode<T>>
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public final AbstractTreeNode getParent()
public final void setParent(AbstractTreeNode parent)
public final NodeDescriptor getParentDescriptor()
getParentDescriptor
in class NodeDescriptor<AbstractTreeNode<T>>
public final T getValue()
public final void setValue(T value)
protected final java.lang.Throwable getNullValueSetTrace()
public final java.lang.Object getEqualityObject()
public java.lang.String toTestString(Queryable.PrintInfo printInfo)
public void apply(java.util.Map<java.lang.String,java.lang.String> info)
apply
in interface Queryable.Contributor
@Deprecated public java.lang.String getTestPresentation()
toTestString(Queryable.PrintInfo)
insteadpublic java.awt.Color getFileStatusColor(FileStatus status)
protected VirtualFile getVirtualFile()
public FileStatus getFileStatus()
public java.lang.String getName()
getName
in interface NavigationItem
getName
in class PresentableNodeDescriptor<AbstractTreeNode<T>>
public void navigate(boolean requestFocus)
Navigatable
navigate
in interface Navigatable
requestFocus
- true
if focus requesting is necessarypublic 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.protected final java.lang.Object getParentValue()
public boolean canRepresent(java.lang.Object element)
@Deprecated protected java.lang.String getToolTip()
PresentableNodeDescriptor.getPresentation()
instead