@Test public void columnResizingListenerSetup_ActionInsertFactColumn() { final ActionInsertFactCol52 column = new ActionInsertFactCol52(); column.setFactType("MyFact"); column.setFactField("MyField"); column.setHeader("MyColumn"); when(oracle.getFieldType("MyFact", "MyField")).thenReturn(DataType.TYPE_STRING); final GridColumn<?> uiColumn = factory.convertColumn(column, access, gridWidget); assertTrue(uiColumn instanceof BaseUiColumn); assertEquals((int) uiColumn.getWidth(), column.getWidth()); uiColumn.setWidth(200.0); assertEquals(200, column.getWidth()); }
@Override public GridColumn<?> convertColumn(final BaseColumn column, final GuidedDecisionTablePresenter.Access access, final GuidedDecisionTableView gridWidget) { for (BaseColumnConverter converter : converters) { if (converter.handles(column)) { final GridColumn<?> uiColumn = converter.convertColumn(column, access, gridWidget); if (uiColumn instanceof BaseUiColumn) { ((BaseUiColumn) uiColumn).setColumnResizeListener((double width) -> column.setWidth(((int) width))); } column.setWidth((int) uiColumn.getWidth()); return uiColumn; } } throw new IllegalArgumentException("Column '" + column.getHeader() + "' was not converted."); }
GridWidgetColumnFactoryImpl implements GridWidgetColumnFactory { @Override public GridColumn<?> convertColumn(final BaseColumn column, final GuidedDecisionTablePresenter.Access access, final GuidedDecisionTableView gridWidget) { for (BaseColumnConverter converter : converters) { if (converter.handles(column)) { final GridColumn<?> uiColumn = converter.convertColumn(column, access, gridWidget); if (uiColumn instanceof BaseUiColumn) { ((BaseUiColumn) uiColumn).setColumnResizeListener((double width) -> column.setWidth(((int) width))); } column.setWidth((int) uiColumn.getWidth()); return uiColumn; } } throw new IllegalArgumentException("Column '" + column.getHeader() + "' was not converted."); } }
GridWidgetColumnFactoryImpl implements GridWidgetColumnFactory { @Override public GridColumn<?> convertColumn(final BaseColumn column, final GuidedDecisionTablePresenter.Access access, final GuidedDecisionTableView gridWidget) { for (BaseColumnConverter converter : converters) { if (converter.handles(column)) { final GridColumn<?> uiColumn = converter.convertColumn(column, access, gridWidget); if (uiColumn instanceof BaseUiColumn) { ((BaseUiColumn) uiColumn).setColumnResizeListener((double width) -> column.setWidth(((int) width))); } column.setWidth((int) uiColumn.getWidth()); return uiColumn; } } throw new IllegalArgumentException("Column '" + column.getHeader() + "' was not converted."); }  }
GridWidgetColumnFactoryImpl implements GridWidgetColumnFactory { @Override public GridColumn<?> convertColumn(final BaseColumn column, final GuidedDecisionTablePresenter.Access access, final GuidedDecisionTableView gridWidget) { for (BaseColumnConverter converter : converters) { if (converter.handles(column)) { final GridColumn<?> uiColumn = converter.convertColumn(column, access, gridWidget); if (uiColumn instanceof BaseUiColumn) { ((BaseUiColumn) uiColumn).setColumnResizeListener((double width) -> column.setWidth(((int) width))); } column.setWidth((int) uiColumn.getWidth()); return uiColumn; } } throw new IllegalArgumentException("Column '" + column.getHeader() + "' was not converted."); }  @Override void setConverters(final List<BaseColumnConverter> converters); @Override void initialise(final GuidedDecisionTable52 model,
                           final AsyncPackageDataModelOracle oracle,
                           final ColumnUtilities columnUtilities,
                           final GuidedDecisionTableView.Presenter presenter); @Override GridColumn<?> convertColumn(final BaseColumn column,
                                       final GuidedDecisionTablePresenter.Access access,
                                       final GuidedDecisionTableView gridWidget); }
GridWidgetColumnFactoryImpl implements GridWidgetColumnFactory { @Override public GridColumn<?> convertColumn(final BaseColumn column, final GuidedDecisionTablePresenter.Access access, final GuidedDecisionTableView gridWidget) { for (BaseColumnConverter converter : converters) { if (converter.handles(column)) { final GridColumn<?> uiColumn = converter.convertColumn(column, access, gridWidget); if (uiColumn instanceof BaseUiColumn) { ((BaseUiColumn) uiColumn).setColumnResizeListener((double width) -> column.setWidth(((int) width))); } column.setWidth((int) uiColumn.getWidth()); return uiColumn; } } throw new IllegalArgumentException("Column '" + column.getHeader() + "' was not converted."); }  @Override void setConverters(final List<BaseColumnConverter> converters); @Override void initialise(final GuidedDecisionTable52 model,
                           final AsyncPackageDataModelOracle oracle,
                           final ColumnUtilities columnUtilities,
                           final GuidedDecisionTableView.Presenter presenter); @Override GridColumn<?> convertColumn(final BaseColumn column,
                                       final GuidedDecisionTablePresenter.Access access,
                                       final GuidedDecisionTableView gridWidget);  }