Package docking.widgets.autocomplete
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
ConstructorDescriptionAutocompletionEvent
(T sel, JTextField field) Create a new event on the given selection and text field. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Prevent the actual completion action from taking place.void
consume()
Prevent this event from being further processed.getField()
Get the field having focus at the time of the event.Get the item that was selected at the time of the event.boolean
Check if the actual completion action will be performed.boolean
Check if this event has been consumed by an earlier listener.
-
Constructor Details
-
AutocompletionEvent
Create a new event on the given selection and text field.- Parameters:
sel
- the currently-selected (or activated) item.field
- the field 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.
-
getField
Get the field having focus at the time of the event. If the autocompleter is attached to multiple fields, this can be used to identify which field produced the event.- Returns:
- the focused field
-
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.
-