public class PomTargetPsiElementImpl extends RenameableFakePsiElement implements PomTargetPsiElement
Iconable.IconFlags, Iconable.LastComputedIconFLAGS_LOCKED, ICON_PLACEHOLDERARRAY_FACTORY, EMPTY_ARRAYICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITYEMPTY_ARRAYEMPTY_NAVIGATABLE_ELEMENT_ARRAYEMPTY_NAVIGATION_ITEM_ARRAY| Constructor and Description |
|---|
PomTargetPsiElementImpl(Project project,
PomTarget target) |
PomTargetPsiElementImpl(PsiTarget target) |
| 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) |
PsiFile |
getContainingFile()
Returns the file containing the PSI element.
|
PsiElement |
getContext()
Returns the element which should be used as the parent of this element in a tree up
walk during a resolve operation.
|
javax.swing.Icon |
getIcon() |
Language |
getLanguage()
Returns the language of the PSI element.
|
java.lang.String |
getLocationString()
Returns the location of the object (for example, the package of a class).
|
java.lang.String |
getName()
Returns the name of the element.
|
PsiElement |
getNavigationElement()
Returns the PSI element which should be used as a navigation target
when navigation to this PSI element is requested.
|
PsiElement |
getParent()
Returns the parent of the PSI element.
|
Project |
getProject()
Returns the project to which the PSI element belongs.
|
PomTarget |
getTarget() |
java.lang.String |
getTypeName() |
int |
hashCode() |
boolean |
isEquivalentTo(PsiElement another)
This method shouldn't be called by clients directly, because there are no guarantees of it being symmetric.
|
boolean |
isValid()
Checks if this PSI element is valid.
|
boolean |
isWritable()
Checks if the contents of the element can be modified (if it belongs to a
non-read-only source file.)
|
void |
navigate(boolean requestFocus)
Open editor and select/navigate to the object there if possible.
|
PsiElement |
setName(java.lang.String name)
Renames the element.
|
getDeclaration, getIcon, getManager, getMetaData, getName, getTextRange, initfindElementAt, getChildren, getElementIcon, getFirstChild, getIcon, getLastChild, getNextSibling, getNode, getPresentableText, getPresentation, getPrevSibling, getStartOffsetInParent, getText, getTextLength, getTextOffset, isPhysical, textContains, textToCharArrayaccept, acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findChildByClass, findChildrenByClass, findNotNullChildByClass, findReferenceAt, getOriginalElement, getReference, getReferences, getResolveScope, getUseScope, notNullChild, processDeclarations, replace, textMatches, textMatchesbuildRowIcon, computeBaseIcon, createLayeredIcon, getAdjustedBaseIcon, getBaseIcon, iconWithVisibilityIfNeeded, isNativeFileType, isVisibilitySupported, overlayIcons, registerIconLayer, transformFlagschangeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMapfinalize, getClass, notify, notifyAll, toString, wait, wait, waitaccept, acceptChildren, add, addAfter, addBefore, addRange, addRangeAfter, addRangeBefore, checkAdd, checkDelete, copy, delete, deleteChildRange, findElementAt, findReferenceAt, getChildren, getCopyableUserData, getFirstChild, getLastChild, getManager, getNextSibling, getNode, getOriginalElement, getOwnReferences, getPrevSibling, getReference, getReferences, getResolveScope, getStartOffsetInParent, getText, getTextLength, getTextOffset, getTextRange, getTextRangeInParent, getUseScope, isPhysical, processDeclarations, putCopyableUserData, replace, textContains, textMatches, textMatches, textToCharArray, toStringgetUserData, putUserDatagetDependences, getDependenciespublic PomTargetPsiElementImpl(PsiTarget target)
public PomTarget getTarget()
getTarget in interface PomTargetPsiElementpublic java.lang.String getName()
PsiNamedElementgetName in interface NavigationItemgetName in interface PsiMetaDatagetName in interface PsiNamedElementgetName in class RenameableFakePsiElementpublic boolean isWritable()
PsiElementisWritable in interface PsiElementisWritable in class PsiElementBasepublic java.lang.String getTypeName()
getTypeName in interface PsiPresentableMetaDatapublic PsiElement getNavigationElement()
PsiElementthis or substitute a different element if this element
does not have an associated file and offset. (For example, if the source code
of a library is attached to a project, the navigation element for a compiled
library class is its source class.)getNavigationElement in interface PsiElementgetNavigationElement in class PsiElementBasepublic javax.swing.Icon getIcon()
getIcon in interface PsiPresentableMetaDatapublic boolean isValid()
PsiElementPsiDocumentManager.commitDocument(com.intellij.openapi.editor.Document)).
(In this case an attempt to change PSI will result in an exception).
Any access to invalid elements results in PsiInvalidElementAccessException.
Once invalid, elements can't become valid again.
Elements become invalid in following cases:
PsiElement.delete())isValid in interface PsiElementisValid in class PsiElementBasePsiUtilCore.ensureValid(PsiElement)public PsiElement setName(java.lang.String name) throws IncorrectOperationException
PsiNamedElementsetName in interface PsiNamedElementsetName in class FakePsiElementname - 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 boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean isEquivalentTo(PsiElement another)
PsiElementPsiManager.areElementsEquivalent(PsiElement, PsiElement) internally, which clients should invoke instead.
Implementations of this method should return true if the parameter is resolve-equivalent to this, i.e. it represents
the same entity from the language perspective. See also PsiManager.areElementsEquivalent(PsiElement, PsiElement) documentation.isEquivalentTo in interface PsiElementisEquivalentTo in class PsiElementBasepublic PsiElement getContext()
PsiElementgetParent(),
but the context can be overridden for some elements like code fragments (see
JavaCodeFragmentFactory.createCodeBlockCodeFragment(String, PsiElement, boolean)).getContext in interface PsiElementgetContext in class PsiElementBasepublic PsiElement getParent()
PsiElementgetParent in interface PsiElementgetParent in class RenameableFakePsiElementpublic void navigate(boolean requestFocus)
Navigatablenavigate in interface Navigatablenavigate in class PsiElementBaserequestFocus - 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 NavigatablecanNavigate in class PsiElementBasefalse 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 NavigatablecanNavigateToSource in class PsiElementBasefalse if navigation to source is not possible for any reason.public PsiFile getContainingFile()
PsiElementgetContainingFile in interface PsiElementgetContainingFile in class RenameableFakePsiElementpublic Language getLanguage()
PsiElementgetLanguage in interface PsiElementgetLanguage in class RenameableFakePsiElementpublic Project getProject()
PsiElementgetProject in interface PsiElementgetProject in class RenameableFakePsiElementpublic java.lang.String getLocationString()
ItemPresentationgetLocationString in interface ItemPresentationgetLocationString in class FakePsiElement