java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.layout.Pane
javafx.scene.layout.HBox
qupath.fx.controls.PredicateTextField<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
javafx.css.Styleable
,javafx.event.EventTarget
public class PredicateTextField<T>
extends javafx.scene.layout.HBox
A text field control for creating a text-based predicate.
The main purpose is to allow filtering of a list of objects based on user-defined text, optionally using regular expressions.
-
Property Summary
TypePropertyDescriptionjavafx.beans.property.BooleanProperty
Property determining whether the filter should ignore case or not.Read only property representing the predicate.javafx.beans.property.StringProperty
Get the prompt text to show in the text field.javafx.beans.property.BooleanProperty
Property determining whether the a button enabling the use of regular expressions should be shown or not.Get the string function property sed to create a string representation of the object.javafx.beans.property.StringProperty
Get the filter text property.javafx.beans.property.BooleanProperty
Property determining whether the filter should use regular expressions or not.Properties inherited from class javafx.scene.layout.HBox
alignment, fillHeight, spacing
Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
Properties inherited from class javafx.scene.Parent
needsLayout
Properties 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, visible
-
Field Summary
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Constructor Summary
ConstructorDescriptionConstructor to create a new predicate text field using the defaultObjects.toString(Object)
method to create a string representation of the object.PredicateTextField
(Function<T, String> stringFunction) Constructor to create a new predicate text field with a custom string function. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Get whether the filter should ignore case or not.Get the predicate.Get the prompt text to show when the text field is empty.Get the string function used to create a string representation of the object.getText()
Get the filter text.boolean
Get whether the filter should use regular expressions or not.javafx.beans.property.BooleanProperty
Property determining whether the filter should ignore case or not.Read only property representing the predicate.javafx.beans.property.StringProperty
Get the prompt text to show in the text field.void
setIgnoreCase
(boolean ignoreCase) Set whether the filter should ignore case or not.void
setPromptText
(String text) Set the prompt text to show when the text field is empty.boolean
Get whether a button should be shown that enables the user to toggle the use of * regular expressions.void
setShowRegexButton
(boolean show) Set whether a button should be shown that enables the user to toggle the use of regular expressions.void
setStringFunction
(Function<T, String> stringFunction) Set the string function used to create a string representation of the object.void
Set the filter text.void
setUseRegex
(boolean use) Set whether the filter should use regular expressions or not.javafx.beans.property.BooleanProperty
Property determining whether the a button enabling the use of regular expressions should be shown or not.Get the string function property sed to create a string representation of the object.javafx.beans.property.StringProperty
Get the filter text property.javafx.beans.property.BooleanProperty
Property determining whether the filter should use regular expressions or not.Methods inherited from class javafx.scene.layout.HBox
alignmentProperty, clearConstraints, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, fillHeightProperty, getAlignment, getBaselineOffset, getClassCssMetaData, getContentBias, getCssMetaData, getHgrow, getMargin, getSpacing, isFillHeight, layoutChildren, requestLayout, setAlignment, setFillHeight, setHgrow, setMargin, setSpacing, spacingProperty
Methods inherited from class javafx.scene.layout.Pane
getChildren
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, 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, widthProperty
Methods inherited from class javafx.scene.Parent
getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestParentLayout, setNeedsLayout, updateBounds
Methods 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, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, 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, visibleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
text
public javafx.beans.property.StringProperty textPropertyGet the filter text property.- See Also:
-
promptText
public javafx.beans.property.StringProperty promptTextPropertyGet the prompt text to show in the text field.- See Also:
-
useRegex
public javafx.beans.property.BooleanProperty useRegexPropertyProperty determining whether the filter should use regular expressions or not. If not, then a simple 'contains' test is performed using the filter text.- See Also:
-
showRegexButton
public javafx.beans.property.BooleanProperty showRegexButtonPropertyProperty determining whether the a button enabling the use of regular expressions should be shown or not. The display of the button can be controlled independently of whether regular expressions are actually used.- See Also:
-
ignoreCase
public javafx.beans.property.BooleanProperty ignoreCasePropertyProperty determining whether the filter should ignore case or not. This is only relevant when not using regular expressions.- See Also:
-
predicate
Read only property representing the predicate.- See Also:
-
stringFunction
Get the string function property sed to create a string representation of the object.
-
-
Constructor Details
-
PredicateTextField
public PredicateTextField()Constructor to create a new predicate text field using the defaultObjects.toString(Object)
method to create a string representation of the object. -
PredicateTextField
Constructor to create a new predicate text field with a custom string function.- Parameters:
stringFunction
-
-
-
Method Details
-
textProperty
public javafx.beans.property.StringProperty textProperty()Get the filter text property.- See Also:
-
getText
Get the filter text.- Returns:
-
setText
Set the filter text.- Parameters:
text
-
-
promptTextProperty
public javafx.beans.property.StringProperty promptTextProperty()Get the prompt text to show in the text field.- See Also:
-
getPromptText
Get the prompt text to show when the text field is empty.- Returns:
-
setPromptText
Set the prompt text to show when the text field is empty.- Parameters:
text
-
-
useRegexProperty
public javafx.beans.property.BooleanProperty useRegexProperty()Property determining whether the filter should use regular expressions or not. If not, then a simple 'contains' test is performed using the filter text.- See Also:
-
setUseRegex
public void setUseRegex(boolean use) Set whether the filter should use regular expressions or not.- Parameters:
use
-
-
getUseRegex
public boolean getUseRegex()Get whether the filter should use regular expressions or not. The default is false.- Returns:
-
showRegexButtonProperty
public javafx.beans.property.BooleanProperty showRegexButtonProperty()Property determining whether the a button enabling the use of regular expressions should be shown or not. The display of the button can be controlled independently of whether regular expressions are actually used.- See Also:
-
setShowRegexButton
public void setShowRegexButton(boolean show) Set whether a button should be shown that enables the user to toggle the use of regular expressions.- Parameters:
show
-
-
setShowRegexButton
public boolean setShowRegexButton()Get whether a button should be shown that enables the user to toggle the use of * regular expressions.- Returns:
-
ignoreCaseProperty
public javafx.beans.property.BooleanProperty ignoreCaseProperty()Property determining whether the filter should ignore case or not. This is only relevant when not using regular expressions.- See Also:
-
setIgnoreCase
public void setIgnoreCase(boolean ignoreCase) Set whether the filter should ignore case or not. This is only relevant when not using regular expressions.- Parameters:
ignoreCase
-
-
getIgnoreCase
public boolean getIgnoreCase()Get whether the filter should ignore case or not. This is only relevant when not using regular expressions. The default is true.- Returns:
-
predicateProperty
Read only property representing the predicate.- See Also:
-
getPredicate
Get the predicate.- Returns:
-
stringFunctionProperty
Get the string function property sed to create a string representation of the object. -
getStringFunction
Get the string function used to create a string representation of the object.- Returns:
-
setStringFunction
Set the string function used to create a string representation of the object.- Parameters:
stringFunction
-
-