本文整理了Java中javafx.scene.control.TableColumn.setCellValueFactory()
方法的一些代码示例,展示了TableColumn.setCellValueFactory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableColumn.setCellValueFactory()
方法的具体详情如下:
包路径:javafx.scene.control.TableColumn
类名称:TableColumn
方法名:setCellValueFactory
暂无
代码示例来源:origin: pmd/pmd
StringConverter<PropertyTypeId> converter = DesignerUtil.stringConverter(PropertyTypeId::getStringId, PropertyTypeId::lookupMnemonic);
propertyTypeColumn.setCellFactory(ChoiceBoxTableCell.forTableColumn(converter, availableBuilders));
propertyNameColumn.setCellValueFactory(new PropertyValueFactory<>("name"));
propertyValueColumn.setCellValueFactory(new PropertyValueFactory<>("value"));
propertyTypeColumn.setCellValueFactory(new PropertyValueFactory<>("typeId"));
代码示例来源:origin: pmd/pmd
logDateColumn.setCellValueFactory(entry -> new SimpleObjectProperty<>(entry.getValue()));
logDateColumn.setCellFactory(column -> new TableCell<LogEntry, LogEntry>() {
logCategoryColumn.setCellValueFactory(new PropertyValueFactory<>("category"));
logMessageColumn.setCellValueFactory(new PropertyValueFactory<>("message"));
logMessageColumn.setSortable(false);
代码示例来源:origin: stackoverflow.com
public class MainWindowController implements Initializable {
@FXML
public TableColumn levelOfGrowthColumn;
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
ObservableList<Person> persons = FXCollections.observableArrayList();
persons.add(new Person(0));
persons.add(new Person(0.5));
persons.add(new Person(1));
levelOfGrowthColumn.setCellValueFactory(new PropertyValueFactory<Person, Double>("levelOfGrowth"));
}
}
代码示例来源:origin: torakiki/pdfsam
@Override
public TableColumn<SelectionTableRowData, Boolean> getTableColumn() {
TableColumn<SelectionTableRowData, Boolean> tableColumn = new TableColumn<>(getColumnTitle());
tableColumn.setCellFactory(CheckBoxTableCell.forTableColumn(tableColumn));
tableColumn.setCellValueFactory(
new Callback<CellDataFeatures<SelectionTableRowData, Boolean>, ObservableValue<Boolean>>() {
@Override
public ObservableValue<Boolean> call(CellDataFeatures<SelectionTableRowData, Boolean> param) {
if (param.getValue() != null) {
return param.getValue().reverse;
}
return null;
}
});
return tableColumn;
}
代码示例来源:origin: torakiki/pdfsam
@Override
default TableColumn<SelectionTableRowData, T> getTableColumn() {
TableColumn<SelectionTableRowData, T> tableColumn = new TableColumn<>(getColumnTitle());
tableColumn.setCellFactory(cellFactory());
tableColumn.setCellValueFactory(cellValueFactory());
tableColumn.setComparator(comparator());
return tableColumn;
}
代码示例来源:origin: stackoverflow.com
levelOfGrowthColumn.setCellValueFactory(new PropertyValueFactory<Person, Double>("levelOfGrowth"));
代码示例来源:origin: torakiki/pdfsam
@Override
public TableColumn<SelectionTableRowData, PdfDescriptorLoadingStatus> getTableColumn() {
TableColumn<SelectionTableRowData, PdfDescriptorLoadingStatus> tableColumn = new TableColumn<>(getColumnTitle());
tableColumn.setCellFactory(cellFactory());
tableColumn.setCellValueFactory(cellValueFactory());
tableColumn.setComparator(null);
tableColumn.setSortable(false);
tableColumn.setMaxWidth(26);
tableColumn.setMinWidth(26);
return tableColumn;
}
代码示例来源:origin: stackoverflow.com
private void populateTable() {
for (TableColumn tc : columns) {
// need to figure out how to remove rowNumber from this....
tc.setCellValueFactory(new ValueFactory(columns.indexOf(tc), rowNumber));
dpcontroller.tableView.getColumns().add(tc);
}
//data included in dataRows are correct.//after printout debug
dpcontroller.tableView.setItems(dataRows);//ERROR THROWN IF MULTIPLE ROWS
}
代码示例来源:origin: stackoverflow.com
(int i=0 ; i<rsa.getMetaData().getColumnCount(); i++){
//We are using non property style for making dynamic table
final int j = i;
TableColumn col = new TableColumn(rsa.getMetaData().getColumnName(i+1));
col.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<ObservableList,String>,ObservableValue<String>>(){
public ObservableValue<String> call(TableColumn.CellDataFeatures<ObservableList, String> param) {
return new SimpleStringProperty(param.getValue().get(j).toString());
}
});
tableView.getColumns().addAll(col);
System.out.println("Column ["+i+"] ");
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
/**
* Setup a table column with the provided value extractor
*
* @param c
* the column to configure
* @param valueExtractor
* function to extract the value
* @return the column instance itself
*/
public static <S, T> TableColumn<S, T> setupColumn(TableColumn<S, T> c, Function<S, T> valueExtractor) {
c.setCellValueFactory(f -> new SimpleObjectProperty<>(valueExtractor.apply(f.getValue())));
return c;
}
代码示例来源:origin: sc.fiji/OMEVisual
private void populateImageInformations(ImageModel model) {
this.imageTable.getItems().clear();
this.imageNameColumn.setCellValueFactory(data -> {
return new ReadOnlyStringWrapper(data.getValue().get(0));
});
this.imageValueColumn.setCellValueFactory(data -> {
return new ReadOnlyStringWrapper(data.getValue().get(1));
});
for (List<String> row : model.getInformationsRow()) {
this.imageTable.getItems().add(row);
}
}
代码示例来源:origin: org.copper-engine/copper-monitoring-client
private void showDataStorage(ConfigurationInfo configurationInfo) {
MonitoringDataStorageInfo storageInfo = configurationInfo.getMonitoringDataStorageInfo();
DecimalFormat format = new DecimalFormat("#0.000");
double deltatInS = (storageInfo.getMax().getTime() - storageInfo.getMin().getTime()) / 1000;
size.setText(format.format(storageInfo.getSizeInMb()) + " mb (" + format.format(storageInfo.getSizeInMb() / deltatInS * 1000) + " kb/s)");
location.setText(storageInfo.getPath());
typeCol.setCellValueFactory(new PropertyValueFactory<MonitoringDataStorageContentInfo, String>("type"));
countCol.setCellValueFactory(new PropertyValueFactory<MonitoringDataStorageContentInfo, Long>("count"));
}
代码示例来源:origin: stackoverflow.com
Callback<TableColumn, TableCell> checkboxCellFactory = new Callback<TableColumn, TableCell>() {
@Override
public TableCell call(TableColumn p) {
return new CheckboxCell();
}
};
TableColumn selectColumn = (TableColumn) tbvDatos.getColumns().get(1);
selectColumn.setCellValueFactory(new PropertyValueFactory("selected"));
selectColumn.setCellFactory(checkboxCellFactory);
代码示例来源:origin: ssaring/sportstracker
@Override
protected void setupTableColumns() {
// setup factories for providing cell values
tcDate.setCellValueFactory(new PropertyValueFactory<>("dateTime"));
tcComment.setCellValueFactory(cellData -> new SimpleStringProperty( //
StringUtils.getFirstLineOfText(cellData.getValue().getComment())));
// setup custom factories for displaying cells
tcDate.setCellFactory(new LocalDateCellFactory<>());
}
代码示例来源:origin: org.codehaus.griffon.plugins/griffon-glazedlists-javafx
@SuppressWarnings("unchecked")
protected <T> void processTableFormat(@Nonnull TableColumn<E, T> column, String columnName, int columnIndex) {
column.setCellValueFactory(cell -> (ObservableValue<T>) format.getColumnObservableValue(cell.getValue(), columnIndex));
column.setCellFactory(param -> format.getTableCellFactory(columnIndex).createTableCell(param));
}
代码示例来源:origin: sc.fiji/OMEVisual
private void populateTiffDataInformations(TiffDataModel model) {
ImageModel imageModel = model.getImageModel();
this.populateImageInformations(imageModel);
// Populate tiffData
this.tiffDataTable.getItems().clear();
this.tiffDataNameColumn.setCellValueFactory(data -> {
return new ReadOnlyStringWrapper(data.getValue().get(0));
});
this.tiffDataValueColumn.setCellValueFactory(data -> {
return new ReadOnlyStringWrapper(data.getValue().get(1));
});
for (List<String> row : model.getInformationsRow()) {
this.tiffDataTable.getItems().add(row);
}
}
}
代码示例来源:origin: ssaring/sportstracker
@Override
protected void setupTableColumns() {
// setup factories for providing cell values
tcDate.setCellValueFactory(new PropertyValueFactory<>("dateTime"));
tcWeight.setCellValueFactory(new PropertyValueFactory<>("value"));
tcComment.setCellValueFactory(cellData -> new SimpleStringProperty( //
StringUtils.getFirstLineOfText(cellData.getValue().getComment())));
// setup custom factories for displaying cells
tcDate.setCellFactory(new LocalDateCellFactory<>());
tcWeight.setCellFactory(new FormattedNumberCellFactory<>(value -> //
value == null ? null : getContext().getFormatUtils().weightToString(value.floatValue(), 2)));
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
private void addSelectColumn() {
headerCheckboxCol.setPrefWidth(40);
headerCheckboxCol.setCellValueFactory(new PropertyValueFactory<>("selected"));
headerCheckboxCol.setCellFactory(param -> buildCell());
headerCheckboxCol.setGraphic(headerColCheckbox);
headerCheckboxCol.setVisible(false);
tableView.getColumns().add(0, headerCheckboxCol);
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
@SuppressWarnings({"unchecked"})
private void addSelectColumn() {
headerCheckboxCol.setPrefWidth(40);
headerCheckboxCol.setCellValueFactory(new PropertyValueFactory<>("selected"));
headerCheckboxCol.setCellFactory(param -> buildCell());
headerCheckboxCol.setGraphic(headerColCheckbox);
headerCheckboxCol.setVisible(false);
tableView.getColumns().add(0, headerCheckboxCol);
}
代码示例来源:origin: org.codehaus.griffon/griffon-javafx
@SuppressWarnings("unchecked")
protected void computeColumns() {
for (int i = 0; i < format.getColumnCount(); i++) {
final String columnName = format.getColumnName(i);
TableColumn column = new TableColumn(columnName);
final int columnIndex = i;
final TableCellFactory tableCellFactory = format.getTableCellFactory(i);
if (tableCellFactory != null) {
column.setCellFactory(cell -> tableCellFactory.createTableCell((TableColumn) cell));
}
column.setCellValueFactory(cell -> format.getObservableValue((E) ((TableColumn.CellDataFeatures) cell).getValue(), columnIndex));
columns.add(column);
}
}
内容来源于网络,如有侵权,请联系作者删除!