Class AbstractAutoCompleterView
- java.lang.Object
-
- org.omegat.gui.editor.autocompleter.AbstractAutoCompleterView
-
- Direct Known Subclasses:
AutoCompleterListView,AutoCompleterTableView
public abstract class AbstractAutoCompleterView extends java.lang.ObjectAn 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.StringgetName()abstract intgetPreferredHeight()get the preferred height of the componentabstract intgetPreferredWidth()get the preferred width of the componentabstract intgetRowCount()return the size of the data list / array.abstract AutoCompleterItemgetSelectedValue()get the selected valueLanguagegetTargetLanguage()Return the target language currently in use.ITokenizergetTokenizer()Return the tokenizer for use with the view.abstract java.awt.ComponentgetViewContent()Obtain the content to put in the autocompleter popup.abstract booleanprocessKeys(java.awt.event.KeyEvent e)Process the autocompletion keysvoidsetParent(AutoCompleter completer)Set the AutoCompleter that this view belongs to.booleanshouldCloseOnSelection()Indicates whether or not the AutoCompleter should close by default when the user confirms a selection.abstract booleanshouldPopUp()Return true to indicate that the view has relevant contextual suggestions that merit displaying the AutoCompleter popup unprompted.abstract voidupdateViewData()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
-
-