public abstract class ChooseByNameBase extends java.lang.Object implements ChooseByNameViewModel
Modifier and Type | Class and Description |
---|---|
class |
ChooseByNameBase.JPanelProvider |
protected class |
ChooseByNameBase.MyTextField |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXTRA_ELEM |
protected ChooseByNamePopupComponent.Callback |
myActionListener |
protected Alarm |
myAlarm |
protected javax.swing.JCheckBox |
myCheckBox |
protected JBPopup |
myDropdownPopup |
protected javax.swing.JList<java.lang.Object> |
myList |
protected ChooseByNameModel |
myModel |
protected Project |
myProject |
protected ChooseByNameItemProvider |
myProvider |
protected ChooseByNameBase.MyTextField |
myTextField |
static java.lang.String |
TEMPORARILY_FOCUSABLE_COMPONENT_KEY |
Modifier | Constructor and Description |
---|---|
protected |
ChooseByNameBase(Project project,
ChooseByNameModel model,
ChooseByNameItemProvider provider,
java.lang.String initialText) |
protected |
ChooseByNameBase(Project project,
ChooseByNameModel model,
ChooseByNameItemProvider provider,
java.lang.String initialText,
int initialIndex) |
protected |
ChooseByNameBase(Project project,
ChooseByNameModel model,
java.lang.String initialText,
PsiElement context) |
Modifier and Type | Method and Description |
---|---|
int |
calcSelectedIndex(java.lang.Object [] modelElements,
java.lang.String trimmedText) |
boolean |
canShowListForEmptyPattern()
If true, top matching candidates should be shown in the popup also when the entered pattern is empty.
|
boolean |
checkDisposed() |
protected void |
chosenElementMightChange() |
protected abstract void |
close(boolean isOk) |
protected boolean |
closeForbidden(boolean ok) |
protected void |
doClose(boolean ok) |
protected java.util.Set<java.lang.Object> |
filter(java.util.Set<java.lang.Object> elements) |
java.lang.Object |
getChosenElement() |
protected java.util.List<java.lang.Object> |
getChosenElements() |
int |
getMaximumListSizeLimit()
Returns the maximum number of candidates to show in the popup.
|
ChooseByNameModel |
getModel() |
java.lang.String [] |
getNames(boolean checkboxState) |
Project |
getProject() |
ChooseByNameItemProvider |
getProvider() |
javax.swing.JTextField |
getTextField() |
java.lang.String |
getTrimmedText() |
boolean |
hasPostponedAction()
Deprecated.
unused
|
protected abstract void |
hideList() |
protected void |
initUI(ChooseByNamePopupComponent.Callback callback,
ModalityState modalityState,
boolean allowMultipleSelection) |
void |
invoke(ChooseByNamePopupComponent.Callback callback,
ModalityState modalityState,
boolean allowMultipleSelection) |
protected abstract boolean |
isCheckboxVisible() |
protected abstract boolean |
isCloseByFocusLost() |
boolean |
isClosedByShiftEnter() |
boolean |
isOpenInCurrentWindowRequested() |
boolean |
isSearchInAnyPlace()
If true, the pattern entered in the dialog should be searched anywhere in the text of the candidate items, not just in the beginning.
|
protected abstract boolean |
isShowListForEmptyPattern() |
void |
rebuildList(boolean initial)
Default rebuild list.
|
void |
scheduleCalcElements(java.lang.String text,
boolean checkboxState,
ModalityState modalityState,
SelectionPolicy policy,
Consumer<? super java.util.Set<?>> callback) |
void |
setAlwaysHasMore(boolean enabled)
Display ... item at the end of the list regardless of whether it was filled up or not.
|
void |
setCheckBoxShortcut(ShortcutSet shortcutSet) |
void |
setDisposed(boolean disposedFlag) |
void |
setFindUsagesTitle(java.lang.String findUsagesTitle) |
void |
setListSizeIncreasing(int listSizeIncreasing) |
void |
setMaximumListSizeLimit(int maximumListSizeLimit) |
void |
setSearchInAnyPlace(boolean searchInAnyPlace) |
void |
setToolArea(javax.swing.JComponent toolArea)
Set tool area.
|
protected abstract void |
showList() |
protected void |
showTextFieldPanel() |
java.lang.String |
transformPattern(java.lang.String pattern)
Transforms text entered by the user in the dialog into the search pattern (for example, removes irrelevant suffixes like "line ...")
|
public static final java.lang.String TEMPORARILY_FOCUSABLE_COMPONENT_KEY
protected final Project myProject
protected final ChooseByNameModel myModel
protected ChooseByNameItemProvider myProvider
protected final ChooseByNameBase.MyTextField myTextField
protected final javax.swing.JCheckBox myCheckBox
protected final javax.swing.JList<java.lang.Object> myList
protected ChooseByNamePopupComponent.Callback myActionListener
protected final Alarm myAlarm
protected JBPopup myDropdownPopup
public static final java.lang.String EXTRA_ELEM
protected ChooseByNameBase(Project project, ChooseByNameModel model, java.lang.String initialText, PsiElement context)
initialText
- initial text which will be in the lookup text fieldprotected ChooseByNameBase(Project project, ChooseByNameModel model, ChooseByNameItemProvider provider, java.lang.String initialText)
protected ChooseByNameBase(Project project, ChooseByNameModel model, ChooseByNameItemProvider provider, java.lang.String initialText, int initialIndex)
initialText
- initial text which will be in the lookup text fieldpublic boolean checkDisposed()
public void setDisposed(boolean disposedFlag)
public Project getProject()
getProject
in interface ChooseByNameViewModel
public boolean isSearchInAnyPlace()
ChooseByNameViewModel
isSearchInAnyPlace
in interface ChooseByNameViewModel
public void setSearchInAnyPlace(boolean searchInAnyPlace)
public boolean isClosedByShiftEnter()
public boolean isOpenInCurrentWindowRequested()
public void setToolArea(javax.swing.JComponent toolArea)
toolArea
- a tool area componentpublic void setFindUsagesTitle(java.lang.String findUsagesTitle)
public void invoke(ChooseByNamePopupComponent.Callback callback, ModalityState modalityState, boolean allowMultipleSelection)
public ChooseByNameModel getModel()
getModel
in interface ChooseByNameViewModel
protected void initUI(ChooseByNamePopupComponent.Callback callback, ModalityState modalityState, boolean allowMultipleSelection)
modalityState
- - if not null rebuilds list in given ModalityState
public void setCheckBoxShortcut(ShortcutSet shortcutSet)
public void rebuildList(boolean initial)
myRebuildDelay
and current modality state.public java.lang.String transformPattern(java.lang.String pattern)
ChooseByNameViewModel
transformPattern
in interface ChooseByNameViewModel
protected void doClose(boolean ok)
protected boolean closeForbidden(boolean ok)
public java.lang.String getTrimmedText()
public java.lang.String [] getNames(boolean checkboxState)
protected java.util.Set<java.lang.Object> filter(java.util.Set<java.lang.Object> elements)
protected abstract boolean isCheckboxVisible()
protected abstract boolean isShowListForEmptyPattern()
protected abstract boolean isCloseByFocusLost()
protected void showTextFieldPanel()
public void scheduleCalcElements(java.lang.String text, boolean checkboxState, ModalityState modalityState, SelectionPolicy policy, Consumer<? super java.util.Set<?>> callback)
public int calcSelectedIndex(java.lang.Object [] modelElements, java.lang.String trimmedText)
@Deprecated public boolean hasPostponedAction()
protected abstract void showList()
protected abstract void hideList()
protected abstract void close(boolean isOk)
public java.lang.Object getChosenElement()
protected java.util.List<java.lang.Object> getChosenElements()
protected void chosenElementMightChange()
public ChooseByNameItemProvider getProvider()
public boolean canShowListForEmptyPattern()
ChooseByNameViewModel
canShowListForEmptyPattern
in interface ChooseByNameViewModel
public int getMaximumListSizeLimit()
ChooseByNameViewModel
getMaximumListSizeLimit
in interface ChooseByNameViewModel
public void setMaximumListSizeLimit(int maximumListSizeLimit)
public void setListSizeIncreasing(int listSizeIncreasing)
public void setAlwaysHasMore(boolean enabled)
ChooseByNameItemProvider
won't give new items.public javax.swing.JTextField getTextField()