public class CustomRegionTreeElement extends java.lang.Object implements StructureViewTreeElement
EMPTY_ARRAY
Constructor and Description |
---|
CustomRegionTreeElement(PsiElement startElement,
CustomFoldingProvider provider) |
CustomRegionTreeElement(PsiElement startElement,
CustomFoldingProvider provider,
CustomRegionTreeElement parent) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(StructureViewTreeElement childElement) |
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 |
containsElement(StructureViewTreeElement element) |
CustomRegionTreeElement |
createNestedRegion(PsiElement element) |
CustomRegionTreeElement |
endRegion(PsiElement element) |
TreeElement [] |
getChildren()
Returns the list of children of the tree element.
|
ItemPresentation |
getPresentation()
Returns the presentation of the tree element.
|
java.lang.Object |
getValue()
Returns the data object (usually a PSI element) corresponding to the
structure view element.
|
void |
navigate(boolean requestFocus)
Open editor and select/navigate to the object there if possible.
|
java.lang.String |
toString() |
public CustomRegionTreeElement(PsiElement startElement, CustomFoldingProvider provider, CustomRegionTreeElement parent)
public CustomRegionTreeElement(PsiElement startElement, CustomFoldingProvider provider)
public java.lang.Object getValue()
StructureViewTreeElement
getValue
in interface StructureViewTreeElement
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 ItemPresentation getPresentation()
TreeElement
getPresentation
in interface TreeElement
public void addChild(StructureViewTreeElement childElement)
public TreeElement [] getChildren()
TreeElement
getChildren
in interface TreeElement
public boolean containsElement(StructureViewTreeElement element)
public CustomRegionTreeElement createNestedRegion(PsiElement element)
public CustomRegionTreeElement endRegion(PsiElement element)
public java.lang.String toString()
toString
in class java.lang.Object