Search in sources :

Example 1 with Entity

use of com.kendy.interfaces.Entity in project financial by greatkendy123.

the class MyController method bindCellValue.

/**
 * kendy:绑定数据域
 * @param colums TableColumn 可变参数
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void bindCellValue(TableColumn<? extends Entity, String>... colums) {
    try {
        for (TableColumn column : colums) {
            String fxId = column.getId();
            column.setCellValueFactory(new PropertyValueFactory<Entity, String>(fxId));
            column.setStyle("-fx-alignment: CENTER;");
            // 禁止排序
            column.setSortable(false);
        }
    } catch (Exception e) {
        throw new RuntimeException("小林:绑定列值失败");
    }
}
Also used : Entity(com.kendy.interfaces.Entity) TableColumn(javafx.scene.control.TableColumn) IOException(java.io.IOException)

Example 2 with Entity

use of com.kendy.interfaces.Entity in project financial by greatkendy123.

the class LMController method bindCellValue.

/**
 * kendy:绑定数据域
 * @param colums TableColumn 可变参数
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
private void bindCellValue(TableColumn<? extends Entity, String>... colums) {
    try {
        for (TableColumn column : colums) {
            String fxId = column.getId();
            column.setCellValueFactory(new PropertyValueFactory<Entity, String>(fxId));
            column.setStyle("-fx-alignment: CENTER;");
            // 禁止排序
            column.setSortable(false);
        }
    } catch (Exception e) {
        throw new RuntimeException("小林:绑定列值失败");
    }
}
Also used : Entity(com.kendy.interfaces.Entity) TableColumn(javafx.scene.control.TableColumn)

Example 3 with Entity

use of com.kendy.interfaces.Entity in project financial by greatkendy123.

the class QuotaController method bindCellValue.

/**
 * kendy:绑定数据域
 * @param colums TableColumn 可变参数
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
private void bindCellValue(TableColumn<? extends Entity, String>... colums) {
    try {
        for (TableColumn column : colums) {
            String fxId = column.getId();
            column.setCellValueFactory(new PropertyValueFactory<Entity, String>(fxId));
            column.setStyle("-fx-alignment: CENTER;");
            // 禁止排序
            column.setSortable(false);
        }
    } catch (Exception e) {
        String errMsg = "小林:绑定列值失败";
        log.error(errMsg);
        throw new RuntimeException(errMsg);
    }
}
Also used : Entity(com.kendy.interfaces.Entity) TableColumn(javafx.scene.control.TableColumn)

Aggregations

Entity (com.kendy.interfaces.Entity)3 TableColumn (javafx.scene.control.TableColumn)3 IOException (java.io.IOException)1