Class AutoCompleterListView
java.lang.Object
org.omegat.gui.editor.autocompleter.AbstractAutoCompleterView
org.omegat.gui.editor.autocompleter.AutoCompleterListView
- Direct Known Subclasses:
AutotextAutoCompleterView,GlossaryAutoCompleterView,HistoryCompleter,HistoryPredictor,TagAutoCompleterView
A list based auto-completer view.
-
Constructor Summary
ConstructorsConstructorDescriptionAutoCompleterListView(String name) Deprecated.AutoCompleterListView(String name, AutoCompleter completer) -
Method Summary
Modifier and TypeMethodDescriptionabstract List<AutoCompleterItem>computeListData(String prevText, boolean contextualOnly) Compute the items visible in the auto-completer listgetList()intget the preferred height of the componentintget the preferred width of the componentintreturn the size of the data list / array.get the selected valueObtain the content to put in the autocompleter popup.abstract StringEach view should determine how to print a view item.booleanProcess the autocompletion keysbooleanReturn true to indicate that the view has relevant contextual suggestions that merit displaying the AutoCompleter popup unprompted.voidUpdate the view data.Methods inherited from class org.omegat.gui.editor.autocompleter.AbstractAutoCompleterView
getName, getTargetLanguage, getTokenizer, setParent, shouldCloseOnSelection
-
Constructor Details
-
AutoCompleterListView
Deprecated. -
AutoCompleterListView
-
-
Method Details
-
getList
-
processKeys
Description copied from class:AbstractAutoCompleterViewProcess the autocompletion keys- Specified by:
processKeysin classAbstractAutoCompleterView- Parameters:
e- the key event to process- Returns:
- true if a key has been processed, false if otherwise.
-
getRowCount
public int getRowCount()Description copied from class:AbstractAutoCompleterViewreturn the size of the data list / array.- Specified by:
getRowCountin classAbstractAutoCompleterView- Returns:
- the size of the data list / array.
-
getPreferredHeight
public int getPreferredHeight()Description copied from class:AbstractAutoCompleterViewget the preferred height of the component- Specified by:
getPreferredHeightin classAbstractAutoCompleterView- Returns:
- the preferred height of the component
-
getPreferredWidth
public int getPreferredWidth()Description copied from class:AbstractAutoCompleterViewget the preferred width of the component- Specified by:
getPreferredWidthin classAbstractAutoCompleterView- Returns:
- the preferred width of the component
-
getSelectedValue
Description copied from class:AbstractAutoCompleterViewget the selected value- Specified by:
getSelectedValuein classAbstractAutoCompleterView- Returns:
- the selected value
-
getViewContent
Description copied from class:AbstractAutoCompleterViewObtain the content to put in the autocompleter popup. The view should also do any other preparation necessary for display.- Specified by:
getViewContentin classAbstractAutoCompleterView- Returns:
- the component to show in the autocompleter popup
-
updateViewData
public void updateViewData()Description copied from class:AbstractAutoCompleterViewUpdate the view data.- Specified by:
updateViewDatain classAbstractAutoCompleterView
-
shouldPopUp
public boolean shouldPopUp()Description copied from class:AbstractAutoCompleterViewReturn true to indicate that the view has relevant contextual suggestions that merit displaying the AutoCompleter popup unprompted.- Specified by:
shouldPopUpin classAbstractAutoCompleterView- Returns:
- Whether or not the AutoCompleter should appear
-
computeListData
Compute the items visible in the auto-completer list- Parameters:
prevText- the text in the editing field up to the cursor location- Returns:
- a list of AutoCompleterItems.
-
itemToString
Each view should determine how to print a view item.- Parameters:
item- The item to print- Returns:
- A string representation of the view item
-