Class AbstractAutoCompleterView
- java.lang.Object
-
- org.omegat.gui.editor.autocompleter.AbstractAutoCompleterView
-
- Direct Known Subclasses:
AutoCompleterListView
,AutoCompleterTableView
public abstract class AbstractAutoCompleterView extends java.lang.Object
An abstract auto-completer view.
-
-
Constructor Summary
Constructors Constructor Description AbstractAutoCompleterView(java.lang.String name)
Creates a new auto-completer view.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
abstract int
getPreferredHeight()
get the preferred height of the componentabstract int
getPreferredWidth()
get the preferred width of the componentabstract int
getRowCount()
return the size of the data list / array.abstract AutoCompleterItem
getSelectedValue()
get the selected valueLanguage
getTargetLanguage()
Return the target language currently in use.ITokenizer
getTokenizer()
Return the tokenizer for use with the view.abstract java.awt.Component
getViewContent()
Obtain the content to put in the autocompleter popup.abstract boolean
processKeys(java.awt.event.KeyEvent e)
Process the autocompletion keysvoid
setParent(AutoCompleter completer)
Set the AutoCompleter that this view belongs to.boolean
shouldCloseOnSelection()
Indicates whether or not the AutoCompleter should close by default when the user confirms a selection.abstract boolean
shouldPopUp()
Return true to indicate that the view has relevant contextual suggestions that merit displaying the AutoCompleter popup unprompted.abstract void
updateViewData()
Update the view data
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- the name
-
setParent
public void setParent(AutoCompleter completer)
Set the AutoCompleter that this view belongs to.- Parameters:
completer
-
-
getTokenizer
public ITokenizer getTokenizer()
Return the tokenizer for use with the view. Custom views should override this if they have special tokenization needs.
-
getTargetLanguage
public Language getTargetLanguage()
Return the target language currently in use.
-
processKeys
public abstract boolean processKeys(java.awt.event.KeyEvent e)
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:
-
getPreferredHeight
public abstract int getPreferredHeight()
get the preferred height of the component- Returns:
-
getPreferredWidth
public abstract int getPreferredWidth()
get the preferred width of the component- Returns:
-
getSelectedValue
public abstract AutoCompleterItem getSelectedValue()
get the selected value- Returns:
-
updateViewData
public abstract void updateViewData()
Update the view data
-
getViewContent
public abstract java.awt.Component 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
-
-