Example usage for javafx.scene.control.cell PropertyValueFactory getProperty

List of usage examples for javafx.scene.control.cell PropertyValueFactory getProperty

Introduction

In this page you can find the example usage for javafx.scene.control.cell PropertyValueFactory getProperty.

Prototype

public final String getProperty() 

Source Link

Document

Returns the property name provided in the constructor.

Usage

From source file:com.panemu.tiwulfx.table.TableControl.java

/**
 * Reload data on current page. This method is called when pressing reload
 * button TODO: put it in separate thread and display progress indicator on
 * TableView//from www  .  j av a  2 s  .co m
 *
 * @see #reloadFirstPage()
 */
public void reload() {
    if (!lstChangedRow.isEmpty()) {
        if (!controller.revertConfirmation(this, lstChangedRow.size())) {
            return;
        }
    }
    lstCriteria.clear();
    /**
     * Should be in new arraylist to avoid
     * java.lang.IllegalArgumentException: Children: duplicate children
     * added
     */
    List<TableColumn<R, ?>> lstColumns = new ArrayList<>(tblView.getColumns());
    lstColumns = getColumnsRecursively(lstColumns);
    for (TableColumn clm : lstColumns) {
        if (clm instanceof BaseColumn) {
            BaseColumn baseColumn = (BaseColumn) clm;
            if (baseColumn.getTableCriteria() != null) {
                lstCriteria.add(baseColumn.getTableCriteria());
            }
        }
    }
    List<String> lstSortedColumn = new ArrayList<>();
    List<SortType> lstSortedType = new ArrayList<>();
    for (TableColumn<R, ?> tc : tblView.getSortOrder()) {
        if (tc instanceof BaseColumn) {
            lstSortedColumn.add(((BaseColumn) tc).getPropertyName());
            lstSortedType.add(tc.getSortType());
        } else if (tc.getCellValueFactory() instanceof PropertyValueFactory) {
            PropertyValueFactory valFactory = (PropertyValueFactory) tc.getCellValueFactory();
            lstSortedColumn.add(valFactory.getProperty());
            lstSortedType.add(tc.getSortType());
        }
    }

    service.runLoadInBackground(lstSortedColumn, lstSortedType);
}