Class AutocompletionEvent<T>

java.lang.Object
docking.widgets.autocomplete.AutocompletionEvent<T>
Type Parameters:
T - the type of suggestions given by the autocompleter.

public class AutocompletionEvent<T> extends Object
An event related to autocompletion, usually a completion being activated by the user.
See Also:
  • Constructor Details

    • AutocompletionEvent

      public AutocompletionEvent(T sel, JTextComponent component)
      Create a new event on the given selection and text component.
      Parameters:
      sel - the currently-selected (or activated) item.
      component - the component having focus at the time of the event.
  • Method Details

    • getSelection

      public T getSelection()
      Get the item that was selected at the time of the event. For activation, this is the activated suggestion.
      Returns:
      the selected suggestion.
    • getComponent NEW

      public JTextComponent getComponent()
      Get the component having focus at the time of the event. If the autocompleter is attached to multiple components, this can be used to identify which component produced the event.
      Returns:
      the focused component
    • consume

      public void consume()
      Prevent this event from being further processed. The actual completion action will still be completed, though.
    • isConsumed

      public boolean isConsumed()
      Check if this event has been consumed by an earlier listener.
      Returns:
      true if the event has been consumed, i.e., should not be further processed.
    • cancel

      public void cancel()
      Prevent the actual completion action from taking place. Further listeners may still process this event, though.
    • isCancelled

      public boolean isCancelled()
      Check if the actual completion action will be performed.
      Returns:
      true if the completion action has been cancelled.