To use the autocompletion functionality, refer to the TextFields class.
The popup size can be modified through its setVisibleRowCount(int)
for the height and all the usual methods for the width.
TextFields
| Modifier and Type | Class and Description |
|---|---|
| public static class | AutoCompletionBinding.
Represents an Event which is fired after an auto completion. |
| private class | AutoCompletionBinding.
This task is responsible to fetch suggestions asynchronous by using the current defined suggestionProvider |
| public static interface | AutoCompletionBinding.
Represents a suggestion fetch request |
| Modifier and Type | Field and Description |
|---|---|
| private final AutoCompletePopup | |
| private final Node | completionTarget
* Private fields * * |
| private long | |
| pack-priv final EventHandlerManager | eventHandlerManager
* EventTarget Implementation * * |
| private boolean | |
| private ObjectProperty | |
| private Callback | |
| private AutoCompletionBinding | |
| private final Object |
| Access | Constructor and Description |
|---|---|
| protected | AutoCompletionBinding(Node
The target node to which auto-completion shall be added completionTarget, Callback<AutoCompletionBinding.The strategy to retrieve suggestions suggestionProvider,The converter to be used to convert suggestions to strings converter)Creates a new AutoCompletionBinding |
| Modifier and Type | Method and Description |
|---|---|
| public < the specific event class of the handler E extends Event> void | addEventHandler(EventType<E>
the type of the events to receive by the handler eventType, EventHandler<? super E> the handler to register eventHandler)Overrides default javafx. Registers an event handler to this EventTarget. |
| public EventDispatchChain | buildEventDispatchChain(EventDispatchChain tail)
Implements javafx. Construct an event dispatch chain for this target. |
| protected abstract void | |
| public abstract void | |
| protected void | |
| public AutoCompletePopup | Returns: theAutoCompletePopup used by this bindingGet the |
| public Node | Returns: the target node for auto completionGets the target node for auto completion |
| public final double | |
| public final double | |
| public final EventHandler | |
| public final double | |
| public final int | Returns: the maximum number of rows to be visible in the popup when it is showing.Return the maximum number of rows to be visible in the popup when it is showing. |
| protected void | |
| private boolean | |
| public final DoubleProperty | |
| public final DoubleProperty | |
| public final ObjectProperty | |
| private final void | onUserInputChanged(final String userText)
Occurs when the user text has changed and the suggestions require an update |
| public final DoubleProperty | |
| public < the specific event class of the handler E extends Event> void | removeEventHandler(EventType<E>
the event type from which to unregister eventType, EventHandler<? super E> the handler to unregister eventHandler)Overrides default javafx. Unregisters a previously registered event handler from this EventTarget. |
| private void | selectFirstSuggestion(AutoCompletePopup<?> autoCompletionPopup)
Selects the first suggestion (if any), so the user can choose it by pressing enter immediately. |
| public final void | setDelay(long delay)
Sets the delay in ms between a key press and the suggestion popup being displayed. |
| public void | setHideOnEscape(boolean value)
Specifies whether the PopupWindow should be hidden when an unhandled escape key is pressed while the popup has focus. |
| private void | setIgnoreInputChanges(boolean state)
If IgnoreInputChanges is set to true, all changes to the user input are ignored. |
| public final void | |
| public final void | |
| public final void | setOnAutoCompleted(EventHandler<AutoCompletionBinding.
Set a event handler which is invoked after an auto completion. |
| public final void | |
| public final void | |
| public final void | setVisibleRowCount(int value)
Set the maximum number of rows to be visible in the popup when it is showing. |
| protected void | |
| public final IntegerProperty | Returns: an property representing the maximum number of rows to be visible in the popup when it is showing.Return an property representing the maximum number of rows to be visible in the popup when it is showing. |
| autoCompletionPopup | back to summary |
|---|---|
| private final AutoCompletePopup<T> autoCompletionPopup | |
| completionTarget | back to summary |
|---|---|
| private final Node completionTarget * Private fields * * | |
| delay | back to summary |
|---|---|
| private long delay | |
| eventHandlerManager | back to summary |
|---|---|
| pack-priv final EventHandlerManager eventHandlerManager * EventTarget Implementation * * | |
| ignoreInputChanges | back to summary |
|---|---|
| private boolean ignoreInputChanges | |
| onAutoCompleted | back to summary |
|---|---|
| private ObjectProperty<EventHandler<AutoCompletionBinding. | |
| suggestionProvider | back to summary |
|---|---|
| private Callback<AutoCompletionBinding. | |
| suggestionsTask | back to summary |
|---|---|
| private AutoCompletionBinding<T>. | |
| suggestionsTaskLock | back to summary |
|---|---|
| private final Object suggestionsTaskLock | |
| AutoCompletionBinding | back to summary |
|---|---|
| protected AutoCompletionBinding(Node completionTarget, Callback<AutoCompletionBinding. Creates a new AutoCompletionBinding
| |
| addEventHandler | back to summary |
|---|---|
| public <E extends Event> void addEventHandler(EventType<E> eventType, EventHandler<? super E> eventHandler) Overrides default javafx. Registers an event handler to this EventTarget. The handler is called when the
menu item receives an
| |
| buildEventDispatchChain | back to summary |
|---|---|
| public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail) Implements javafx. Doc from javafx. Construct an event dispatch chain for this target. The event dispatch
chain contains event dispatchers which might be interested in processing
of events targeted at this In the case the event target is part of some hierarchy, the chain for it is usually built from event dispatchers collected from the root of the hierarchy to the event target. The event dispatch chain is constructed by modifications to the provided initial event dispatch chain. The returned chain should have the initial chain at its end so the dispatchers should be prepended to the initial chain. The caller shouldn't assume that the initial chain remains unchanged nor that the returned value will reference a different chain.
| |
| completeUserInput | back to summary |
|---|---|
| protected abstract void completeUserInput(T completion) Complete the current user-input with the provided completion. Sub-classes have to provide a concrete implementation. | |
| dispose | back to summary |
|---|---|
| public abstract void dispose() Disposes the binding. | |
| fireAutoCompletion | back to summary |
|---|---|
| protected void fireAutoCompletion(T completion) | |
| getAutoCompletionPopup | back to summary |
|---|---|
| public AutoCompletePopup Get the The only reason this is exposed is to allow custom skins for the popup.
| |
| getCompletionTarget | back to summary |
|---|---|
| public Node getCompletionTarget() Gets the target node for auto completion
| |
| getMaxWidth | back to summary |
|---|---|
| public final double getMaxWidth() Return the max width of the popup.
| |
| getMinWidth | back to summary |
|---|---|
| public final double getMinWidth() Return the min width of the popup.
| |
| getOnAutoCompleted | back to summary |
|---|---|
| public final EventHandler | |
| getPrefWidth | back to summary |
|---|---|
| public final double getPrefWidth() Return the pref width of the popup.
| |
| getVisibleRowCount | back to summary |
|---|---|
| public final int getVisibleRowCount() Return the maximum number of rows to be visible in the popup when it is showing.
| |
| hidePopup | back to summary |
|---|---|
| protected void hidePopup() Hide the auto completion targets | |
| isIgnoreInputChanges | back to summary |
|---|---|
| private boolean isIgnoreInputChanges() Shall changes to the user input be ignored? | |
| maxWidthProperty | back to summary |
|---|---|
| public final DoubleProperty maxWidthProperty() Return the property associated with the max width. | |
| minWidthProperty | back to summary |
|---|---|
| public final DoubleProperty minWidthProperty() Return the property associated with the min width. | |
| onAutoCompletedProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| onUserInputChanged | back to summary |
|---|---|
| private final void onUserInputChanged(final String userText) Occurs when the user text has changed and the suggestions require an update | |
| prefWidthProperty | back to summary |
|---|---|
| public final DoubleProperty prefWidthProperty() Return the property associated with the pref width. | |
| removeEventHandler | back to summary |
|---|---|
| public <E extends Event> void removeEventHandler(EventType<E> eventType, EventHandler<? super E> eventHandler) Overrides default javafx. Unregisters a previously registered event handler from this EventTarget. One handler might have been registered for different event types, so the caller needs to specify the particular event type from which to unregister the handler.
| |
| selectFirstSuggestion | back to summary |
|---|---|
| private void selectFirstSuggestion(AutoCompletePopup<?> autoCompletionPopup) Selects the first suggestion (if any), so the user can choose it by pressing enter immediately. | |
| setDelay | back to summary |
|---|---|
| public final void setDelay(long delay) Sets the delay in ms between a key press and the suggestion popup being displayed. | |
| setHideOnEscape | back to summary |
|---|---|
| public void setHideOnEscape(boolean value) Specifies whether the PopupWindow should be hidden when an unhandled escape key is pressed while the popup has focus. | |
| setIgnoreInputChanges | back to summary |
|---|---|
| private void setIgnoreInputChanges(boolean state) If IgnoreInputChanges is set to true, all changes to the user input are ignored. This is primary used to avoid self triggering while auto completing. | |
| setMaxWidth | back to summary |
|---|---|
| public final void setMaxWidth(double value) Sets the maxWidth of the popup. | |
| setMinWidth | back to summary |
|---|---|
| public final void setMinWidth(double value) Sets the minWidth of the popup. | |
| setOnAutoCompleted | back to summary |
|---|---|
| public final void setOnAutoCompleted(EventHandler<AutoCompletionBinding. Set a event handler which is invoked after an auto completion. | |
| setPrefWidth | back to summary |
|---|---|
| public final void setPrefWidth(double value) Sets the prefWidth of the popup. | |
| setUserInput | back to summary |
|---|---|
| public final void setUserInput(String userText) Set the current text the user has entered | |
| setVisibleRowCount | back to summary |
|---|---|
| public final void setVisibleRowCount(int value) Set the maximum number of rows to be visible in the popup when it is showing. | |
| showPopup | back to summary |
|---|---|
| protected void showPopup() Show the auto completion popup | |
| visibleRowCountProperty | back to summary |
|---|---|
| public final IntegerProperty visibleRowCountProperty() Return an property representing the maximum number of rows to be visible in the popup when it is showing.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final EventType | AUTO_COMPLETED
The event type that should be listened to by people interested in knowing when an auto completion has been performed. |
| private final TE |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public TE |
| AUTO_COMPLETED | back to summary |
|---|---|
| public static final EventType<AutoCompletionBinding. The event type that should be listened to by people interested in knowing when an auto completion has been performed. | |
| completion | back to summary |
|---|---|
| private final TE completion | |
| AutoCompletionEvent | back to summary |
|---|---|
| public AutoCompletionEvent(TE completion) Creates a new event that can subsequently be fired. | |
| getCompletion | back to summary |
|---|---|
| public TE getCompletion() Returns the chosen completion. | |
| Modifier and Type | Field and Description |
|---|---|
| private final long | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Void | call()
Implements abstract javafx. Invoked when the Task is executed, the call method must be overridden and implemented by subclasses. |
| public String | getUserText()
Implements org. Get the user text to which suggestions shall be found |
| delay | back to summary |
|---|---|
| private final long delay | |
| userText | back to summary |
|---|---|
| private final String userText | |
| FetchSuggestionsTask | back to summary |
|---|---|
| public FetchSuggestionsTask(String userText, long delay) | |
| call | back to summary |
|---|---|
| protected Void call() throws Exception Implements abstract javafx. Doc from javafx. Invoked when the Task is executed, the call method must be overridden and implemented by subclasses. The call method actually performs the background thread logic. Only the updateProgress, updateMessage, updateValue and updateTitle methods of Task may be called from code within this method. Any other interaction with the Task from the background thread will result in runtime exceptions. | |
| getUserText | back to summary |
|---|---|
| public String getUserText() Implements org. Doc from org. Get the user text to which suggestions shall be found
| |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: String containing the user textGet the user text to which suggestions shall be found |
| public boolean |
| getUserText | back to summary |
|---|---|
| public String getUserText() Get the user text to which suggestions shall be found | |
| isCancelled | back to summary |
|---|---|
| public boolean isCancelled() Is this request canceled?
| |