public abstract class JavaStubPsiElement<T extends StubElement> extends StubBasedPsiElementBase<T> implements StubBasedPsiElement<T>
Iconable.IconFlags, Iconable.LastComputedIcon
CREATION_TRACE, ourTraceStubAstBinding
FLAGS_LOCKED, ICON_PLACEHOLDER
ARRAY_FACTORY, EMPTY_ARRAY
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
EMPTY_NAVIGATABLE_ELEMENT_ARRAY
EMPTY_NAVIGATION_ITEM_ARRAY
Constructor and Description |
---|
JavaStubPsiElement(ASTNode node) |
JavaStubPsiElement(T stub,
IStubElementType nodeType) |
Modifier and Type | Method and Description |
---|---|
void |
acceptChildren(PsiElementVisitor visitor)
Passes the children of the element to the specified visitor.
|
PsiElement |
add(PsiElement element)
Adds a child to this PSI element.
|
PsiElement |
addAfter(PsiElement element,
PsiElement anchor)
Adds a child to this PSI element, after the specified anchor element.
|
PsiElement |
addBefore(PsiElement element,
PsiElement anchor)
Adds a child to this PSI element, before the specified anchor element.
|
protected CompositeElement |
calcTreeElement() |
void |
checkAdd(PsiElement element)
Checks if it is possible to add the specified element as a child to this element,
and throws an exception if the add is not possible.
|
protected java.lang.Object |
clone() |
protected StubBasedPsiElementBase |
cloneImpl(CompositeElement treeElementClone) |
void |
delete()
Deletes this PSI element from the tree.
|
void |
deleteChildRange(PsiElement first,
PsiElement last)
Deletes a range of children of this PSI element from the tree.
|
PsiElement [] |
getChildren()
Returns the array of children for the PSI element.
|
Language |
getLanguage()
Returns the language of the PSI element.
|
int |
getTextOffset()
Returns the offset in the file to which the caret should be placed
when performing the navigation to the element.
|
PsiElement |
replace(PsiElement newElement)
Replaces this PSI element (along with all its children) with another element
(along with the children).
|
getContainingFile, getContext, getElementType, getGreenStub, getManager, getNode, getParent, getParentByStub, getParentByTree, getProject, getRequiredStubOrPsiChild, getStub, getStubOrPsiChild, getStubOrPsiChildren, getStubOrPsiChildren, getStubOrPsiChildren, getStubOrPsiChildren, getStubOrPsiParentOfType, isPhysical, isValid, isWritable, setNode, setSubstrateRef
addInternal, addRange, addRangeAfter, addRangeBefore, checkDelete, copy, deleteChildInternal, findChildByFilter, findChildByType, findChildByType, findChildrenByType, findChildrenByType, findChildrenByType, findChildrenByType, findElementAt, findLastChildByType, findNotNullChildByType, findNotNullChildByType, getCopyableUserData, getFirstChild, getLastChild, getNextSibling, getPrevSibling, getStartOffsetInParent, getText, getTextLength, getTextRange, putCopyableUserData, replaceChildInternal, subtreeChanged, textContains, textMatches, textToCharArray
accept, canNavigate, canNavigateToSource, findChildByClass, findChildrenByClass, findNotNullChildByClass, findReferenceAt, getName, getNavigationElement, getOriginalElement, getPresentation, getReference, getReferences, getResolveScope, getUseScope, isEquivalentTo, navigate, notNullChild, processDeclarations, textMatches
buildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, getElementIcon, getIcon, iconWithVisibilityIfNeeded, isNativeFileType, isVisibilitySupported, overlayIcons, registerIconLayer, transformFlags
changeUserMap, clearUserData, copyCopyableDataTo, copyUserDataTo, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putUserData, putUserDataIfAbsent, replace, setUserMap
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getElementType, getStub
accept, addRange, addRangeAfter, addRangeBefore, checkDelete, copy, findElementAt, findReferenceAt, getContainingFile, getContext, getCopyableUserData, getFirstChild, getLastChild, getManager, getNavigationElement, getNextSibling, getNode, getOriginalElement, getOwnReferences, getParent, getPrevSibling, getProject, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextRange, getTextRangeInParent, getUseScope, isEquivalentTo, isPhysical, isValid, isWritable, processDeclarations, putCopyableUserData, textContains, textMatches, textMatches, textToCharArray, toString
getUserData, putUserData
public JavaStubPsiElement(T stub, IStubElementType nodeType)
public JavaStubPsiElement(ASTNode node)
public Language getLanguage()
PsiElement
getLanguage
in interface PsiElement
getLanguage
in class StubBasedPsiElementBase<T extends StubElement>
public int getTextOffset()
PsiElement
PsiNamedElement
, this should return the offset in the file of the
name identifier.)getTextOffset
in interface PsiElement
getTextOffset
in class ASTDelegatePsiElement
protected CompositeElement calcTreeElement()
public PsiElement add(PsiElement element) throws IncorrectOperationException
PsiElement
add
in interface PsiElement
add
in class ASTDelegatePsiElement
element
- the child element to add.element
or its copy).IncorrectOperationException
- if the modification is not supported or not possible for some reason.public PsiElement addBefore(PsiElement element, PsiElement anchor) throws IncorrectOperationException
PsiElement
addBefore
in interface PsiElement
addBefore
in class ASTDelegatePsiElement
element
- the child element to add.anchor
- the anchor before which the child element is inserted (must be a child of this PSI element)element
or its copy).IncorrectOperationException
- if the modification is not supported or not possible for some reason.public PsiElement addAfter(PsiElement element, PsiElement anchor) throws IncorrectOperationException
PsiElement
addAfter
in interface PsiElement
addAfter
in class ASTDelegatePsiElement
element
- the child element to add.anchor
- the anchor after which the child element is inserted (must be a child of this PSI element)element
or its copy).IncorrectOperationException
- if the modification is not supported or not possible for some reason.public final void checkAdd(PsiElement element) throws IncorrectOperationException
PsiElement
checkAdd
in interface PsiElement
checkAdd
in class ASTDelegatePsiElement
element
- the child element to check the add possibility.IncorrectOperationException
- if the modification is not supported or not possible for some reason.public void delete() throws IncorrectOperationException
PsiElement
delete
in interface PsiElement
delete
in class ASTDelegatePsiElement
IncorrectOperationException
- if the modification is not supported
or not possible for some reason (for example, the file containing the element is read-only).public void deleteChildRange(PsiElement first, PsiElement last) throws IncorrectOperationException
PsiElement
deleteChildRange
in interface PsiElement
deleteChildRange
in class ASTDelegatePsiElement
first
- the first child to delete (must be a child of this PSI element)last
- the last child to delete (must be a child of this PSI element)IncorrectOperationException
- if the modification is not supported or not possible for some reason.public PsiElement replace(PsiElement newElement) throws IncorrectOperationException
PsiElement
replace
in interface PsiElement
replace
in class ASTDelegatePsiElement
newElement
- the element to replace this element with.newElement
or its copy)IncorrectOperationException
- if the modification is not supported or not possible for some reason.public void acceptChildren(PsiElementVisitor visitor)
PsiElement
acceptChildren
in interface PsiElement
acceptChildren
in class PsiElementBase
visitor
- the visitor to pass the children to.protected java.lang.Object clone()
clone
in class StubBasedPsiElementBase<T extends StubElement>
protected StubBasedPsiElementBase cloneImpl(CompositeElement treeElementClone)
public PsiElement [] getChildren()
PsiElement
getChildren
in interface PsiElement
getChildren
in class ASTDelegatePsiElement