public abstract class LookupElement extends UserDataHolderBase
LookupElementBuilder.
Another way is to subclass it. Use the latter way only if you need it to implement some additional interface, to modify equals/hashCode
or other advanced logic.PrioritizedLookupElement| Modifier and Type | Field and Description |
|---|---|
static LookupElement[] |
EMPTY_ARRAY |
| Constructor and Description |
|---|
LookupElement() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
as(java.lang.Class<T> clazz)
Return the first element of the given class in a
LookupElementDecorator wrapper chain. |
<T> T |
as(ClassConditionKey<T> conditionKey)
Prefer to use
as(Class) |
java.util.Set<java.lang.String> |
getAllLookupStrings() |
AutoCompletionPolicy |
getAutoCompletionPolicy() |
abstract java.lang.String |
getLookupString() |
java.lang.Object |
getObject() |
PsiElement |
getPsiElement() |
void |
handleInsert(InsertionContext context) |
boolean |
isCaseSensitive() |
boolean |
isValid() |
boolean |
isWorthShowingInAutoPopup()
Invoked when the completion autopopup contains only the items that exactly match the user-entered prefix to determine
whether the popup should be closed to not get in the way when navigating through the code.
|
void |
renderElement(LookupElementPresentation presentation) |
boolean |
requiresCommittedDocuments() |
java.lang.String |
toString() |
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMappublic static final LookupElement[] EMPTY_ARRAY
public abstract java.lang.String getLookupString()
public java.util.Set<java.lang.String> getAllLookupStrings()
public java.lang.Object getObject()
public PsiElement getPsiElement()
getObject() result.public boolean isValid()
public void handleInsert(InsertionContext context)
public boolean requiresCommittedDocuments()
handleInsert(com.intellij.codeInsight.completion.InsertionContext) expects all documents to be committed at the moment of its invocation.
The default is true, overriders can change that, for example if automatic commit is too slow.public AutoCompletionPolicy getAutoCompletionPolicy()
public java.lang.String toString()
toString in class java.lang.Objectpublic void renderElement(LookupElementPresentation presentation)
public <T> T as(ClassConditionKey<T> conditionKey)
as(Class)public <T> T as(java.lang.Class<T> clazz)
LookupElementDecorator wrapper chain.
If this object is not a decorator, return it if it's instance of the given class, otherwise null.public boolean isCaseSensitive()
public boolean isWorthShowingInAutoPopup()