public class LookupImpl extends LightweightHint implements LookupEx, Disposable, LookupElementListPresenter
Modifier and Type | Class and Description |
---|---|
static class |
LookupImpl.FocusDegree
Deprecated.
|
Disposable.Parent
SHOWN_AT_DEBUG
AUTO_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, updatePosition
changeUserMap, clearUserData, clone, copyCopyableDataTo, copyUserDataTo, getCopyableUserData, getUserData, getUserDataString, getUserMap, isUserDataEmpty, putCopyableUserData, putUserData, putUserDataIfAbsent, replace, setUserMap
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponent
public 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 LookupElementListPresenter
public 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 LookupElementListPresenter
public 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 LookupElementListPresenter
public 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 Lookup
public PrefixMatcher itemMatcher(LookupElement item)
itemMatcher
in interface Lookup
public 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 Lookup
Lookup.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 LightweightHint
public boolean isAvailableToUser()
public boolean isShown()
isShown
in interface LookupElementListPresenter
public boolean showLookup()
public Advertiser getAdvertiser()
public boolean mayBeNoticed()
public LookupElement getCurrentItem()
getCurrentItem
in interface LookupElementListPresenter
getCurrentItem
in interface Lookup
public LookupElement getCurrentItemOrEmpty()
getCurrentItemOrEmpty
in interface LookupElementListPresenter
public void setCurrentItem(LookupElement item)
setCurrentItem
in interface LookupEx
public void addLookupListener(LookupListener listener)
addLookupListener
in interface Lookup
public void removeLookupListener(LookupListener listener)
removeLookupListener
in interface Lookup
public java.awt.Rectangle getCurrentItemBounds()
getCurrentItemBounds
in interface Lookup
public void fireItemSelected(LookupElement item, char completionChar)
public void replacePrefix(java.lang.String presentPrefix, java.lang.String newPrefix)
public PsiFile getPsiFile()
getPsiFile
in interface Lookup
Lookup.getEditor()
public boolean isCompletion()
isCompletion
in interface Lookup
public PsiElement getPsiElement()
getPsiElement
in interface Lookup
Lookup.getLookupStart()
) in Lookup.getPsiFile()
result.public Editor getEditor()
Lookup
Lookup.getTopLevelEditor()
if you don't need injected editor.public Editor getTopLevelEditor()
getTopLevelEditor
in interface Lookup
public Project getProject()
getProject
in interface Lookup
public boolean isPositionedAboveCaret()
isPositionedAboveCaret
in interface Lookup
public boolean isSelectionTouched()
isSelectionTouched
in interface LookupElementListPresenter
isSelectionTouched
in interface Lookup
public int getLastVisibleIndex()
getLastVisibleIndex
in interface LookupElementListPresenter
public void setLastVisibleIndex(int lastVisibleIndex)
public java.util.List<java.lang.String> getAdvertisements()
getAdvertisements
in interface Lookup
public void hide()
Hint
hide
in interface Hint
hide
in class LightweightHint
public void hideLookup(boolean explicitly)
hideLookup
in interface LookupEx
protected void onPopupCancel()
onPopupCancel
in class LightweightHint
public static java.lang.String getLastLookupDisposeTrace()
public void dispose()
Disposable
dispose
in interface Disposable
public 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 LookupEx
public 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)