Class AbstractAutoCompleterView
java.lang.Object
org.omegat.gui.editor.autocompleter.AbstractAutoCompleterView
- Direct Known Subclasses:
AutoCompleterListView,AutoCompleterTableView
An abstract auto-completer view.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.AbstractAutoCompleterView(String name, AutoCompleter completer) Creates a new auto-completer view. -
Method Summary
Modifier and TypeMethodDescriptiongetName()Return the name of this view.abstract intget the preferred height of the componentabstract intget the preferred width of the componentabstract intreturn the size of the data list / array.abstract AutoCompleterItemget the selected valueReturn the target language currently in use.Return the tokenizer for use with the view.abstract ComponentObtain the content to put in the autocompleter popup.abstract booleanProcess the autocompletion keysvoidsetParent(AutoCompleter completer) Deprecated.booleanIndicates whether or not the AutoCompleter should close by default when the user confirms a selection.abstract booleanReturn true to indicate that the view has relevant contextual suggestions that merit displaying the AutoCompleter popup unprompted.abstract voidUpdate the view data.
-
Constructor Details
-
AbstractAutoCompleterView
Deprecated.Creates a new auto-completer view.- Parameters:
name- the name of this view
-
AbstractAutoCompleterView
Creates a new auto-completer view.- Parameters:
name- the name of this viewcompleter- the completer
-
-
Method Details
-
getName
Return the name of this view.- Returns:
- the name
-
setParent
Deprecated.Set the AutoCompleter that this view belongs to.- Parameters:
completer- the completer
-
getTokenizer
Return the tokenizer for use with the view. Custom views should override this if they have special tokenization needs. -
getTargetLanguage
Return the target language currently in use. -
processKeys
Process the autocompletion keys- Parameters:
e- the key event to process- Returns:
- true if a key has been processed, false if otherwise.
-
getRowCount
public abstract int getRowCount()return the size of the data list / array.- Returns:
- the size of the data list / array.
-
getPreferredHeight
public abstract int getPreferredHeight()get the preferred height of the component- Returns:
- the preferred height of the component
-
getPreferredWidth
public abstract int getPreferredWidth()get the preferred width of the component- Returns:
- the preferred width of the component
-
getSelectedValue
get the selected value- Returns:
- the selected value
-
updateViewData
public abstract void updateViewData()Update the view data. -
getViewContent
Obtain the content to put in the autocompleter popup. The view should also do any other preparation necessary for display.- Returns:
- the component to show in the autocompleter popup
-
shouldPopUp
public abstract boolean shouldPopUp()Return true to indicate that the view has relevant contextual suggestions that merit displaying the AutoCompleter popup unprompted.- Returns:
- Whether or not the AutoCompleter should appear
-
shouldCloseOnSelection
public boolean shouldCloseOnSelection()Indicates whether or not the AutoCompleter should close by default when the user confirms a selection. Override and return false to keep the popup open.- Returns:
- Whether or not the AutoCompleter popup should close upon selection
-