Example usage for javafx.scene.control TableColumn getCellValueFactory

List of usage examples for javafx.scene.control TableColumn getCellValueFactory

Introduction

In this page you can find the example usage for javafx.scene.control TableColumn getCellValueFactory.

Prototype

public final Callback<CellDataFeatures<S, T>, ObservableValue<T>> getCellValueFactory() 

Source Link

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  w  w w. jav a2s. c  o  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);
}