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

public Class GridTableView<S>

extends Control
Class Inheritance
Type Parameters
<S>
item type
Imports
com.dlsc.gemsfx.CircleProgressIndicator, .LoadingPane, com.dlsc.gemsfx.skins.GridTableViewSkin, javafx.beans.property.IntegerProperty, .ListProperty, .LongProperty, .ObjectProperty, .SimpleIntegerProperty, .SimpleListProperty, .SimpleLongProperty, .SimpleObjectProperty, javafx.collections.FXCollections, .ObservableList, javafx.geometry.Orientation, javafx.scene.Node, javafx.scene.control.ContextMenu, .Control, .Label, .ProgressIndicator, .Skin, javafx.scene.input.MouseButton, .MouseEvent, javafx.util.Callback, java.util.Objects, java.util.function.Consumer

A simple table view implementation based on GridPane.

Field Summary

Modifier and TypeField and Description
private final ListProperty<GridTableColumn<S, ?>>
private final LongProperty
private static final String
private final ListProperty<S>
private final ObjectProperty<LoadingPane.Status>
private final ObjectProperty<LoadingPane.Size>
private final IntegerProperty
private final ObjectProperty<Callback<S, ContextMenu>>
private final ObjectProperty<Consumer<S>>
private final ObjectProperty<Node>
private final ObjectProperty<ProgressIndicator>
private final ObjectProperty<Callback<S, Node>>
private final ObjectProperty<Callback<S, Node>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Returns:

the commit delay for the nested loading pane
commitLoadStatusDelayProperty
()

The delay in milliseconds before the list view will display the progress indicator for long running load operations.

protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

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

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

Overrides javafx.scene.Node.getContentBias.

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

public final ObservableList<S>
public final LoadingPane.Status
public final LoadingPane.Size
public final int
public final Callback<S, ContextMenu>
public final Consumer<S>
public final Node
public final ProgressIndicator
public Callback<S, Node>
public Callback<S, Node>
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 ListProperty<S>
public final ObjectProperty<LoadingPane.Status>

Returns:

the loading status
loadingStatusProperty
()

The loading status used for the wrapped LoadingPane.

public final ObjectProperty<LoadingPane.Size>
public final IntegerProperty
public final ObjectProperty<Callback<S, ContextMenu>>

Returns:

the callback for creating a context menu for a given item / row.
onContextMenuForItemRequestedProperty
()

An optional callback that can be used to create a context menu for a given item / row.

public final ObjectProperty<Consumer<S>>

Returns:

a callback for opening table items
onOpenItemProperty
()

A callback for opening an item represented by a row in the table view.

public final ObjectProperty<Node>
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()

Triggers a rebuild of the view without reloading data.

public ObjectProperty<Callback<S, Node>>
public ObjectProperty<Callback<S, Node>>
public final void
public final void
setCommitLoadStatusDelay(long commitLoadStatusDelay)

public final void
public final void
public final void
public final void
setMinNumberOfRows(int minNumberOfRows)

public final void
setOnContextMenuForItemRequested(Callback<S, ContextMenu> onContextMenuForItemRequested)

public final void
setOnOpenItem(Consumer<S> onOpenItem)

public final void
setPlaceholder(Node placeholder)

public final void
public void
setRowFooterFactory(Callback<S, Node> rowFooterFactory)

public void
setRowHeaderFactory(Callback<S, Node> rowHeaderFactory)

Inherited from javafx.scene.control.Control:
computeMaxHeightcomputeMaxWidthcomputeMinHeightcomputeMinWidthcomputePrefHeightcomputePrefWidthcontextMenuPropertyexecuteAccessibleActiongetBaselineOffsetgetClassCssMetaDatagetContextMenugetControlCssMetaDatagetCssMetaDatagetInitialFocusTraversablegetSkingetTooltipisResizablelayoutChildrenqueryAccessibleAttributesetContextMenusetSkinsetTooltipskinPropertytooltipProperty

Field Detail

columnsback to summary
private final ListProperty<GridTableColumn<S, ?>> columns
commitLoadStatusDelayback to summary
private final LongProperty commitLoadStatusDelay
DEFAULT_STYLE_CLASSback to summary
private static final String DEFAULT_STYLE_CLASS
itemsback to summary
private final ListProperty<S> items
loadingStatusback to summary
private final ObjectProperty<LoadingPane.Status> loadingStatus
loadingStatusSizeback to summary
private final ObjectProperty<LoadingPane.Size> loadingStatusSize
minNumberOfRowsback to summary
private final IntegerProperty minNumberOfRows
onContextMenuForItemRequestedback to summary
private final ObjectProperty<Callback<S, ContextMenu>> onContextMenuForItemRequested
onOpenItemback to summary
private final ObjectProperty<Consumer<S>> onOpenItem
placeholderback to summary
private final ObjectProperty<Node> placeholder
progressIndicatorback to summary
private final ObjectProperty<ProgressIndicator> progressIndicator
rowFooterFactoryback to summary
private final ObjectProperty<Callback<S, Node>> rowFooterFactory
rowHeaderFactoryback to summary
private final ObjectProperty<Callback<S, Node>> rowHeaderFactory

