T - Model-Type of the suggestionspublic abstract class AutoCompletionBinding<T>
extends java.lang.Object
implements javafx.event.EventTarget
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| Type | Property and Description |
|---|---|
javafx.beans.property.DoubleProperty |
maxWidth
Return the property associated with the max width.
|
javafx.beans.property.DoubleProperty |
minWidth
Return the property associated with the min width.
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<AutoCompletionBinding.AutoCompletionEvent<T>>> |
onAutoCompleted |
javafx.beans.property.DoubleProperty |
prefWidth
Return the property associated with the pref width.
|
javafx.beans.property.IntegerProperty |
visibleRowCount
Return an property representing the maximum number of rows to be visible
in the popup when it is showing.
|
| Modifier and Type | Class and Description |
|---|---|
static class |
AutoCompletionBinding.AutoCompletionEvent<TE>
Represents an Event which is fired after an auto completion.
|
static interface |
AutoCompletionBinding.ISuggestionRequest
Represents a suggestion fetch request
|
| Modifier | Constructor and Description |
|---|---|
protected |
AutoCompletionBinding(javafx.scene.Node completionTarget,
javafx.util.Callback<AutoCompletionBinding.ISuggestionRequest,java.util.Collection<T>> suggestionProvider,
javafx.util.StringConverter<T> converter)
Creates a new AutoCompletionBinding
|
| Modifier and Type | Method and Description |
|---|---|
<E extends javafx.event.Event> |
addEventHandler(javafx.event.EventType<E> eventType,
javafx.event.EventHandler<E> eventHandler)
Registers an event handler to this EventTarget.
|
javafx.event.EventDispatchChain |
buildEventDispatchChain(javafx.event.EventDispatchChain tail) |
protected abstract void |
completeUserInput(T completion)
Complete the current user-input with the provided completion.
|
abstract void |
dispose()
Disposes the binding.
|
protected void |
fireAutoCompletion(T completion) |
impl.org.controlsfx.skin.AutoCompletePopup<T> |
getAutoCompletionPopup()
Get the
AutoCompletePopup used by this binding. |
javafx.scene.Node |
getCompletionTarget()
Gets the target node for auto completion
|
double |
getMaxWidth()
Return the max width of the popup.
|
double |
getMinWidth()
Return the min width of the popup.
|
javafx.event.EventHandler<AutoCompletionBinding.AutoCompletionEvent<T>> |
getOnAutoCompleted()
Gets the value of the property onAutoCompleted.
|
double |
getPrefWidth()
Return the pref width of the popup.
|
int |
getVisibleRowCount()
Return the maximum number of rows to be visible in the popup when it is
showing.
|
protected void |
hidePopup()
Hide the auto completion targets
|
javafx.beans.property.DoubleProperty |
maxWidthProperty()
Return the property associated with the max width.
|
javafx.beans.property.DoubleProperty |
minWidthProperty()
Return the property associated with the min width.
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<AutoCompletionBinding.AutoCompletionEvent<T>>> |
onAutoCompletedProperty() |
javafx.beans.property.DoubleProperty |
prefWidthProperty()
Return the property associated with the pref width.
|
<E extends javafx.event.Event> |
removeEventHandler(javafx.event.EventType<E> eventType,
javafx.event.EventHandler<E> eventHandler)
Unregisters a previously registered event handler from this EventTarget.
|
void |
setDelay(long delay)
Sets the delay in ms between a key press and the suggestion popup being displayed.
|
void |
setHideOnEscape(boolean value)
Specifies whether the PopupWindow should be hidden when an unhandled
escape key is pressed while the popup has focus.
|
void |
setMaxWidth(double value)
Sets the maxWidth of the popup.
|
void |
setMinWidth(double value)
Sets the minWidth of the popup.
|
void |
setOnAutoCompleted(javafx.event.EventHandler<AutoCompletionBinding.AutoCompletionEvent<T>> value)
Set a event handler which is invoked after an auto completion.
|
void |
setPrefWidth(double value)
Sets the prefWidth of the popup.
|
void |
setUserInput(java.lang.String userText)
Set the current text the user has entered
|
void |
setVisibleRowCount(int value)
Set the maximum number of rows to be visible in the popup when it is
showing.
|
protected void |
showPopup()
Show the auto completion popup
|
javafx.beans.property.IntegerProperty |
visibleRowCountProperty()
Return an property representing the maximum number of rows to be visible
in the popup when it is showing.
|
public final javafx.beans.property.IntegerProperty visibleRowCountProperty
getVisibleRowCount(),
setVisibleRowCount(int)public final javafx.beans.property.DoubleProperty prefWidthProperty
getPrefWidth(),
setPrefWidth(double)public final javafx.beans.property.DoubleProperty minWidthProperty
getMinWidth(),
setMinWidth(double)public final javafx.beans.property.DoubleProperty maxWidthProperty
getMaxWidth(),
setMaxWidth(double)public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<AutoCompletionBinding.AutoCompletionEvent<T>>> onAutoCompletedProperty
protected AutoCompletionBinding(javafx.scene.Node completionTarget,
javafx.util.Callback<AutoCompletionBinding.ISuggestionRequest,java.util.Collection<T>> suggestionProvider,
javafx.util.StringConverter<T> converter)
completionTarget - The target node to which auto-completion shall be addedsuggestionProvider - The strategy to retrieve suggestionsconverter - The converter to be used to convert suggestions to stringspublic void setHideOnEscape(boolean value)
value - public final void setUserInput(java.lang.String userText)
userText - public final void setDelay(long delay)
delay - public javafx.scene.Node getCompletionTarget()
public abstract void dispose()
public final void setVisibleRowCount(int value)
value - public final int getVisibleRowCount()
public final javafx.beans.property.IntegerProperty visibleRowCountProperty()
getVisibleRowCount(),
setVisibleRowCount(int)public final void setPrefWidth(double value)
value - public final double getPrefWidth()
public final javafx.beans.property.DoubleProperty prefWidthProperty()
getPrefWidth(),
setPrefWidth(double)public final void setMinWidth(double value)
value - public final double getMinWidth()
public final javafx.beans.property.DoubleProperty minWidthProperty()
getMinWidth(),
setMinWidth(double)public final void setMaxWidth(double value)
value - public final double getMaxWidth()
public final javafx.beans.property.DoubleProperty maxWidthProperty()
getMaxWidth(),
setMaxWidth(double)public impl.org.controlsfx.skin.AutoCompletePopup<T> getAutoCompletionPopup()
AutoCompletePopup used by this binding. Note that this gives access to the
internal API and should be used with great care (and in the expectation that things may break in
the future). All relevant methods of the popup are already exposed in this class.
The only reason this is exposed is to allow custom skins for the popup.AutoCompletePopup used by this bindingprotected abstract void completeUserInput(T completion)
completion - protected void showPopup()
protected void hidePopup()
protected void fireAutoCompletion(T completion)
public final void setOnAutoCompleted(javafx.event.EventHandler<AutoCompletionBinding.AutoCompletionEvent<T>> value)
value - public final javafx.event.EventHandler<AutoCompletionBinding.AutoCompletionEvent<T>> getOnAutoCompleted()
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<AutoCompletionBinding.AutoCompletionEvent<T>>> onAutoCompletedProperty()
public <E extends javafx.event.Event> void addEventHandler(javafx.event.EventType<E> eventType,
javafx.event.EventHandler<E> eventHandler)
Event of the specified type during the bubbling
phase of event delivery.E - the specific event class of the handlereventType - the type of the events to receive by the handlereventHandler - the handler to registerjava.lang.NullPointerException - if the event type or handler is nullpublic <E extends javafx.event.Event> void removeEventHandler(javafx.event.EventType<E> eventType,
javafx.event.EventHandler<E> eventHandler)
E - the specific event class of the handlereventType - the event type from which to unregistereventHandler - the handler to unregisterjava.lang.NullPointerException - if the event type or handler is nullpublic javafx.event.EventDispatchChain buildEventDispatchChain(javafx.event.EventDispatchChain tail)
buildEventDispatchChain in interface javafx.event.EventTarget