- All Implemented Interfaces:
Styleable,EventTarget,Skinnable
There are three main properties:
- the current page property that specifies the current selected page
- the max page property that specifies the number of pages
- the pages to show property that specifies how many pages can be shown at a time by the control
MFXPagination is highly customizable.
The indexesSupplierProperty() allows you to specify how to build the page indexes. The default
algorithm, set by defaultIndexesSupplier(), is a digg-style pagination.
The pageCellFactoryProperty() allows you to specify how to build the pages' button.
The ellipseStringProperty() allows you to specify the string shown on the truncated pages.
The showPopupForTruncatedPagesProperty() allows you to decide whether to show a little popup
when clicking ona truncated page, which contains a list of the pages in between, for faster navigation.
The popup in created and handled by the default cells, MFXPage.
The orientationProperty() allows you to specify the pagination orientation.
-
Property Summary
PropertiesTypePropertyDescriptionSpecifies the current selected page.Specifies the string to show for truncated pages.This supplier specifies the algorithm used to build the pages.Specifies the max number of pages.Specifies the control's orientation.This function specifies how to convert an index to a page.Specifies the max number of pages to show at a time.Specifies whether truncated pages should show a popup containing the pages in between, on click.Properties 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, visible -
Field Summary
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZEFields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomputeMiddleIndexes(int current, int toShow) Helper method tocomputePagesIndex()to properly compute the page indexes when the current page is in the middle.This is the default algorithm used to build the pages.protected Skin<?>Specifies the current selected page.voidSets the default indexing algorithm.Specifies the string to show for truncated pages.intGets the value of the property currentPage.Gets the value of the property ellipseString.Gets the value of the property indexesSupplier.intGets the value of the property maxPage.Gets the value of the property orientation.Gets the value of the property pageCellFactory.intGets the value of the property pagesToShow.This supplier specifies the algorithm used to build the pages.booleanGets the value of the property showPopupForTruncatedPages.Specifies the max number of pages.Specifies the control's orientation.This function specifies how to convert an index to a page.Specifies the max number of pages to show at a time.voidsetCurrentPage(int currentPage) Sets the value of the property currentPage.voidsetEllipseString(String ellipseString) Sets the value of the property ellipseString.voidsetIndexesSupplier(Supplier<List<Integer>> indexesSupplier) Sets the value of the property indexesSupplier.voidsetMaxPage(int maxPage) Sets the value of the property maxPage.voidsetOrientation(Orientation orientation) Sets the value of the property orientation.voidsetPageCellFactory(Function<Integer, MFXPage> pageCellFactory) Sets the value of the property pageCellFactory.voidsetPagesToShow(int pagesToShow) Sets the value of the property pagesToShow.voidsetShowPopupForTruncatedPages(boolean showPopupForTruncatedPages) Sets the value of the property showPopupForTruncatedPages.Specifies whether truncated pages should show a popup containing the pages in between, on click.Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, 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 javafx.css.Styleable
getStyleableNode
-
Property Details
-
currentPage
Specifies the current selected page.- See Also:
-
maxPage
Specifies the max number of pages.- See Also:
-
pagesToShow
Specifies the max number of pages to show at a time.- See Also:
-
indexesSupplier
This supplier specifies the algorithm used to build the pages. -
pageCellFactory
This function specifies how to convert an index to a page. -
ellipseString
Specifies the string to show for truncated pages.- See Also:
-
orientation
Specifies the control's orientation.- See Also:
-
showPopupForTruncatedPages
Specifies whether truncated pages should show a popup containing the pages in between, on click.
-
-
Constructor Details
-
MFXPagination
public MFXPagination() -
MFXPagination
public MFXPagination(int maxPage) -
MFXPagination
public MFXPagination(int maxPage, int toShow)
-
-
Method Details
-
defaultIndexesSupplier
public void defaultIndexesSupplier()Sets the default indexing algorithm. -
computePagesIndex
This is the default algorithm used to build the pages.This is a digg-style pagination algorithm.
There are some exception that won't make this work as expected. If the number of pages is lesser than the specified number of pages to show, or the specified number of pages to show is lesser than 5, all the indexes will be shown. -
computeMiddleIndexes
Helper method tocomputePagesIndex()to properly compute the page indexes when the current page is in the middle. -
createDefaultSkin
- Overrides:
createDefaultSkinin classControl
-
getUserAgentStylesheet
- Overrides:
getUserAgentStylesheetin classRegion
-
getCurrentPage
public int getCurrentPage()Gets the value of the property currentPage.- Property description:
- Specifies the current selected page.
-
currentPageProperty
Specifies the current selected page.- See Also:
-
setCurrentPage
public void setCurrentPage(int currentPage) Sets the value of the property currentPage.- Property description:
- Specifies the current selected page.
-
getMaxPage
public int getMaxPage()Gets the value of the property maxPage.- Property description:
- Specifies the max number of pages.
-
maxPageProperty
Specifies the max number of pages.- See Also:
-
setMaxPage
public void setMaxPage(int maxPage) Sets the value of the property maxPage.- Property description:
- Specifies the max number of pages.
-
getPagesToShow
public int getPagesToShow()Gets the value of the property pagesToShow.- Property description:
- Specifies the max number of pages to show at a time.
-
pagesToShowProperty
Specifies the max number of pages to show at a time.- See Also:
-
setPagesToShow
public void setPagesToShow(int pagesToShow) Sets the value of the property pagesToShow.- Property description:
- Specifies the max number of pages to show at a time.
-
getIndexesSupplier
Gets the value of the property indexesSupplier.- Property description:
- This supplier specifies the algorithm used to build the pages.
-
indexesSupplierProperty
This supplier specifies the algorithm used to build the pages. -
setIndexesSupplier
Sets the value of the property indexesSupplier.- Property description:
- This supplier specifies the algorithm used to build the pages.
-
getPageCellFactory
Gets the value of the property pageCellFactory.- Property description:
- This function specifies how to convert an index to a page.
-
pageCellFactoryProperty
This function specifies how to convert an index to a page. -
setPageCellFactory
Sets the value of the property pageCellFactory.- Property description:
- This function specifies how to convert an index to a page.
-
getEllipseString
Gets the value of the property ellipseString.- Property description:
- Specifies the string to show for truncated pages.
-
ellipseStringProperty
Specifies the string to show for truncated pages.- See Also:
-
setEllipseString
Sets the value of the property ellipseString.- Property description:
- Specifies the string to show for truncated pages.
-
getOrientation
Gets the value of the property orientation.- Property description:
- Specifies the control's orientation.
-
orientationProperty
Specifies the control's orientation.- See Also:
-
setOrientation
Sets the value of the property orientation.- Property description:
- Specifies the control's orientation.
-
isShowPopupForTruncatedPages
public boolean isShowPopupForTruncatedPages()Gets the value of the property showPopupForTruncatedPages.- Property description:
- Specifies whether truncated pages should show a popup containing the pages in between, on click.
-
showPopupForTruncatedPagesProperty
Specifies whether truncated pages should show a popup containing the pages in between, on click. -
setShowPopupForTruncatedPages
public void setShowPopupForTruncatedPages(boolean showPopupForTruncatedPages) Sets the value of the property showPopupForTruncatedPages.- Property description:
- Specifies whether truncated pages should show a popup containing the pages in between, on click.
-