public abstract class AutoCompleterListView extends AbstractAutoCompleterView
completer
Constructor and Description |
---|
AutoCompleterListView(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
abstract java.util.List<AutoCompleterItem> |
computeListData(java.lang.String prevText,
boolean contextualOnly)
Compute the items visible in the auto-completer list
|
protected java.lang.String |
getLastToken(java.lang.String text) |
javax.swing.JList<AutoCompleterItem> |
getList() |
int |
getPreferredHeight()
get the preferred height of the component
|
int |
getPreferredWidth()
get the preferred width of the component
|
int |
getRowCount()
return the size of the data list / array.
|
AutoCompleterItem |
getSelectedValue()
get the selected value
|
java.awt.Component |
getViewContent()
Obtain the content to put in the autocompleter popup.
|
abstract java.lang.String |
itemToString(AutoCompleterItem item)
Each view should determine how to print a view item.
|
boolean |
processKeys(java.awt.event.KeyEvent e)
Process the autocompletion keys
|
protected void |
selectNextPossibleValue()
Selects the next item in the list.
|
protected void |
selectNextPossibleValueByPage()
Selects the item in the list following the current one by one page, or the last item if
there is less than one page following.
|
protected void |
selectPreviousPossibleValue()
Selects the previous item in the list.
|
protected void |
selectPreviousPossibleValueByPage()
Selects the item in the list preceding the current one by one page, or the first item if
there is less than one page preceding.
|
protected void |
setData(AutoCompleterItem... entries) |
boolean |
shouldPopUp()
Return true to indicate that the view has relevant contextual suggestions
that merit displaying the AutoCompleter popup unprompted.
|
void |
updateViewData()
Update the view data
|
getLeadingText, getModifiedRowCount, getName, getTargetLanguage, getTokenizer, isEnabled, setParent, shouldCloseOnSelection
public javax.swing.JList<AutoCompleterItem> getList()
public boolean processKeys(java.awt.event.KeyEvent e)
AbstractAutoCompleterView
processKeys
in class AbstractAutoCompleterView
e
- the key event to processprotected void selectNextPossibleValue()
protected void selectNextPossibleValueByPage()
protected void selectPreviousPossibleValue()
protected void selectPreviousPossibleValueByPage()
public int getRowCount()
AbstractAutoCompleterView
getRowCount
in class AbstractAutoCompleterView
public int getPreferredHeight()
AbstractAutoCompleterView
getPreferredHeight
in class AbstractAutoCompleterView
public int getPreferredWidth()
AbstractAutoCompleterView
getPreferredWidth
in class AbstractAutoCompleterView
protected void setData(AutoCompleterItem... entries)
public AutoCompleterItem getSelectedValue()
AbstractAutoCompleterView
getSelectedValue
in class AbstractAutoCompleterView
public java.awt.Component getViewContent()
AbstractAutoCompleterView
getViewContent
in class AbstractAutoCompleterView
public void updateViewData()
AbstractAutoCompleterView
updateViewData
in class AbstractAutoCompleterView
public boolean shouldPopUp()
AbstractAutoCompleterView
shouldPopUp
in class AbstractAutoCompleterView
protected java.lang.String getLastToken(java.lang.String text)
public abstract java.util.List<AutoCompleterItem> computeListData(java.lang.String prevText, boolean contextualOnly)
prevText
- the text in the editing field up to the cursor locationpublic abstract java.lang.String itemToString(AutoCompleterItem item)
item
- The item to print