Class AutocompletionEvent<T>
java.lang.Object
docking.widgets.autocomplete.AutocompletionEvent<T>
- Type Parameters:
T- the type of suggestions given by the autocompleter.
An event related to autocompletion, usually a completion being activated by the user.
- See Also:
-
Constructor Summary
ConstructorsChangeConstructorDescriptionAutocompletionEvent(T sel, JTextComponent component) Create a new event on the given selection and text component. -
Method Summary
ChangeModifier and TypeMethodDescriptionvoidcancel()Prevent the actual completion action from taking place.voidconsume()Prevent this event from being further processed.Get the component having focus at the time of the event.Get the item that was selected at the time of the event.booleanCheck if the actual completion action will be performed.booleanCheck if this event has been consumed by an earlier listener.REMOVEDJTextFieldgetField() Removed
-
Constructor Details
-
AutocompletionEvent
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
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
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.
-