T.
This button integrates directly with a HistoryManager to present a list of previously used
items to the user. The user can then pick one of those items to set a value on an input field.
Usage scenarios include search fields, form inputs, or any other component where users might benefit
from being able to see and interact with their previous entries. The generic type T allows for
flexibility, making it suitable for various data types that can represent user input history.
| Modifier and Type | Class and Description |
|---|---|
| public class | HistoryButton.
The popup used by the |
| public class | HistoryButton.
The skin used for the |
| Modifier and Type | Field and Description |
|---|---|
| private ObjectProperty | |
| private static final String | |
| private static final PseudoClass | |
| private ObjectProperty | |
| private final ObjectProperty | |
| private final ObjectProperty | |
| private final ObjectProperty | |
| private final ObjectProperty | |
| private ObjectProperty | |
| private ObjectProperty | |
| private final ObjectProperty | |
| private HistoryButton | |
| private static final PseudoClass | |
| private final ReadOnlyBooleanWrapper |
| Access | Constructor and Description |
|---|---|
| public | |
| public | HistoryButton(Node
the owner of the button, used for focus management. owner)Creates a new instance of the history button where the button will be used in combination with the given node. |
| Modifier and Type | Method and Description |
|---|---|
| public final ObjectProperty | |
| public final Callback | |
| public final HistoryManager | |
| public final Node | |
| public final Node | |
| public final Node | |
| public final Node | |
| public final Consumer | |
| public final Node | |
| public final Node | |
| public void | |
| public final ObjectProperty | Returns: the property representing the history managerThe history manager that is used for persisting the history of the button. |
| public final boolean | |
| public final ObjectProperty | Returns: the node shown on the bottom of the list viewThe list used by the popup to show previously used items can be easily decorated by specifying nodes for its left, right, top, and / or bottom sides. |
| public final ObjectProperty | Returns: the node shown to the left of the list viewThe list used by the popup to show previously used items can be easily decorated by specifying nodes for its left, right, top, and / or bottom sides. |
| public final ObjectProperty | Returns: the node shown to the right of the list viewThe list used by the popup to show previously used items can be easily decorated by specifying nodes for its left, right, top, and / or bottom sides. |
| public final ObjectProperty | Returns: the node shown at the top of the list viewThe list used by the popup to show previously used items can be easily decorated by specifying nodes for its left, right, top, and / or bottom sides. |
| public final ObjectProperty | Returns: the property storing the "on history item confirmed" callback function.Returns the property representing the callback function to be executed when a history item within the list view is either clicked directly or selected via the ENTER key press. |
| public final ObjectProperty | Returns: the owning node, e.g. a text field.The (optional) "owner" of a history button can be a textfield where the button is shown inside the field. |
| public final ObjectProperty | Returns: the property representing the history placeholder nodeReturns the property representing the history placeholder node. |
| public final ReadOnlyBooleanProperty | Returns: true if the history popup is showing, false otherwiseIndicates whether the history popup is showing. |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public void | showPopup()
Shows the popup that includes the list view with the items stored by the history manager. |
| cellFactory | back to summary |
|---|---|
| private ObjectProperty<Callback<ListView<T>, ListCell<T>>> cellFactory | |
| DEFAULT_STYLE_CLASS | back to summary |
|---|---|
| private static final String DEFAULT_STYLE_CLASS | |
| DISABLED_POPUP_PSEUDO_CLASS | back to summary |
|---|---|
| private static final PseudoClass DISABLED_POPUP_PSEUDO_CLASS | |
| historyManager | back to summary |
|---|---|
| private ObjectProperty<HistoryManager<T>> historyManager | |
| listDecorationBottom | back to summary |
|---|---|
| private final ObjectProperty<Node> listDecorationBottom | |
| listDecorationLeft | back to summary |
|---|---|
| private final ObjectProperty<Node> listDecorationLeft | |
| listDecorationRight | back to summary |
|---|---|
| private final ObjectProperty<Node> listDecorationRight | |
| listDecorationTop | back to summary |
|---|---|
| private final ObjectProperty<Node> listDecorationTop | |
| onItemSelected | back to summary |
|---|---|
| private ObjectProperty<Consumer<T>> onItemSelected | |
| owner | back to summary |
|---|---|
| private ObjectProperty<Node> owner | |
| placeholder | back to summary |
|---|---|
| private final ObjectProperty<Node> placeholder | |
| popup | back to summary |
|---|---|
| private HistoryButton<T>. | |
| POPUP_SHOWING_PSEUDO_CLASS | back to summary |
|---|---|
| private static final PseudoClass POPUP_SHOWING_PSEUDO_CLASS | |
| popupShowing | back to summary |
|---|---|
| private final ReadOnlyBooleanWrapper popupShowing | |
| HistoryButton | back to summary |
|---|---|
| public HistoryButton() Creates a new instance of the history button. | |
| HistoryButton | back to summary |
|---|---|
| public HistoryButton(Node owner) Creates a new instance of the history button where the button will be used in combination with the given node.
| |
| cellFactoryProperty | back to summary |
|---|---|
| public final ObjectProperty The cell factory for the history popup list view.
| |
| getCellFactory | back to summary |
|---|---|
| public final Callback | |
| getHistoryManager | back to summary |
|---|---|
| public final HistoryManager | |
| getListDecorationBottom | back to summary |
|---|---|
| public final Node getListDecorationBottom() | |
| getListDecorationLeft | back to summary |
|---|---|
| public final Node getListDecorationLeft() | |
| getListDecorationRight | back to summary |
|---|---|
| public final Node getListDecorationRight() | |
| getListDecorationTop | back to summary |
|---|---|
| public final Node getListDecorationTop() | |
| getOnItemSelected | back to summary |
|---|---|
| public final Consumer | |
| getOwner | back to summary |
|---|---|
| public final Node getOwner() | |
| getPlaceholder | back to summary |
|---|---|
| public final Node getPlaceholder() | |
| hidePopup | back to summary |
|---|---|
| public void hidePopup() Hides the popup that is showing the history items. | |
| historyManagerProperty | back to summary |
|---|---|
| public final ObjectProperty The history manager that is used for persisting the history of the button. If its value is null, clicking the button will not display the history popup. If its value is not null, clicking the button will display a popup showing the items previously stored for this button.
| |
| isPopupShowing | back to summary |
|---|---|
| public final boolean isPopupShowing() | |
| listDecorationBottomProperty | back to summary |
|---|---|
| public final ObjectProperty The list used by the popup to show previously used items can be easily decorated by specifying nodes for its left, right, top, and / or bottom sides. This property stores an optional node for the bottom side.
| |
| listDecorationLeftProperty | back to summary |
|---|---|
| public final ObjectProperty The list used by the popup to show previously used items can be easily decorated by specifying nodes for its left, right, top, and / or bottom sides. This property stores an optional node for the left side.
| |
| listDecorationRightProperty | back to summary |
|---|---|
| public final ObjectProperty The list used by the popup to show previously used items can be easily decorated by specifying nodes for its left, right, top, and / or bottom sides. This property stores an optional node for the right side.
| |
| listDecorationTopProperty | back to summary |
|---|---|
| public final ObjectProperty The list used by the popup to show previously used items can be easily decorated by specifying nodes for its left, right, top, and / or bottom sides. This property stores an optional node for the top side.
| |
| onItemSelectedProperty | back to summary |
|---|---|
| public final ObjectProperty Returns the property representing the callback function to be executed when a history item within the list view is either clicked directly or selected via the ENTER key press. This property enables setting a custom callback function that will be invoked with the text of the clicked or selected history item as the argument.
| |
| ownerProperty | back to summary |
|---|---|
| public final ObjectProperty The (optional) "owner" of a history button can be a textfield where the button is shown inside the field.
| |
| placeholderProperty | back to summary |
|---|---|
| public final ObjectProperty Returns the property representing the history placeholder node.
| |
| popupShowingProperty | back to summary |
|---|---|
| public final ReadOnlyBooleanProperty popupShowingProperty() Indicates whether the history popup is showing. This is a read-only property.
| |
| setCellFactory | back to summary |
|---|---|
| public final void setCellFactory(Callback<ListView<T>, ListCell<T>> cellFactory) | |
| setHistoryManager | back to summary |
|---|---|
| public final void setHistoryManager(HistoryManager<T> historyManager) | |
| setListDecorationBottom | back to summary |
|---|---|
| public final void setListDecorationBottom(Node listDecorationBottom) | |
| setListDecorationLeft | back to summary |
|---|---|
| public final void setListDecorationLeft(Node listDecorationLeft) | |
| setListDecorationRight | back to summary |
|---|---|
| public final void setListDecorationRight(Node listDecorationRight) | |
| setListDecorationTop | back to summary |
|---|---|
| public final void setListDecorationTop(Node listDecorationTop) | |
| setOnItemSelected | back to summary |
|---|---|
| public final void setOnItemSelected(Consumer<T> onItemSelected) | |
| setOwner | back to summary |
|---|---|
| public final void setOwner(Node owner) | |
| setPlaceholder | back to summary |
|---|---|
| public final void setPlaceholder(Node placeholder) | |
| showPopup | back to summary |
|---|---|
| public void showPopup() Shows the popup that includes the list view with the items stored by the history manager. | |
HistoryButton to display a list view with the previously used
items.
| Modifier and Type | Field and Description |
|---|---|
| public static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Skin | createDefaultSkin()
Overrides javafx. Create a new instance of the default skin for this control. |
| DEFAULT_STYLE_CLASS | back to summary |
|---|---|
| public static final String DEFAULT_STYLE_CLASS | |
| HistoryPopup | back to summary |
|---|---|
| public HistoryPopup() | |
| createDefaultSkin | back to summary |
|---|---|
| protected Skin Overrides javafx. Doc from javafx. Create a new instance of the default skin for this control. This is called to create a skin for the control if
no skin is provided via CSS
| |
HistoryPopup.
| Modifier and Type | Field and Description |
|---|---|
| private final HistoryButton | |
| private final BorderPane |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private ListView | |
| public void | dispose()
Implements javafx. Called when a previously installed skin is about to be removed from its associated control. |
| public Node | |
| public HistoryButton | getSkinnable()
Implements javafx. Gets the Skinnable to which this Skin is assigned. |
| private void |
| popup | back to summary |
|---|---|
| private final HistoryButton<T>. | |
| root | back to summary |
|---|---|
| private final BorderPane root | |
| HistoryPopupSkin | back to summary |
|---|---|
| public HistoryPopupSkin(HistoryButton<T>. | |
| createListView | back to summary |
|---|---|
| private ListView | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements javafx. Doc from javafx. Called when a previously installed skin is about to be removed from its associated control.
This allows the skin to do clean up, like removing listeners and bindings, and undo any changes
to the control's properties.
After this method completes,
Calling
| |
| getNode | back to summary |
|---|---|
| public Node getNode() Implements javafx. Doc from javafx. Gets the Node which represents this Skin. This must never be null, except
after a call to
| |
| getSkinnable | back to summary |
|---|---|
| public HistoryButton Implements javafx. Doc from javafx. Gets the Skinnable to which this Skin is assigned. A Skin must be created
for one and only one Skinnable. This value will only ever go from a
non-null to null value when the Skin is removed from the Skinnable, and
only as a consequence of a call to The caller who constructs a Skinnable must also construct a Skin and properly establish the relationship between the Control and its Skin.
| |
| handleItemSelection | back to summary |
|---|---|
| private void handleItemSelection(ListView<T> listView) | |