public abstract class FakePsiElement extends PsiElementBase implements PsiNamedElement, ItemPresentation
Iconable.IconFlags, Iconable.LastComputedIcon
FLAGS_LOCKED, ICON_PLACEHOLDER
EMPTY_ARRAY
ARRAY_FACTORY
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 |
---|
FakePsiElement() |
Modifier and Type | Method and Description |
---|---|
PsiElement |
findElementAt(int offset)
Finds a leaf PSI element at the specified offset from the start of the text range of this node.
|
PsiElement [] |
getChildren()
Returns the array of children for the PSI element.
|
protected javax.swing.Icon |
getElementIcon(int flags) |
PsiElement |
getFirstChild()
Returns the first child of the PSI element.
|
javax.swing.Icon |
getIcon(boolean open)
Returns the icon representing the object.
|
javax.swing.Icon |
getIcon(int flags) |
Language |
getLanguage()
Returns the language of the PSI element.
|
PsiElement |
getLastChild()
Returns the last child of the PSI element.
|
java.lang.String |
getLocationString()
Returns the location of the object (for example, the package of a class).
|
PsiManager |
getManager()
Returns the PSI manager for the project to which the PSI element belongs.
|
PsiElement |
getNextSibling()
Returns the next sibling of the PSI element.
|
ASTNode |
getNode()
Returns the AST node corresponding to the element.
|
java.lang.String |
getPresentableText()
Returns the name of the object to be presented in most renderers across the program.
|
ItemPresentation |
getPresentation() |
PsiElement |
getPrevSibling()
Returns the previous sibling of the PSI element.
|
int |
getStartOffsetInParent()
Returns the text offset of the PSI element relative to its parent.
|
java.lang.String |
getText()
Returns the text of the PSI element.
|
int |
getTextLength()
Returns the length of text 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.
|
TextRange |
getTextRange()
Returns the text range in the document occupied by the PSI element.
|
boolean |
isPhysical()
Checks if an actual source or class file corresponds to the element.
|
PsiElement |
setName(java.lang.String name)
Renames the element.
|
boolean |
textContains(char c)
Checks if the text of this element contains the specified character.
|
char [] |
textToCharArray()
Returns the text of the PSI element as a character array.
|
accept, acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, canNavigate, canNavigateToSource, checkAdd, checkDelete, copy, delete, deleteChildRange, findChildByClass, findChildrenByClass, findNotNullChildByClass, findReferenceAt, getContainingFile, getContext, getName, getNavigationElement, getOriginalElement, getProject, getReference, getReferences, getResolveScope, getUseScope, isEquivalentTo, isValid, isWritable, navigate, notNullChild, processDeclarations, replace, textMatches, textMatches
buildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, iconWithVisibilityIfNeeded, isNativeFileType, isVisibilitySupported, overlayIcons, registerIconLayer, transformFlags
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
accept, acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findReferenceAt, getContainingFile, getContext, getCopyableUserData, getNavigationElement, getOriginalElement, getOwnReferences, getParent, getProject, getReference, getReferences, getResolveScope, getTextRangeInParent, getUseScope, isEquivalentTo, isValid, isWritable, processDeclarations, putCopyableUserData, replace, textMatches, textMatches, toString
getUserData, putUserData
public ItemPresentation getPresentation()
getPresentation
in interface NavigationItem
getPresentation
in class PsiElementBase
public Language getLanguage()
PsiElement
getLanguage
in interface PsiElement
public PsiElement [] getChildren()
PsiElement
getChildren
in interface PsiElement
public PsiElement getFirstChild()
PsiElement
getFirstChild
in interface PsiElement
getFirstChild
in class PsiElementBase
public PsiElement getLastChild()
PsiElement
getLastChild
in interface PsiElement
getLastChild
in class PsiElementBase
public PsiElement getNextSibling()
PsiElement
getNextSibling
in interface PsiElement
getNextSibling
in class PsiElementBase
public PsiElement getPrevSibling()
PsiElement
getPrevSibling
in interface PsiElement
getPrevSibling
in class PsiElementBase
public TextRange getTextRange()
PsiElement
getTextRange
in interface PsiElement
public int getStartOffsetInParent()
PsiElement
getStartOffsetInParent
in interface PsiElement
public int getTextLength()
PsiElement
getTextLength
in interface PsiElement
public PsiElement findElementAt(int offset)
PsiElement
findElementAt
in interface PsiElement
offset
- the relative offset for which the PSI element is requested.public int getTextOffset()
PsiElement
PsiNamedElement
, this should return the offset in the file of the
name identifier.)getTextOffset
in interface PsiElement
public java.lang.String getText()
PsiElement
getText
in interface PsiElement
PsiElement.textMatches(java.lang.CharSequence)
,
PsiElement.textContains(char)
public char [] textToCharArray()
PsiElement
textToCharArray
in interface PsiElement
public boolean textContains(char c)
PsiElement
textContains
in interface PsiElement
textContains
in class PsiElementBase
c
- the character to search for.public ASTNode getNode()
PsiElement
getNode
in interface PsiElement
public java.lang.String getPresentableText()
ItemPresentation
getPresentableText
in interface ItemPresentation
public java.lang.String getLocationString()
ItemPresentation
getLocationString
in interface ItemPresentation
public final javax.swing.Icon getIcon(int flags)
getIcon
in interface Iconable
getIcon
in class ElementBase
protected final javax.swing.Icon getElementIcon(int flags)
getElementIcon
in class ElementBase
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 PsiElement setName(java.lang.String name) throws IncorrectOperationException
PsiNamedElement
setName
in interface PsiNamedElement
name
- the new element name.this
or a different element if the rename caused the element to be replaced).IncorrectOperationException
- if the modification is not supported or not possible for some reason.public PsiManager getManager()
PsiElement
getManager
in interface PsiElement
getManager
in class PsiElementBase
public boolean isPhysical()
PsiElement
PsiDocumentManager.getDocument(PsiFile)
returns null for non-physical elements.
Not to be confused with FileViewProvider.isPhysical()
.isPhysical
in interface PsiElement
isPhysical
in class PsiElementBase