Constructor Detail

GridTableViewback to summary
public GridTableView()

Method Detail

columnsPropertyback to summary
public final ListProperty<GridTableColumn<S, ?>> columnsProperty()
commitLoadStatusDelayPropertyback to summary
public final LongProperty commitLoadStatusDelayProperty()

The delay in milliseconds before the list view will display the progress indicator for long running load operations.

Returns:LongProperty

the commit delay for the nested loading pane

See Also
LoadingPane#commitDelayProperty()
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<S, ?>> getColumns()
getCommitLoadStatusDelayback to summary
public final long getCommitLoadStatusDelay()
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
getItemsback to summary
public final ObservableList<S> getItems()
getLoadingStatusback to summary
public final LoadingPane.Status getLoadingStatus()
getLoadingStatusSizeback to summary
public final LoadingPane.Size getLoadingStatusSize()
getMinNumberOfRowsback to summary
public final int getMinNumberOfRows()
getOnContextMenuForItemRequestedback to summary
public final Callback<S, ContextMenu> getOnContextMenuForItemRequested()
getOnOpenItemback to summary
public final Consumer<S> getOnOpenItem()
getPlaceholderback to summary
public final Node getPlaceholder()
getProgressIndicatorback to summary
public final ProgressIndicator getProgressIndicator()
getRowFooterFactoryback to summary
public Callback<S, Node> getRowFooterFactory()
getRowHeaderFactoryback to summary
public Callback<S, Node> getRowHeaderFactory()
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
itemsPropertyback to summary
public final ListProperty<S> itemsProperty()
loadingStatusPropertyback to summary
public final ObjectProperty<LoadingPane.Status> loadingStatusProperty()

The loading status used for the wrapped LoadingPane. The loading pane will appear if the loader takes a long time to return the new page items.

Returns:ObjectProperty<LoadingPane.Status>

the loading status

loadingStatusSizePropertyback to summary
public final ObjectProperty<LoadingPane.Size> loadingStatusSizeProperty()
minNumberOfRowsPropertyback to summary
public final IntegerProperty minNumberOfRowsProperty()
onContextMenuForItemRequestedPropertyback to summary
public final ObjectProperty<Callback<S, ContextMenu>> onContextMenuForItemRequestedProperty()

An optional callback that can be used to create a context menu for a given item / row.

Returns:ObjectProperty<Callback<S, ContextMenu>>

the callback for creating a context menu for a given item / row.

onOpenItemPropertyback to summary
public final ObjectProperty<Consumer<S>> onOpenItemProperty()

A callback for opening an item represented by a row in the table view.

Returns:ObjectProperty<Consumer<S>>

a callback for opening table items

placeholderPropertyback to summary
public final ObjectProperty<Node> placeholderProperty()
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()

Triggers a rebuild of the view without reloading data.

rowFooterFactoryPropertyback to summary
public ObjectProperty<Callback<S, Node>> rowFooterFactoryProperty()
rowHeaderFactoryPropertyback to summary
public ObjectProperty<Callback<S, Node>> rowHeaderFactoryProperty()
setColumnsback to summary
public final void setColumns(ObservableList<GridTableColumn<S, ?>> columns)
setCommitLoadStatusDelayback to summary
public final void setCommitLoadStatusDelay(long commitLoadStatusDelay)
setItemsback to summary
public final void setItems(ObservableList<S> items)
setLoadingStatusback to summary
public final void setLoadingStatus(LoadingPane.Status loadingStatus)
setLoadingStatusSizeback to summary
public final void setLoadingStatusSize(LoadingPane.Size loadingStatusSize)
setMinNumberOfRowsback to summary
public final void setMinNumberOfRows(int minNumberOfRows)
setOnContextMenuForItemRequestedback to summary
public final void setOnContextMenuForItemRequested(Callback<S, ContextMenu> onContextMenuForItemRequested)
setOnOpenItemback to summary
public final void setOnOpenItem(Consumer<S> onOpenItem)
setPlaceholderback to summary
public final void setPlaceholder(Node placeholder)
setProgressIndicatorback to summary
public final void setProgressIndicator(ProgressIndicator progressIndicator)
setRowFooterFactoryback to summary
public void setRowFooterFactory(Callback<S, Node> rowFooterFactory)
setRowHeaderFactoryback to summary
public void setRowHeaderFactory(Callback<S, Node> rowHeaderFactory)