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, waitgetPresentableTextprotected PsiTreeElementBase(T psiElement)
public ItemPresentation getPresentation()
TreeElementgetPresentation in interface TreeElementpublic java.lang.Object getKey()
getKey in interface NodeDescriptorProvidingKeypublic final T getElement()
public javax.swing.Icon getIcon(boolean open)
ItemPresentationgetIcon in interface ItemPresentationopen - 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()
StructureViewTreeElementgetValue in interface StructureViewTreeElementpublic java.lang.String getLocationString()
ItemPresentationgetLocationString in interface ItemPresentationpublic boolean isSearchInLocationString()
public java.lang.String toString()
toString in class java.lang.Objectpublic final StructureViewTreeElement [] getChildren()
TreeElementgetChildren in interface TreeElementpublic final StructureViewTreeElement [] getChildrenWithoutCustomRegions()
public void navigate(boolean requestFocus)
Navigatablenavigate in interface NavigatablerequestFocus - true if focus requesting is necessarypublic boolean canNavigate()
NavigatableNavigatable.canNavigateToSource() returns true.
We assume that this method should return true in such case,
so implement this method respectively.canNavigate in interface Navigatablefalse if navigation is not possible for any reason.public boolean canNavigateToSource()
Navigatablefalse.
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 Navigatablefalse 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.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean isValid()
public static StructureViewTreeElement [] mergeWithExtensions(PsiElement element, java.util.Collection<StructureViewTreeElement> baseChildren, boolean withCustomRegions)