public class LookupImpl extends LightweightHint implements LookupEx, Disposable, LookupElementListPresenter
| Modifier and Type | Class and Description |
|---|---|
static class |
LookupImpl.FocusDegree
Deprecated.
|
Disposable.ParentSHOWN_AT_DEBUGAUTO_INSERT_SELECT_CHAR, COMPLETE_STATEMENT_SELECT_CHAR, NORMAL_SELECT_CHAR, REPLACE_SELECT_CHAR| Constructor and Description |
|---|
LookupImpl(Project project,
Editor editor,
LookupArranger arranger) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAdvertisement(java.lang.String text,
javax.swing.Icon icon) |
boolean |
addItem(LookupElement item,
PrefixMatcher matcher) |
void |
addLookupListener(LookupListener listener) |
void |
addPrefixChangeListener(PrefixChangeListener listener,
Disposable parentDisposable) |
void |
checkValid() |
void |
clear() |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
void |
ensureSelectionVisible(boolean forceTopSelection) |
void |
finishLookup(char completionChar) |
void |
finishLookup(char completionChar,
LookupElement item) |
void |
fireItemSelected(LookupElement item,
char completionChar) |
java.util.Collection<LookupElementAction> |
getActionsFor(LookupElement element) |
java.lang.String |
getAdditionalPrefix() |
java.util.List<java.lang.String> |
getAdvertisements() |
Advertiser |
getAdvertiser() |
LookupArranger |
getArranger() |
LookupElement |
getCurrentItem() |
java.awt.Rectangle |
getCurrentItemBounds() |
LookupElement |
getCurrentItemOrEmpty() |
Editor |
getEditor()
Consider using
Lookup.getTopLevelEditor() if you don't need injected editor. |
java.util.List<LookupElement> |
getItems() |
static java.lang.String |
getLastLookupDisposeTrace() |
int |
getLastVisibleIndex() |
javax.swing.JList |
getList() |
LookupFocusDegree |
getLookupFocusDegree() |
int |
getLookupOriginalStart() |
int |
getLookupStart() |
int |
getPrefixLength(LookupElement item) |
Project |
getProject() |
PsiElement |
getPsiElement() |
PsiFile |
getPsiFile() |
java.util.Map<LookupElement,java.util.List<Pair<java.lang.String,java.lang.Object>>> |
getRelevanceObjects(java.lang.Iterable<? extends LookupElement> items,
boolean hideSingleValued) |
int |
getSelectedIndex() |
Editor |
getTopLevelEditor() |
void |
hide()
Hides current hint object.
|
void |
hideLookup(boolean explicitly) |
protected void |
insertLookupString(LookupElement item,
int prefix) |
static void |
insertLookupString(Project project,
Editor editor,
LookupElement item,
PrefixMatcher matcher,
java.lang.String itemPattern,
int prefixLength) |
boolean |
isAvailableToUser() |
boolean |
isCalculating() |
boolean |
isCompletion() |
boolean |
isFocused() |
boolean |
isLookupDisposed() |
boolean |
isPositionedAboveCaret() |
boolean |
isSelectionTouched() |
boolean |
isSelectionVisible() |
boolean |
isShown() |
boolean |
isStartCompletionWhenNothingMatches() |
PrefixMatcher |
itemMatcher(LookupElement item) |
java.lang.String |
itemPattern(LookupElement element) |
void |
markReused() |
void |
markSelectionTouched() |
boolean |
mayBeNoticed() |
protected void |
onPopupCancel() |
boolean |
performGuardedChange(java.lang.Runnable change) |
void |
refreshUi(boolean mayCheckReused,
boolean onExplicitAction) |
void |
removeLookupListener(LookupListener listener) |
void |
repaintLookup(boolean onExplicitAction,
boolean reused,
boolean selectionVisible,
boolean itemsChanged) |
void |
replacePrefix(java.lang.String presentPrefix,
java.lang.String newPrefix) |
void |
requestResize() |
void |
resort(boolean addAgain) |
void |
setArranger(LookupArranger arranger) |
void |
setCalculating(boolean calculating) |
void |
setCurrentItem(LookupElement item) |
void |
setDummyItemCount(int count) |
void |
setFocusDegree(LookupImpl.FocusDegree focusDegree)
Deprecated.
|
void |
setLastVisibleIndex(int lastVisibleIndex) |
void |
setLookupFocusDegree(LookupFocusDegree lookupFocusDegree) |
void |
setPrefixChangeListener(PrefixChangeListener listener) |
void |
setSelectedIndex(int index) |
void |
setSelectionTouched(boolean selectionTouched) |
void |
setStartCompletionWhenNothingMatches(boolean startCompletionWhenNothingMatches) |
void |
showElementActions(java.awt.event.InputEvent event) |
boolean |
showLookup() |
void |
updateLookupWidth(LookupElement item) |
boolean |
vetoesHiding() |
addHintListener, beforeShow, canAutoHideOn, canControlAutoHide, getBounds, getComponent, getCurrentIdeTooltip, getLocationOn, getSize, hide, isAwtTooltip, isForceHideShadow, isInsideHint, isRealPopup, isSelectingHint, isVisible, pack, removeHintListener, setCancelOnClickOutside, setCancelOnOtherWindowOpen, setFocusRequestor, setForceHideShadow, setForceLightweightPopup, setForceShowAsPopup, setLocation, setResizable, setSelectingHint, setSize, setTitle, show, toString, updateLocation, updatePositionchangeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMapequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentpublic LookupImpl(Project project, Editor editor, LookupArranger arranger)
public LookupArranger getArranger()
public void setArranger(LookupArranger arranger)
@Deprecated public void setFocusDegree(LookupImpl.FocusDegree focusDegree)
setLookupFocusDegree(LookupFocusDegree)public LookupFocusDegree getLookupFocusDegree()
getLookupFocusDegree in interface LookupElementListPresenterpublic void setLookupFocusDegree(LookupFocusDegree lookupFocusDegree)
public boolean isCalculating()
public void setCalculating(boolean calculating)
public void markSelectionTouched()
public void setSelectionTouched(boolean selectionTouched)
public int getSelectedIndex()
getSelectedIndex in interface LookupElementListPresenterpublic void setSelectedIndex(int index)
public void setDummyItemCount(int count)
public void repaintLookup(boolean onExplicitAction,
boolean reused,
boolean selectionVisible,
boolean itemsChanged)
public void resort(boolean addAgain)
public boolean addItem(LookupElement item, PrefixMatcher matcher)
public void clear()
public void updateLookupWidth(LookupElement item)
public void requestResize()
public java.util.Collection<LookupElementAction> getActionsFor(LookupElement element)
public javax.swing.JList getList()
public java.util.List<LookupElement> getItems()
public java.lang.String getAdditionalPrefix()
getAdditionalPrefix in interface LookupElementListPresenterpublic void setStartCompletionWhenNothingMatches(boolean startCompletionWhenNothingMatches)
public boolean isStartCompletionWhenNothingMatches()
public void ensureSelectionVisible(boolean forceTopSelection)
public boolean isSelectionVisible()
public java.lang.String itemPattern(LookupElement element)
itemPattern in interface Lookuppublic PrefixMatcher itemMatcher(LookupElement item)
itemMatcher in interface Lookuppublic void finishLookup(char completionChar)
public void finishLookup(char completionChar,
LookupElement item)
public int getPrefixLength(LookupElement item)
protected void insertLookupString(LookupElement item, int prefix)
public static void insertLookupString(Project project, Editor editor, LookupElement item, PrefixMatcher matcher, java.lang.String itemPattern, int prefixLength)
public int getLookupStart()
getLookupStart in interface LookupLookup.getTopLevelEditor() which this lookup's left side should be aligned with. Note that if the lookup doesn't fit
the screen due to its dimensions, the actual position might differ from this editor offset.public int getLookupOriginalStart()
public boolean performGuardedChange(java.lang.Runnable change)
public boolean vetoesHiding()
vetoesHiding in class LightweightHintpublic boolean isAvailableToUser()
public boolean isShown()
isShown in interface LookupElementListPresenterpublic boolean showLookup()
public Advertiser getAdvertiser()
public boolean mayBeNoticed()
public LookupElement getCurrentItem()
getCurrentItem in interface LookupElementListPresentergetCurrentItem in interface Lookuppublic LookupElement getCurrentItemOrEmpty()
getCurrentItemOrEmpty in interface LookupElementListPresenterpublic void setCurrentItem(LookupElement item)
setCurrentItem in interface LookupExpublic void addLookupListener(LookupListener listener)
addLookupListener in interface Lookuppublic void removeLookupListener(LookupListener listener)
removeLookupListener in interface Lookuppublic java.awt.Rectangle getCurrentItemBounds()
getCurrentItemBounds in interface Lookuppublic void fireItemSelected(LookupElement item, char completionChar)
public void replacePrefix(java.lang.String presentPrefix,
java.lang.String newPrefix)
public PsiFile getPsiFile()
getPsiFile in interface LookupLookup.getEditor()public boolean isCompletion()
isCompletion in interface Lookuppublic PsiElement getPsiElement()
getPsiElement in interface LookupLookup.getLookupStart()) in Lookup.getPsiFile() result.public Editor getEditor()
LookupLookup.getTopLevelEditor() if you don't need injected editor.public Editor getTopLevelEditor()
getTopLevelEditor in interface Lookuppublic Project getProject()
getProject in interface Lookuppublic boolean isPositionedAboveCaret()
isPositionedAboveCaret in interface Lookuppublic boolean isSelectionTouched()
isSelectionTouched in interface LookupElementListPresenterisSelectionTouched in interface Lookuppublic int getLastVisibleIndex()
getLastVisibleIndex in interface LookupElementListPresenterpublic void setLastVisibleIndex(int lastVisibleIndex)
public java.util.List<java.lang.String> getAdvertisements()
getAdvertisements in interface Lookuppublic void hide()
Hinthide in interface Hinthide in class LightweightHintpublic void hideLookup(boolean explicitly)
hideLookup in interface LookupExprotected void onPopupCancel()
onPopupCancel in class LightweightHintpublic static java.lang.String getLastLookupDisposeTrace()
public void dispose()
Disposabledispose in interface Disposablepublic void refreshUi(boolean mayCheckReused,
boolean onExplicitAction)
public void markReused()
public void addAdvertisement(java.lang.String text,
javax.swing.Icon icon)
public boolean isLookupDisposed()
public void checkValid()
public void showElementActions(java.awt.event.InputEvent event)
showElementActions in interface LookupExpublic java.util.Map<LookupElement,java.util.List<Pair<java.lang.String,java.lang.Object>>> getRelevanceObjects(java.lang.Iterable<? extends LookupElement> items, boolean hideSingleValued)
public void setPrefixChangeListener(PrefixChangeListener listener)
public void addPrefixChangeListener(PrefixChangeListener listener, Disposable parentDisposable)