Class LoadingPane

java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.layout.Pane
javafx.scene.layout.StackPane
com.dlsc.gemsfx.LoadingPane
All Implemented Interfaces:
javafx.css.Styleable, javafx.event.EventTarget

@DefaultProperty("content") public class LoadingPane extends javafx.scene.layout.StackPane
A custom pane that supports the visual feedback for data loading / refreshing its content. The pane is a wrapper around a given content node. This node will be hidden and a progress indicator shown instead when the status of this pane changes to LoadingPane.Status.LOADING. Once the status changes back to LoadingPane.Status.OK the node will be shown again. If anything goes wrong while loading new data or refreshing the content a third state called LoadingPane.Status.ERROR can be applied resulting in an error icon and error text being shown. The pane also supports a progressProperty() for detailed progress feedback.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The possible sizes for the pane.
    static enum 
    The possible states that the loading pane can be in.
  • Property Summary

    Properties
    Type
    Property
    Description
    final javafx.beans.property.LongProperty
    The commit delay duration that will be applied before the control does change to a new state.
    final javafx.beans.property.ReadOnlyObjectProperty<LoadingPane.Status>
    A read-only property that contains the "committed" status value.
    final javafx.beans.property.ObjectProperty<javafx.scene.Node>
    The wrapped content node.
    final javafx.beans.property.ObjectProperty<javafx.scene.Node>
    The node that will be shown when the loading pane is in status LoadingPane.Status.ERROR.
    final javafx.beans.property.StringProperty
    The error text that will be shown if the pane is in status LoadingPane.Status.ERROR.
    final javafx.beans.property.ObjectProperty<javafx.scene.control.ProgressIndicator>
    The progress indicator that will be used to display percentage progress or the indeterminate state of the loading progress.
    final javafx.beans.property.DoubleProperty
    The progress (value between 0 and 1).
    final javafx.beans.property.ObjectProperty<LoadingPane.Size>
    The size of the progress indicator.
    final javafx.beans.property.ObjectProperty<LoadingPane.Status>
    The current status of the loading pane.

    Properties inherited from class javafx.scene.layout.StackPane

    alignment

    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, focusVisible, focusWithin, 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

    Constructors
    Constructor
    Description
    Constructs a new loading pane.
    LoadingPane(javafx.scene.Node node)
    Constructs a new loading pane.
  • Method Summary

    Modifier and Type
    Method
    Description
    final javafx.beans.property.LongProperty
    The commit delay duration that will be applied before the control does change to a new state.
    final javafx.beans.property.ReadOnlyObjectProperty<LoadingPane.Status>
    A read-only property that contains the "committed" status value.
    final javafx.beans.property.ObjectProperty<javafx.scene.Node>
    The wrapped content node.
    final void
    Convenience method to change the status of the pane to LoadingPane.Status.ERROR.
    final void
    error(String message)
    Convenience method to change the status of the pane to LoadingPane.Status.ERROR.
    final void
    Convenience method to change the status of the pane to LoadingPane.Status.ERROR.
    final javafx.beans.property.ObjectProperty<javafx.scene.Node>
    The node that will be shown when the loading pane is in status LoadingPane.Status.ERROR.
    final javafx.beans.property.StringProperty
    The error text that will be shown if the pane is in status LoadingPane.Status.ERROR.
    static List<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>>
     
    final long
    Gets the value of the commitDelay property.
    Gets the value of the committedStatus property.
    final javafx.scene.Node
    Gets the value of the content property.
    List<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>>
     
    final String
    Gets the value of the error property.
    final javafx.scene.Node
    Gets the value of the errorNode property.
    final double
    Gets the value of the progress property.
    final javafx.scene.control.ProgressIndicator
    Gets the value of the progressIndicator property.
    Gets the value of the size property.
    Gets the value of the status property.
     
    final void
    Convenience method to change the status of the pane to LoadingPane.Status.LOADING.
    final void
    ok()
    Convenience method to change the status of the pane to LoadingPane.Status.OK.
    final javafx.beans.property.ObjectProperty<javafx.scene.control.ProgressIndicator>
    The progress indicator that will be used to display percentage progress or the indeterminate state of the loading progress.
    final javafx.beans.property.DoubleProperty
    The progress (value between 0 and 1).
    final void
    setCommitDelay(long commitDelay)
    Sets the value of the commitDelay property.
    final void
    setContent(javafx.scene.Node content)
    Sets the value of the content property.
    final void
    Sets the value of the error property.
    final void
    setErrorNode(javafx.scene.Node errorNode)
    Sets the value of the errorNode property.
    final void
    setProgress(double progress)
    Sets the value of the progress property.
    final void
    setProgressIndicator(javafx.scene.control.ProgressIndicator progressIndicator)
    Sets the value of the progressIndicator property.
    final void
    Sets the value of the size property.
    final void
    Sets the value of the status property.
    final javafx.beans.property.ObjectProperty<LoadingPane.Size>
    The size of the progress indicator.
    final javafx.beans.property.ObjectProperty<LoadingPane.Status>
    The current status of the loading pane.

    Methods inherited from class javafx.scene.layout.StackPane

    alignmentProperty, clearConstraints, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getAlignment, getAlignment, getContentBias, getMargin, layoutChildren, requestLayout, setAlignment, setAlignment, setMargin

    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, 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

    getBaselineOffset, 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, focusVisibleProperty, focusWithinProperty, 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, isFocusVisible, isFocusWithin, 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, requestFocusTraversal, 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 Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface javafx.css.Styleable

    getStyleableNode
  • Property Details

  • Constructor Details

    • LoadingPane

      public LoadingPane()
      Constructs a new loading pane.
    • LoadingPane

      public LoadingPane(javafx.scene.Node node)
      Constructs a new loading pane.
      Parameters:
      node - the wrapped node
  • Method Details

    • getUserAgentStylesheet

      public String getUserAgentStylesheet()
      Overrides:
      getUserAgentStylesheet in class javafx.scene.layout.Region
    • getCommittedStatus

      public final LoadingPane.Status getCommittedStatus()
      Gets the value of the committedStatus property.
      Property description:
      A read-only property that contains the "committed" status value. Applications request a status property change via the statusProperty() which will be delayed via the commitDelayProperty(). Once the delay has passed the control will updated this property.
      Returns:
      the value of the committedStatus property
      See Also:
    • committedStatusProperty

      public final javafx.beans.property.ReadOnlyObjectProperty<LoadingPane.Status> committedStatusProperty()
      A read-only property that contains the "committed" status value. Applications request a status property change via the statusProperty() which will be delayed via the commitDelayProperty(). Once the delay has passed the control will updated this property.
      Returns:
      the read-only property storing the committed status
      See Also:
    • getErrorNode

      public final javafx.scene.Node getErrorNode()
      Gets the value of the errorNode property.
      Property description:
      The node that will be shown when the loading pane is in status LoadingPane.Status.ERROR. The default node for this is a simple label which binds to the errorProperty().
      Returns:
      the value of the errorNode property
      See Also:
    • errorNodeProperty

      public final javafx.beans.property.ObjectProperty<javafx.scene.Node> errorNodeProperty()
      The node that will be shown when the loading pane is in status LoadingPane.Status.ERROR. The default node for this is a simple label which binds to the errorProperty().
      Returns:
      the error node
      See Also:
    • setErrorNode

      public final void setErrorNode(javafx.scene.Node errorNode)
      Sets the value of the errorNode property.
      Property description:
      The node that will be shown when the loading pane is in status LoadingPane.Status.ERROR. The default node for this is a simple label which binds to the errorProperty().
      Parameters:
      errorNode - the value for the errorNode property
      See Also:
    • getProgressIndicator

      public final javafx.scene.control.ProgressIndicator getProgressIndicator()
      Gets the value of the progressIndicator property.
      Property description:
      The progress indicator that will be used to display percentage progress or the indeterminate state of the loading progress.
      Returns:
      the value of the progressIndicator property
      See Also:
    • progressIndicatorProperty

      public final javafx.beans.property.ObjectProperty<javafx.scene.control.ProgressIndicator> progressIndicatorProperty()
      The progress indicator that will be used to display percentage progress or the indeterminate state of the loading progress.
      Returns:
      the progress indicator
      See Also:
    • setProgressIndicator

      public final void setProgressIndicator(javafx.scene.control.ProgressIndicator progressIndicator)
      Sets the value of the progressIndicator property.
      Property description:
      The progress indicator that will be used to display percentage progress or the indeterminate state of the loading progress.
      Parameters:
      progressIndicator - the value for the progressIndicator property
      See Also:
    • getCommitDelay

      public final long getCommitDelay()
      Gets the value of the commitDelay property.
      Property description:
      The commit delay duration that will be applied before the control does change to a new state. The default is 200 milliseconds.
      Returns:
      the value of the commitDelay property
      See Also:
    • commitDelayProperty

      public final javafx.beans.property.LongProperty commitDelayProperty()
      The commit delay duration that will be applied before the control does change to a new state. The default is 200 milliseconds.
      Returns:
      the delay duration in milliseconds
      See Also:
    • setCommitDelay

      public final void setCommitDelay(long commitDelay)
      Sets the value of the commitDelay property.
      Property description:
      The commit delay duration that will be applied before the control does change to a new state. The default is 200 milliseconds.
      Parameters:
      commitDelay - the value for the commitDelay property
      See Also:
    • errorProperty

      public final javafx.beans.property.StringProperty errorProperty()
      The error text that will be shown if the pane is in status LoadingPane.Status.ERROR.
      Returns:
      the error message
      See Also:
    • getError

      public final String getError()
      Gets the value of the error property.
      Property description:
      The error text that will be shown if the pane is in status LoadingPane.Status.ERROR.
      Returns:
      the value of the error property
      See Also:
    • setError

      public final void setError(String error)
      Sets the value of the error property.
      Property description:
      The error text that will be shown if the pane is in status LoadingPane.Status.ERROR.
      Parameters:
      error - the value for the error property
      See Also:
    • getContent

      public final javafx.scene.Node getContent()
      Gets the value of the content property.
      Property description:
      The wrapped content node.
      Returns:
      the value of the content property
      See Also:
    • contentProperty

      public final javafx.beans.property.ObjectProperty<javafx.scene.Node> contentProperty()
      The wrapped content node.
      Returns:
      the node / the view wrapped by the loading pane, e.g. a list or a table view
      See Also:
    • setContent

      public final void setContent(javafx.scene.Node content)
      Sets the value of the content property.
      Property description:
      The wrapped content node.
      Parameters:
      content - the value for the content property
      See Also:
    • statusProperty

      public final javafx.beans.property.ObjectProperty<LoadingPane.Status> statusProperty()
      The current status of the loading pane.
      Returns:
      the status of the loading pane
      See Also:
    • getStatus

      public final LoadingPane.Status getStatus()
      Gets the value of the status property.
      Property description:
      The current status of the loading pane.
      Returns:
      the value of the status property
      See Also:
    • setStatus

      public final void setStatus(LoadingPane.Status status)
      Sets the value of the status property.
      Property description:
      The current status of the loading pane.
      Parameters:
      status - the value for the status property
      See Also:
    • sizeProperty

      public final javafx.beans.property.ObjectProperty<LoadingPane.Size> sizeProperty()
      The size of the progress indicator. The size should match the size of the wrapped node.

      Can be set via CSS using the -fx-size property. Valid values are: SMALL, MEDIUM, LARGE. The default value is MEDIUM.

      Returns:
      the size of the progress indicator
      See Also:
    • getSize

      public final LoadingPane.Size getSize()
      Gets the value of the size property.
      Property description:
      The size of the progress indicator. The size should match the size of the wrapped node.

      Can be set via CSS using the -fx-size property. Valid values are: SMALL, MEDIUM, LARGE. The default value is MEDIUM.

      Returns:
      the value of the size property
      See Also:
    • setSize

      public final void setSize(LoadingPane.Size size)
      Sets the value of the size property.
      Property description:
      The size of the progress indicator. The size should match the size of the wrapped node.

      Can be set via CSS using the -fx-size property. Valid values are: SMALL, MEDIUM, LARGE. The default value is MEDIUM.

      Parameters:
      size - the value for the size property
      See Also:
    • getClassCssMetaData

      public static List<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> getClassCssMetaData()
    • getCssMetaData

      public List<javafx.css.CssMetaData<? extends javafx.css.Styleable, ?>> getCssMetaData()
      Specified by:
      getCssMetaData in interface javafx.css.Styleable
      Overrides:
      getCssMetaData in class javafx.scene.layout.StackPane
    • getProgress

      public final double getProgress()
      Gets the value of the progress property.
      Property description:
      The progress (value between 0 and 1).
      Returns:
      the value of the progress property
      See Also:
    • setProgress

      public final void setProgress(double progress)
      Sets the value of the progress property.
      Property description:
      The progress (value between 0 and 1).
      Parameters:
      progress - the value for the progress property
      See Also:
    • progressProperty

      public final javafx.beans.property.DoubleProperty progressProperty()
      The progress (value between 0 and 1).
      Returns:
      the progress of the loading process
      See Also:
    • load

      public final void load()
      Convenience method to change the status of the pane to LoadingPane.Status.LOADING. Automatically clears the error text. This method is thread-safe.
    • ok

      public final void ok()
      Convenience method to change the status of the pane to LoadingPane.Status.OK. Automatically clears the error text. This method is thread-safe.
    • error

      public final void error(String message)
      Convenience method to change the status of the pane to LoadingPane.Status.ERROR. Also changes the error text to the given value. This method is thread-safe.
    • error

      public final void error(Throwable ex)
      Convenience method to change the status of the pane to LoadingPane.Status.ERROR. Also changes the error text to the message provided by the throwable. This method is thread-safe.
    • error

      public final void error()
      Convenience method to change the status of the pane to LoadingPane.Status.ERROR. There will be no error message shown. This method is thread-safe.