java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
javafx.scene.control.TextInputControl
javafx.scene.control.TextField
io.github.palexdev.materialfx.controls.MFXTextField
io.github.palexdev.materialfx.controls.MFXComboBox<T>
io.github.palexdev.materialfx.controls.MFXFilterComboBox<T>
- All Implemented Interfaces:
MFXCombo<T>,MFXMenuControl,Validated,Styleable,EventTarget,Skinnable
Extends
MFXComboBox and changes the popup's content slightly to
allow filtering the items list.
In addition to the base class futures this adds:
- Uses a TransformableListWrapper to filter the items. You could even sort them by
retrieving the list instance and setting a comparator, TransformableList.comparatorProperty().
Beware to this though, TransformableList.setReversed(boolean), it's really important to specify that
the comparator is in reverse order otherwise indexes will be inconsistent.
- A function that takes the typed search text as an input and builds a Predicate as a result to
filter the list. This means that the user can fully customize how the list is filtered.
MFXComboBoxCell and while it does allow it it should never be used.
Use MFXFilterComboBoxCell instead for consistent selection behavior.-
Property Summary
PropertiesTypePropertyDescriptionSpecifies the function used to build aPredicatefrom the typed search text, the predicate is then used to filter the list.Specifies the text used to filter the items list.Properties inherited from class io.github.palexdev.materialfx.controls.MFXComboBox
animationProvider, cellFactory, converter, items, onCancel, onCommit, onHidden, onHiding, onShowing, onShown, popupAlignment, popupOffsetX, popupOffsetY, scrollOnOpen, selectedIndex, selectedItem, showing, valueProperties inherited from class io.github.palexdev.materialfx.controls.MFXTextField
allowEdit, animated, borderGap, caretVisible, delegateAnchor, delegateCaretPosition, delegateFocused, delegateRedoable, delegateSelectedText, delegateSelection, delegateTextFormatter, delegateUndoable, floating, floatingTextGap, floatingText, floatMode, graphicTextGap, leadingIcon, measureUnitGap, measureUnit, scaleOnAbove, selectable, textFill, textLimit, trailingIconProperties inherited from class javafx.scene.control.TextField
alignment, onAction, prefColumnCountProperties inherited from class javafx.scene.control.TextInputControl
anchor, caretPosition, editable, font, length, promptText, redoable, selectedText, selection, textFormatter, text, undoableProperties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltipProperties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.Parent
needsLayoutProperties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visibleProperties inherited from interface io.github.palexdev.materialfx.controls.base.MFXCombo
editable, onAction, promptText -
Nested Class Summary
Nested classes/interfaces inherited from class javafx.scene.control.TextInputControl
TextInputControl.Content -
Field Summary
Fields inherited from class io.github.palexdev.materialfx.controls.MFXComboBox
ON_HIDDEN, ON_HIDING, ON_SHOWING, ON_SHOWN, POPUP_OPEN_PSEUDO_CLASSFields inherited from class io.github.palexdev.materialfx.controls.MFXTextField
boundField, contextMenu, DEFAULT_TEXT_COLOR, floating, validatorFields inherited from class javafx.scene.control.TextField
DEFAULT_PREF_COLUMN_COUNTFields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZEFields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHTFields inherited from interface io.github.palexdev.materialfx.validation.Validated
INVALID_PSEUDO_CLASS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Skin<?>Specifies the function used to build aPredicatefrom the typed search text, the predicate is then used to filter the list.Gets the value of the property filterFunction.Gets the value of the property searchText.booleanSpecifies the text used to filter the items list.voidsetFilterFunction(Function<String, Predicate<T>> filterFunction) Sets the value of the property filterFunction.voidsetResetOnPopupHidden(boolean resetOnPopupHidden) Sets whether to reset the filter state, such as thesearchTextProperty()when the popup is closedvoidsetSearchText(String searchText) Sets the value of the property searchText.Methods inherited from class io.github.palexdev.materialfx.controls.MFXComboBox
animationProviderProperty, cancel, cellFactoryProperty, clearSelection, commit, converterProperty, defaultContextMenu, getAnimationProvider, getCellFactory, getClassCssMetaData, getControlCssMetaData, getConverter, getItems, getOnCancel, getOnCommit, getOnHidden, getOnHiding, getOnShowing, getOnShown, getPopupAlignment, getPopupOffsetX, getPopupOffsetY, getSelectedIndex, getSelectedItem, getSelectionModel, getValidator, getValue, hide, isScrollOnOpen, isShowing, itemsChanged, itemsProperty, onCancelProperty, onCommitProperty, onHiddenProperty, onHidingProperty, onShowingProperty, onShownProperty, popupAlignmentProperty, popupOffsetXProperty, popupOffsetYProperty, scrollOnOpenProperty, selectedIndexProperty, selectedItemProperty, selectFirst, selectIndex, selectItem, selectLast, selectNext, selectPrevious, setAnimationProvider, setCellFactory, setConverter, setItems, setOnCancel, setOnCommit, setOnHidden, setOnHiding, setOnShowing, setOnShown, setPopupAlignment, setPopupOffsetX, setPopupOffsetY, setScrollOnOpen, setValue, show, showingProperty, valuePropertyMethods inherited from class io.github.palexdev.materialfx.controls.MFXTextField
allowEditProperty, animatedProperty, asLabel, asLabel, asLabel, asLabel, backward, borderGapProperty, caretVisibleProperty, clear, copy, cut, delegateAnchorProperty, delegateCaretPositionProperty, delegateFocusedProperty, delegateGetAnchor, delegateGetCaretPosition, delegateGetSelectedText, delegateGetSelection, delegateGetTextFormatter, delegateIsFocused, delegateIsRedoable, delegateIsUndoable, delegateRedoableProperty, delegateSelectedTextProperty, delegateSelectionProperty, delegateSetTextFormatter, delegateTextFormatterProperty, delegateUndoableProperty, deselect, end, endOfNextWord, extendSelection, floatingProperty, floatingTextGapProperty, floatingTextProperty, floatModeProperty, forward, getBorderGap, getCaretVisible, getFloatingText, getFloatingTextGap, getFloatMode, getGraphicTextGap, getLeadingIcon, getMeasureUnit, getMeasureUnitGap, getMFXContextMenu, getTextFill, getTextLimit, getTrailingIcon, graphicTextGapProperty, home, isAllowEdit, isAnimated, isFloating, isSelectable, leadingIconProperty, measureUnitGapProperty, measureUnitProperty, nextWord, paste, positionCaret, previousWord, replaceSelection, scaleOnAbove, scaleOnAboveProperty, selectableProperty, selectAll, selectBackward, selectEnd, selectEndOfNextWord, selectForward, selectHome, selectNextWord, selectPositionCaret, selectPreviousWord, selectRange, setAllowEdit, setAnimated, setBorderGap, setCaretVisible, setFloatingText, setFloatingTextGap, setFloatMode, setGraphicTextGap, setLeadingIcon, setMeasureUnit, setMeasureUnitGap, setScaleOnAbove, setSelectable, setTextFill, setTextLimit, setTrailingIcon, textFillProperty, textLimitProperty, trailingIconPropertyMethods inherited from class javafx.scene.control.TextField
alignmentProperty, getAlignment, getCharacters, getOnAction, getPrefColumnCount, onActionProperty, prefColumnCountProperty, setAlignment, setOnAction, setPrefColumnCountMethods inherited from class javafx.scene.control.TextInputControl
anchorProperty, appendText, cancelEdit, caretPositionProperty, commitValue, deleteNextChar, deletePreviousChar, deleteText, deleteText, editableProperty, executeAccessibleAction, fontProperty, getAnchor, getCaretPosition, getContent, getFont, getLength, getPromptText, getSelectedText, getSelection, getText, getText, getTextFormatter, insertText, isEditable, isRedoable, isUndoable, lengthProperty, promptTextProperty, queryAccessibleAttribute, redo, redoableProperty, replaceText, replaceText, selectedTextProperty, selectionProperty, setEditable, setFont, setPromptText, setText, setTextFormatter, textFormatterProperty, textProperty, undo, undoablePropertyMethods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, setContextMenu, setSkin, setTooltip, skinProperty, tooltipPropertyMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.palexdev.materialfx.controls.base.MFXCombo
editableProperty, getOnAction, getPromptText, isEditable, onActionProperty, promptTextProperty, setEditable, setOnAction, setPromptTextMethods inherited from interface io.github.palexdev.materialfx.controls.base.MFXMenuControl
isContextMenuDisabled, setContextMenuDisabledMethods inherited from interface javafx.css.Styleable
getStyleableNodeMethods inherited from interface io.github.palexdev.materialfx.validation.Validated
isValid, updateInvalid, validate
-
Property Details
-
searchText
Specifies the text used to filter the items list. By default this text is bound bidirectionally with the text-field's used in the popup- See Also:
-
filterFunction
Specifies the function used to build aPredicatefrom the typed search text, the predicate is then used to filter the list.
-
-
Constructor Details
-
MFXFilterComboBox
public MFXFilterComboBox() -
MFXFilterComboBox
-
-
Method Details
-
getSearchText
Gets the value of the property searchText.- Property description:
- Specifies the text used to filter the items list. By default this text is bound bidirectionally with the text-field's used in the popup
-
searchTextProperty
Specifies the text used to filter the items list. By default this text is bound bidirectionally with the text-field's used in the popup- See Also:
-
setSearchText
Sets the value of the property searchText.- Property description:
- Specifies the text used to filter the items list. By default this text is bound bidirectionally with the text-field's used in the popup
-
getFilterList
-
getFilterFunction
Gets the value of the property filterFunction.- Property description:
- Specifies the function used to build a
Predicatefrom the typed search text, the predicate is then used to filter the list.
-
filterFunctionProperty
Specifies the function used to build aPredicatefrom the typed search text, the predicate is then used to filter the list. -
setFilterFunction
Sets the value of the property filterFunction.- Property description:
- Specifies the function used to build a
Predicatefrom the typed search text, the predicate is then used to filter the list.
-
isResetOnPopupHidden
public boolean isResetOnPopupHidden()- Returns:
- whether to reset the filter state, such as the
searchTextProperty()when the popup is closed
-
setResetOnPopupHidden
public void setResetOnPopupHidden(boolean resetOnPopupHidden) Sets whether to reset the filter state, such as thesearchTextProperty()when the popup is closed -
createDefaultSkin
- Overrides:
createDefaultSkinin classMFXComboBox<T>
-
getUserAgentStylesheet
- Overrides:
getUserAgentStylesheetin classMFXComboBox<T>
-