public abstract class PsiTreeElementBase<T extends PsiElement> extends java.lang.Object implements StructureViewTreeElement, ItemPresentation, NodeDescriptorProvidingKey
EMPTY_ARRAY
Modifier | Constructor and Description |
---|---|
protected |
PsiTreeElementBase(T psiElement) |
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 |
equals(java.lang.Object o) |
StructureViewTreeElement [] |
getChildren()
Returns the list of children of the tree element.
|
abstract java.util.Collection<StructureViewTreeElement> |
getChildrenBase() |
StructureViewTreeElement [] |
getChildrenWithoutCustomRegions() |
T |
getElement() |
javax.swing.Icon |
getIcon(boolean open)
Returns the icon representing the object.
|
java.lang.Object |
getKey() |
java.lang.String |
getLocationString()
Returns the location of the object (for example, the package of a class).
|
ItemPresentation |
getPresentation()
Returns the presentation of the tree element.
|
T |
getValue()
Returns the data object (usually a PSI element) corresponding to the
structure view element.
|
int |
hashCode() |
boolean |
isSearchInLocationString() |
boolean |
isValid() |
static StructureViewTreeElement [] |
mergeWithExtensions(PsiElement element,
java.util.Collection<StructureViewTreeElement> baseChildren,
boolean withCustomRegions) |
void |
navigate(boolean requestFocus)
Open editor and select/navigate to the object there if possible.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPresentableText
protected PsiTreeElementBase(T psiElement)
public ItemPresentation getPresentation()
TreeElement
getPresentation
in interface TreeElement
public java.lang.Object getKey()
getKey
in interface NodeDescriptorProvidingKey
public final T getElement()
public javax.swing.Icon getIcon(boolean open)
ItemPresentation
getIcon
in interface ItemPresentation
open
- Used to mean if open/close icons for tree renderer. No longer in use. The parameter is only there for API compatibility reason.public T getValue()
StructureViewTreeElement
getValue
in interface StructureViewTreeElement
public java.lang.String getLocationString()
ItemPresentation
getLocationString
in interface ItemPresentation
public boolean isSearchInLocationString()
public java.lang.String toString()
toString
in class java.lang.Object
public final StructureViewTreeElement [] getChildren()
TreeElement
getChildren
in interface TreeElement
public final StructureViewTreeElement [] getChildrenWithoutCustomRegions()
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.public abstract java.util.Collection<StructureViewTreeElement> getChildrenBase()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean isValid()
public static StructureViewTreeElement [] mergeWithExtensions(PsiElement element, java.util.Collection<StructureViewTreeElement> baseChildren, boolean withCustomRegions)