Class AbstractAutoCompleterView

java.lang.Object
org.omegat.gui.editor.autocompleter.AbstractAutoCompleterView
Direct Known Subclasses:
AutoCompleterListView, AutoCompleterTableView

public abstract class AbstractAutoCompleterView extends Object
An abstract auto-completer view.
  • Constructor Details

    • AbstractAutoCompleterView

      @Deprecated public AbstractAutoCompleterView(String name)
      Deprecated.
      Creates a new auto-completer view.
      Parameters:
      name - the name of this view
    • AbstractAutoCompleterView

      public AbstractAutoCompleterView(String name, AutoCompleter completer)
      Creates a new auto-completer view.
      Parameters:
      name - the name of this view
      completer - the completer
  • Method Details

    • getName

      public String getName()
      Return the name of this view.
      Returns:
      the name
    • setParent

      @Deprecated public void setParent(AutoCompleter completer)
      Deprecated.
      Set the AutoCompleter that this view belongs to.
      Parameters:
      completer - the 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(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:
      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

      public abstract AutoCompleterItem getSelectedValue()
      get the selected value
      Returns:
      the selected value
    • updateViewData

      public abstract void updateViewData()
      Update the view data.
    • getViewContent

      public abstract 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