Top Description Fields Constructors Methods
com.dlsc.gemsfx.paging

public Class PagingGridTableView<T>

extends ItemPagingControlBase<T>
Class Inheritance
Known Direct Subclasses
com.dlsc.gemsfx.paging.SimplePagingGridTableView
Type Parameters
<T>
the type of items displayed in the table view
Imports
com.dlsc.gemsfx.gridtable.GridTableColumn, .GridTableView, com.dlsc.gemsfx.skins.PagingGridTableViewSkin, javafx.beans.binding.Bindings, javafx.beans.property.ListProperty, .SimpleListProperty, javafx.collections.FXCollections, .ObservableList, javafx.geometry.Orientation, javafx.scene.control.Skin, java.util.Objects

The PagingGridTableView class is a control that combines a grid table with paging capabilities. This class facilitates the display of paginated data in a table format, supporting customizable columns, adjustable page size, and options to fill the last page with empty rows.

Field Summary

Modifier and TypeField and Description
private final ListProperty<GridTableColumn<T, ?>>
private final GridTableView<T>

Constructor Summary

AccessConstructor and Description
public
PagingGridTableView()

Default constructor for the PagingGridTableView class.

Method Summary

Modifier and TypeMethod and Description
public final ListProperty<GridTableColumn<T, ?>>

Returns:

the list property of GridTableColumn<T, ?> objects representing the columns
columnsProperty
()

Provides access to the list property containing the columns of the grid table.

protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control.

public final ObservableList<GridTableColumn<T, ?>>
public Orientation
getContentBias()

Overrides javafx.scene.Node.getContentBias.

Returns the orientation of a node's resizing bias for layout purposes.

public final GridTableView<T>

Returns:

the table view
getGridTableView
()

Returns the wrapped table view.

public String
getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method.

public final void
refresh()

Implements abstract com.dlsc.gemsfx.paging.ItemPagingControlBase.refresh.

Triggers a rebuild of the view without reloading data.

public final void
Inherited from com.dlsc.gemsfx.paging.ItemPagingControlBase:
commitLoadStatusDelayPropertyfillLastPagePropertygetCommitLoadStatusDelaygetItemsOnCurrentPagegetLoadDelayInMillisgetLoadergetLoadingServicegetLoadingStatusgetOnOpenItemgetPagingControlsLocationgetPlaceholdergetSelectionModelisFillLastPageisShowPagingControlsisUsingScrollPaneloadDelayInMillisPropertyloaderPropertyloadingServicePropertyloadingStatusPropertyonOpenItemPropertypagingControlsLocationPropertyplaceholderPropertyreloadselectionModelPropertysetCommitLoadStatusDelaysetFillLastPagesetLoadDelayInMillissetLoadersetLoadingServicesetLoadingStatussetOnOpenItemsetPagingControlsLocationsetPlaceholdersetSelectionModelsetShowPagingControlssetUsingScrollPaneshowPagingControlsPropertyusingScrollPaneProperty

Field Detail

columnsback to summary
private final ListProperty<GridTableColumn<T, ?>> columns
gridTableViewback to summary
private final GridTableView<T> gridTableView

Constructor Detail

PagingGridTableViewback to summary
public PagingGridTableView()

Default constructor for the PagingGridTableView class. This initializes the control and binds necessary properties to manage paging and display of items. The constructor sets up the following behavior: - Adds a specific style class named "paging-grid-table-view" to the control. - Binds the columns of the internal GridTableView to the columnsProperty of this control. - Sets the items of the internal GridTableView to the items provided by the current page. - Configures the `minNumberOfRowsProperty` of the internal GridTableView to ensure the proper number of rows are displayed, including empty rows if the last page should be filled. - Registers a listener on the `minNumberOfRowsProperty` to trigger a refresh when the property changes. Internally, this class uses the following additional methods and properties: - columnsProperty(): Provides access to the grid table's columns. - getItemsOnCurrentPage(): Supplies the items to display on the current page. - fillLastPageProperty(): Indicates whether the last page should be filled with empty rows if needed. - pageSizeProperty(): Defines the number of items per page. - refresh(): Rebuilds the view without reloading data.

Method Detail

columnsPropertyback to summary
public final ListProperty<GridTableColumn<T, ?>> columnsProperty()

Provides access to the list property containing the columns of the grid table.

Returns:ListProperty<GridTableColumn<T, ?>>

the list property of GridTableColumn<T, ?> objects representing the columns

createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Doc from javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Annotations
@Override
getColumnsback to summary
public final ObservableList<GridTableColumn<T, ?>> getColumns()
getContentBiasback to summary
public Orientation getContentBias()

Overrides javafx.scene.Node.getContentBias.

Doc from javafx.scene.Node.getContentBias.

Returns the orientation of a node's resizing bias for layout purposes. If the node type has no bias, returns null. If the node is resizable and it's height depends on its width, returns HORIZONTAL, else if its width depends on its height, returns VERTICAL.

Resizable subclasses should override this method to return an appropriate value.

Annotations
@Override
getGridTableViewback to summary
public final GridTableView<T> getGridTableView()

Returns the wrapped table view.

Returns:GridTableView<T>

the table view

getUserAgentStylesheetback to summary
public String getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

Doc from javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. These styles are used in addition to whatever user-agent stylesheets are in use. This provides a mechanism for third parties to introduce styles for custom controls.

The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL does not have a [scheme:] component, the URL is considered to be the [path] component only. Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to the root of the application's classpath.

Subclasses overriding this method should not assume any particular implementation approach as to the number and frequency with which it is called. For this reason, attempting any kind of dynamic implementation (i.e. returning different user agent stylesheet values) based on some state change is highly discouraged, as there is no guarantee when, or even if, this method will be called. Some JavaFX CSS implementations may choose to cache this response for an indefinite period of time, and therefore there should be no expectation around when this method is called.



package com.example.javafx.app;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class MyApp extends Application {

    @Override public void start(Stage stage) {
        Scene scene = new Scene(new Group());
        scene.getStylesheets().add("/com/example/javafx/app/mystyles.css");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
Annotations
@Override
refreshback to summary
public final void refresh()

Implements abstract com.dlsc.gemsfx.paging.ItemPagingControlBase.refresh.

Triggers a rebuild of the view without reloading data.

Annotations
@Override
setColumnsback to summary
public final void setColumns(ObservableList<GridTableColumn<T, ?>> columns)