class SubTableModelListener implements TableModelListener {

  @Override
  public void tableChanged(@NotNull TableModelEvent event) {
    int delegateColumnIndex = event.getColumn();

    if (delegateColumnIndex == TableModelEvent.ALL_COLUMNS) {
      myDelegate.tableChanged(new TableModelEvent(
        myModel,
        event.getFirstRow(),
        event.getLastRow(),
        TableModelEvent.ALL_COLUMNS,
        event.getType()));

      return;
    }

    if (!(myModel.getStartColumnSupplier().getAsInt() <= delegateColumnIndex &&
          delegateColumnIndex < myModel.getEndColumnSupplier().getAsInt())) {
      return;
    }

    myDelegate.tableChanged(new TableModelEvent(
      myModel,
      event.getFirstRow(),
      event.getLastRow(),
      myModel.convertColumnIndexToModel(delegateColumnIndex),
      event.getType()));
  }

    SubTableModelListener(@NotNull SubTableModel model, @NotNull TableModelListener delegate);

}