public abstract class FieldEditor<T>
extends javafx.scene.layout.Region
| Modifier and Type | Field and Description |
|---|---|
protected javafx.collections.ObservableList<java.util.function.Function<? super T,Status>> |
validationFunctions |
| Constructor and Description |
|---|
FieldEditor(java.lang.String name) |
FieldEditor(java.lang.String name,
java.lang.String label) |
| Modifier and Type | Method and Description |
|---|---|
protected javafx.beans.binding.ObjectExpression<Status> |
createStatusBinding()
Create the status binding for this field editor.
|
boolean |
displayLabel()
If true, the preference page will be responsible for displaying the label for
this field editor.
|
protected abstract void |
doLoad() |
protected abstract void |
doPersist() |
protected abstract void |
doRestoreDefaults() |
javafx.beans.binding.StringExpression |
errorMessage() |
java.lang.String |
getLabel() |
Memento |
getMemento() |
protected java.lang.String |
getName() |
abstract javafx.beans.value.ObservableValue<T> |
getValue()
Return the value of this field editor.
|
javafx.beans.property.StringProperty |
labelProperty() |
protected void |
layoutChildren()
By default, give all available width and height to the children.
|
void |
load() |
void |
persist() |
Subscription |
registerStatusValidator(java.util.function.Function<? super T,Status> validationFunction)
Add a validation function to this field editor.
|
Subscription |
registerValidator(java.util.function.Function<? super T,java.lang.String> validationFunction)
Add a validation function to this field editor.
|
void |
restoreDefaults() |
protected void |
setDefault(boolean isDefault) |
void |
setLabel(java.lang.String label) |
void |
setMemento(Memento memento) |
javafx.beans.binding.ObjectExpression<Status> |
statusProperty()
Return the observable
Status property for this editor's value. |
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getBackground, getBorder, getClassCssMetaData, getCssMetaData, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, 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, snapSize, snapSpace, snapToPixelProperty, widthPropertygetBaselineOffset, getChildren, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processCSS, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBoundsaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, 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, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_cssGetFocusTraversableInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, 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, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visiblePropertyprotected final javafx.collections.ObservableList<java.util.function.Function<? super T,Status>> validationFunctions
public FieldEditor(java.lang.String name,
java.lang.String label)
public FieldEditor(java.lang.String name)
protected javafx.beans.binding.ObjectExpression<Status> createStatusBinding()
Create the status binding for this field editor. The default is computed by applying the validation functions to the current value upon value change.
Subclasses should override this method if they need to update the status independently from a value change (Typically, if the new user input doesn't result in a valid new value, thus can't trigger a value change).
protected void layoutChildren()
By default, give all available width and height to the children. If more than one child is present in this field editor, subclasses should provide custom layout.
layoutChildren in class javafx.scene.Parentpublic void setMemento(Memento memento)
public Memento getMemento()
protected java.lang.String getName()
protected void setDefault(boolean isDefault)
public final void load()
public final void persist()
public final void restoreDefaults()
protected abstract void doLoad()
protected abstract void doPersist()
protected abstract void doRestoreDefaults()
public javafx.beans.binding.StringExpression errorMessage()
public final javafx.beans.property.StringProperty labelProperty()
public final java.lang.String getLabel()
public final void setLabel(java.lang.String label)
public abstract javafx.beans.value.ObservableValue<T> getValue()
Return the value of this field editor. This will be used to automatically
manage setDefault(boolean).
public boolean displayLabel()
If true, the preference page will be responsible for displaying the label for this field editor.
Subclasses that need to control how their label should be displayed should override this method and return false.
public javafx.beans.binding.ObjectExpression<Status> statusProperty()
Return the observable Status property for this editor's value.
public Subscription registerStatusValidator(java.util.function.Function<? super T,Status> validationFunction)
Add a validation function to this field editor. The validation function accepts a value and produces a Status.
validationFunction - A Function taking a value as a parameter, and returning a
StatusSubscription to unregister the validation functionpublic Subscription registerValidator(java.util.function.Function<? super T,java.lang.String> validationFunction)
Add a validation function to this field editor. The validation function
accepts a value and produces an error message as a String, or
null if the value is valid.
This is a simplified version of registerStatusValidator(Function):
a null or empty message corresponds to Status#ok(), whereas
a non-empty message corresponds to an Error status,
with a default error code an no exception.
validationFunction - A Function taking a value as a parameter, and returning a
String error message, or null if the value is
valid.Subscription to unregister the validation functionregisterStatusValidator(Function)