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

public Class PagingListView<T>

extends ItemPagingControlBase<T>
Class Inheritance
Known Direct Subclasses
com.dlsc.gemsfx.paging.SimplePagingListView
Type Parameters
<T>
the type of items to be displayed in the list view
Imports
com.dlsc.gemsfx.CircleProgressIndicator, com.dlsc.gemsfx.skins.InnerListViewSkin, .PagingListViewSkin, javafx.beans.InvalidationListener, .Observable, javafx.beans.property.ObjectProperty, .SimpleObjectProperty, javafx.collections.FXCollections, .ObservableList, javafx.geometry.Orientation, javafx.scene.control.Cell, .ListCell, .ListView, .ProgressIndicator, .SelectionMode, .Skin, javafx.scene.layout.Region, javafx.util.Callback, java.util.Objects

PagingListView is a custom control that extends the functionality of a standard ListView to include paging capabilities. It is designed to handle large datasets efficiently by splitting the data into manageable pages and allowing navigation between them.

Field Summary

Modifier and TypeField and Description
private ObjectProperty<Callback<ListView<T>, ListCell<T>>>
private final ObservableList<T>
private final ListView<T>
private boolean
private final ObjectProperty<ProgressIndicator>
private final ObservableList<T>

Constructor Summary

AccessConstructor and Description
public
PagingListView()

Constructs a new PagingListView instance.

Method Summary

Modifier and TypeMethod and Description
public final ObjectProperty<Callback<ListView<T>, ListCell<T>>>

Returns:

the cell factory property
cellFactoryProperty
()

Setting a custom cell factory has the effect of deferring all cell creation, allowing for total customization of the cell.

protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

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

public final Callback<ListView<T>, ListCell<T>>

Returns:

the current cell factory
getCellFactory
()

Returns the current cell factory.

public final ListView<T>

Returns:

the list view
getListView
()

Returns the wrapped list view.

public final ProgressIndicator
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 ObjectProperty<ProgressIndicator>

Returns:

the progress indicator
progressIndicatorProperty
()

The progress indicator that will be used to display percentage progress or the indeterminate state of the loading progress.

public final void
refresh()

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

Triggers a rebuild of the view without reloading data.

public final void
setCellFactory(Callback<ListView<T>, ListCell<T>>
cell factory to use in this ListView
value
)

Sets a new cell factory to use in the ListView.

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

Field Detail

cellFactoryback to summary
private ObjectProperty<Callback<ListView<T>, ListCell<T>>> cellFactory
itemsback to summary
private final ObservableList<T> items
listViewback to summary
private final ListView<T> listView
processingServiceback to summary
private boolean processingService

Hides com.dlsc.gemsfx.paging.ItemPagingControlBase.processingService.

progressIndicatorback to summary
private final ObjectProperty<ProgressIndicator> progressIndicator
unmodifiableItemsback to summary
private final ObservableList<T> unmodifiableItems

Constructor Detail

PagingListViewback to summary
public PagingListView()

Constructs a new PagingListView instance. The PagingListView is a custom control that provides paging functionality for a list view, allowing for efficient display and navigation of large datasets across multiple pages. This constructor initializes the PagingListView by performing the following steps: - Adds a custom style class ("paging-list-view") to the control. - Configures the internal ListView, including setting a custom style class ("inner-list-view"), enabling "multiple selection" mode, and establishing bindings for the cell factory and items displayed on the current page. - Binds the selection model of the PagingListView to the internal ListView for consistent selection behavior. - Sets a default cell factory to customize the rendering of items in the list. - Listens to changes in the cell factory property and triggers a refresh when modifications occur.

Method Detail

cellFactoryPropertyback to summary
public final ObjectProperty<Callback<ListView<T>, ListCell<T>>> cellFactoryProperty()

Setting a custom cell factory has the effect of deferring all cell creation, allowing for total customization of the cell. Internally, the ListView is responsible for reusing ListCells - all that is necessary is for the custom cell factory to return from this function a ListCell which might be usable for representing any item in the ListView.

Refer to the Cell class documentation for more detail.

Returns:ObjectProperty<Callback<ListView<T>, ListCell<T>>>

the cell factory property

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
getCellFactoryback to summary
public final Callback<ListView<T>, ListCell<T>> getCellFactory()

Returns the current cell factory.

Returns:Callback<ListView<T>, ListCell<T>>

the current cell factory

getListViewback to summary
public final ListView<T> getListView()

Returns the wrapped list view.

Returns:ListView<T>

the list view

getProgressIndicatorback to summary
public final ProgressIndicator getProgressIndicator()
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
progressIndicatorPropertyback to summary
public final ObjectProperty<ProgressIndicator> progressIndicatorProperty()

The progress indicator that will be used to display percentage progress or the indeterminate state of the loading progress.

Returns:ObjectProperty<ProgressIndicator>

the progress indicator

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
setCellFactoryback to summary
public final void setCellFactory(Callback<ListView<T>, ListCell<T>> value)

Sets a new cell factory to use in the ListView. This forces all old ListCell's to be thrown away, and new ListCell's created with the new cell factory.

Parameters
value:Callback<ListView<T>, ListCell<T>>

cell factory to use in this ListView

setProgressIndicatorback to summary
public final void setProgressIndicator(ProgressIndicator progressIndicator)