javafx.scene.control.TableColumn.setOnEditCommit()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(211)

本文整理了Java中javafx.scene.control.TableColumn.setOnEditCommit()方法的一些代码示例,展示了TableColumn.setOnEditCommit()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableColumn.setOnEditCommit()方法的具体详情如下:
包路径:javafx.scene.control.TableColumn
类名称:TableColumn
方法名:setOnEditCommit

TableColumn.setOnEditCommit介绍

暂无

代码示例

代码示例来源:origin: torakiki/pdfsam

@Override
public TableColumn<SelectionTableRowData, String> getTableColumn() {
  TableColumn<SelectionTableRowData, String> tableColumn = SelectionTableColumn.super.getTableColumn();
  tableColumn.setEditable(true);
  tableColumn.setOnEditCommit(t -> t.getTableView().getItems().get(t.getTablePosition().getRow()).pace
      .set(defaultIfBlank(t.getNewValue(), "1")));
  return tableColumn;
}

代码示例来源:origin: torakiki/pdfsam

@Override
public TableColumn<SelectionTableRowData, String> getTableColumn() {
  TableColumn<SelectionTableRowData, String> tableColumn = SelectionTableColumn.super.getTableColumn();
  tableColumn.setEditable(true);
  tableColumn.setOnEditCommit(
      t -> t.getTableView().getItems().get(t.getTablePosition().getRow()).pageSelection.set(t.getNewValue()));
  return tableColumn;
}

代码示例来源:origin: org.copper-engine/copper-monitoring-client

public static <T> void setupEditableBooleanColumn(TableColumn<T, Boolean> column, final ColumnBooleanAccessor<T> propertyAccessor) {
  column.getTableView().setEditable(true);
  column.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<T, Boolean>, ObservableValue<Boolean>>() {
    @Override
    public ObservableValue<Boolean> call(CellDataFeatures<T, Boolean> param) {
      return propertyAccessor.getProperty(param.getValue());
    }
  });
  column.setOnEditCommit(new EventHandler<CellEditEvent<T, Boolean>>() {
    @Override
    public void handle(CellEditEvent<T, Boolean> t) {
      propertyAccessor.getProperty(t.getRowValue()).setValue(t.getNewValue());
    }
  });
  column.setCellFactory(CheckBoxTableCell.forTableColumn(column));
  column.setEditable(true);
}

代码示例来源:origin: org.copper-engine/copper-monitoring-client

/**
 * T Tableobject
 * Column Display Type
 */
public static <T> void setupEditableStringColumn(TableColumn<T, String> column, final ColumnStringAccessor<T> propertyAccessor) {
  column.getTableView().setEditable(true);
  column.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<T, String>, ObservableValue<String>>() {
    @Override
    public ObservableValue<String> call(CellDataFeatures<T, String> param) {
      return propertyAccessor.getProperty(param.getValue());
    }
  });
  column.setEditable(true);
  column.setOnEditCommit(new EventHandler<CellEditEvent<T, String>>() {
    @Override
    public void handle(CellEditEvent<T, String> t) {
      propertyAccessor.getProperty(t.getRowValue()).setValue(t.getNewValue());
    }
  });
  column.setCellFactory(new Callback<TableColumn<T, String>, TableCell<T, String>>() {
    @Override
    public TableCell<T, String> call(TableColumn<T, String> param) {
      return new EditingCell<T>();
    }
  });
}

代码示例来源:origin: com.aquafx-project/aquafx

lastNameCol.setEditable(true);
lastNameCol.setCellFactory(TextFieldTableCell.forTableColumn());
lastNameCol.setOnEditCommit(new EventHandler<CellEditEvent<Person, String>>() {
  @Override public void handle(CellEditEvent<Person, String> t) {
    ((Person) t.getTableView().getItems().get(t.getTablePosition().getRow())).setLastName(t.getNewValue());
vipCol.setOnEditCommit(new EventHandler<CellEditEvent<Person, Boolean>>() {
  @Override public void handle(CellEditEvent<Person, Boolean> t) {
    ((Person) t.getTableView().getItems().get(t.getTablePosition().getRow())).setVip(t.getNewValue());

代码示例来源:origin: com.aquafx-project/aquafx

lastNameCol.setEditable(true);
lastNameCol.setCellFactory(TextFieldTableCell.forTableColumn());
lastNameCol.setOnEditCommit(new EventHandler<CellEditEvent<Person, String>>() {
  @Override public void handle(CellEditEvent<Person, String> t) {
    ((Person) t.getTableView().getItems().get(t.getTablePosition().getRow())).setLastName(t.getNewValue());
vipCol.setOnEditCommit(new EventHandler<CellEditEvent<Person, Boolean>>() {
  @Override public void handle(CellEditEvent<Person, Boolean> t) {
    ((Person) t.getTableView().getItems().get(t.getTablePosition().getRow())).setVip(t.getNewValue());

代码示例来源:origin: com.aquafx-project/aquafx

firstNameCol.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<Person, String>>() {
  @Override public void handle(TableColumn.CellEditEvent<Person, String> t) {
    System.out.println("Edit commit event: " + t.getNewValue());

相关文章