单元格中的Eclipse Scout Neon值已更改

时间:2016-03-30 05:12:40

标签: eclipse-scout

我有可编辑列的表字段。当我在一个单元格中更改值时,我需要在其他字段中计算值。 我想知道,如何检测单元格中的值何时发生变化。 我找不到任何会告诉我细胞中的价值发生变化的钩子。

我找到了:

@Override
public void fireTableEventInternal(final TableEvent e) {

  if (e.getType() == TableEvent.TYPE_ROWS_UPDATED) {
    AbstractProductsTableField.this.execPriceValueChange();
  } else {
    super.fireTableEventInternal(e);
  }
}

但我不认为这是一种可行的方式。

1 个答案:

答案 0 :(得分:2)

我认为execCompleteEdit是您需要的功能。

@Order(10)
public class MyColumn extends AbstractStringColumn {

  @Override
  protected String getConfiguredHeaderText() {
    return "MyColumn";
  }

  @Override
  protected void execCompleteEdit(ITableRow row, IFormField editingField) {
    //Test if there is a new value:
    //compare getValue(row) and ((IStringField) editingField).getValue()

    //Call super to store the value to the cell (default behavior):
    super.execCompleteEdit(row, editingField);
  }
}
相关问题