Example usage for javafx.scene.control TableColumn cellValueFactoryProperty

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

Introduction

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

Prototype

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

Source Link

Usage

From source file:com.ggvaidya.scinames.complexquery.ComplexQueryViewController.java

private TableColumn<Change, String> createTableColumnFromChange(String colName, Function<Change, String> func) {
    TableColumn<Change, String> column = new TableColumn<>(colName);
    column.cellValueFactoryProperty().set(cvf -> new ReadOnlyStringWrapper(func.apply(cvf.getValue())));
    column.setPrefWidth(100.0);//w  ww  .j a  v a2 s  .  c  o  m
    column.setEditable(false);
    return column;
}

From source file:com.ggvaidya.scinames.complexquery.ComplexQueryViewController.java

private TableColumn<NameCluster, String> createColumnFromPrecalc(String colName,
        Table<NameCluster, String, Set<String>> precalc) {
    TableColumn<NameCluster, String> column = new TableColumn<>(colName);
    column.cellValueFactoryProperty().set((TableColumn.CellDataFeatures<NameCluster, String> cdf) -> {
        NameCluster nc = cdf.getValue();

        // There might be columns found in some dataset but not in others
        // so we detect those cases here and put in "NA"s instead.
        String output = "NA";
        if (precalc.contains(nc, colName))
            output = precalc.get(nc, colName).stream().collect(Collectors.joining("; "));

        return new ReadOnlyStringWrapper(output);
    });/*from  www.  j  a  v  a  2 s  . co m*/
    column.setPrefWidth(100.0);
    column.setEditable(false);
    return column;
}

From source file:com.ggvaidya.scinames.ui.DataReconciliatorController.java

private TableColumn<String, String> createColumnFromPrecalc(String colName,
        Table<String, String, Set<String>> precalc) {
    TableColumn<String, String> column = new TableColumn<>(colName);
    column.cellValueFactoryProperty().set((TableColumn.CellDataFeatures<String, String> cdf) -> {
        String clusterID = cdf.getValue();

        // There might be columns found in some dataset but not in others
        // so we detect those cases here and put in "NA"s instead.
        String output = "NA";
        if (precalc.contains(clusterID, colName))
            output = precalc.get(clusterID, colName).stream().collect(Collectors.joining("; "));

        return new ReadOnlyStringWrapper(output);
    });/*from  w  w w  .j av a2  s  .c  om*/
    column.setPrefWidth(100.0);
    column.setEditable(false);
    return column;
}