@Test public void testUpdate() throws VetoException { final LimitedEntryBRLConditionColumn column = new LimitedEntryBRLConditionColumn(); column.setHeader("col1"); modelSynchronizer.appendColumn(column); final LimitedEntryBRLConditionColumn edited = new LimitedEntryBRLConditionColumn(); edited.setHideColumn(true); edited.setHeader("updated"); modelSynchronizer.updateColumn(column, edited); assertEquals(1, model.getConditions().size()); assertEquals(4, uiModel.getColumns().size()); assertTrue(uiModel.getColumns().get(3) instanceof BooleanUiColumn); assertEquals("updated", uiModel.getColumns().get(3).getHeaderMetaData().get(0).getTitle()); assertEquals(false, uiModel.getColumns().get(3).isVisible()); }
@Override public List<BaseColumnFieldDiff> update(final ColumnMetaData originalMetaData, final ColumnMetaData editedMetaData) throws VetoException { if (!(handlesUpdate(originalMetaData) && handlesUpdate(editedMetaData))) { return Collections.emptyList(); } final LimitedEntryBRLConditionColumn originalColumn = (LimitedEntryBRLConditionColumn) originalMetaData.getColumn(); final LimitedEntryBRLConditionColumn editedColumn = (LimitedEntryBRLConditionColumn) editedMetaData.getColumn(); final List<BaseColumnFieldDiff> diffs = originalColumn.diff(editedColumn); update(originalColumn, editedColumn); final boolean isHideUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_HIDE_COLUMN, diffs); final boolean isHeaderUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_HIDE_COLUMN, diffs); if (isHideUpdated) { setColumnVisibility(originalColumn, originalColumn.isHideColumn()); } if (isHeaderUpdated) { setColumnHeader(originalColumn, originalColumn.getHeader()); } return diffs; }
LimitedEntryBRLConditionColumnSynchronizer extends BaseColumnSynchronizer<ColumnMetaData, ColumnMetaData, ColumnMetaData> { @Override public List<BaseColumnFieldDiff> update(final ColumnMetaData originalMetaData, final ColumnMetaData editedMetaData) throws VetoException { if (!(handlesUpdate(originalMetaData) && handlesUpdate(editedMetaData))) { return Collections.emptyList(); } final LimitedEntryBRLConditionColumn originalColumn = (LimitedEntryBRLConditionColumn) originalMetaData.getColumn(); final LimitedEntryBRLConditionColumn editedColumn = (LimitedEntryBRLConditionColumn) editedMetaData.getColumn(); final List<BaseColumnFieldDiff> diffs = originalColumn.diff(editedColumn); update(originalColumn, editedColumn); final boolean isHideUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_HIDE_COLUMN, diffs); final boolean isHeaderUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_HIDE_COLUMN, diffs); if (isHideUpdated) { setColumnVisibility(originalColumn, originalColumn.isHideColumn()); } if (isHeaderUpdated) { setColumnHeader(originalColumn, originalColumn.getHeader()); } return diffs; } }
LimitedEntryBRLConditionColumnSynchronizer extends BaseColumnSynchronizer<ColumnMetaData, ColumnMetaData, ColumnMetaData> { @Override public List<BaseColumnFieldDiff> update(final ColumnMetaData originalMetaData, final ColumnMetaData editedMetaData) throws VetoException { if (!(handlesUpdate(originalMetaData) && handlesUpdate(editedMetaData))) { return Collections.emptyList(); } final LimitedEntryBRLConditionColumn originalColumn = (LimitedEntryBRLConditionColumn) originalMetaData.getColumn(); final LimitedEntryBRLConditionColumn editedColumn = (LimitedEntryBRLConditionColumn) editedMetaData.getColumn(); final List<BaseColumnFieldDiff> diffs = originalColumn.diff(editedColumn); update(originalColumn, editedColumn); final boolean isHideUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_HIDE_COLUMN, diffs); final boolean isHeaderUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_HIDE_COLUMN, diffs); if (isHideUpdated) { setColumnVisibility(originalColumn, originalColumn.isHideColumn()); } if (isHeaderUpdated) { setColumnHeader(originalColumn, originalColumn.getHeader()); } return diffs; }  }
LimitedEntryBRLConditionColumnSynchronizer extends BaseColumnSynchronizer<ColumnMetaData, ColumnMetaData, ColumnMetaData> { @Override public List<BaseColumnFieldDiff> update(final ColumnMetaData originalMetaData, final ColumnMetaData editedMetaData) throws VetoException { if (!(handlesUpdate(originalMetaData) && handlesUpdate(editedMetaData))) { return Collections.emptyList(); } final LimitedEntryBRLConditionColumn originalColumn = (LimitedEntryBRLConditionColumn) originalMetaData.getColumn(); final LimitedEntryBRLConditionColumn editedColumn = (LimitedEntryBRLConditionColumn) editedMetaData.getColumn(); final List<BaseColumnFieldDiff> diffs = originalColumn.diff(editedColumn); update(originalColumn, editedColumn); final boolean isHideUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_HIDE_COLUMN, diffs); final boolean isHeaderUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_HIDE_COLUMN, diffs); if (isHideUpdated) { setColumnVisibility(originalColumn, originalColumn.isHideColumn()); } if (isHeaderUpdated) { setColumnHeader(originalColumn, originalColumn.getHeader()); } return diffs; }  @Override int priority(); @Override boolean handlesAppend(final MetaData metaData); @Override void append(final ColumnMetaData metaData); @Override boolean handlesUpdate(final MetaData metaData); @Override List<BaseColumnFieldDiff> update(final ColumnMetaData originalMetaData,
                                            final ColumnMetaData editedMetaData); @Override boolean handlesDelete(final MetaData metaData); @Override void delete(final ColumnMetaData metaData); @Override boolean handlesMoveColumnsTo(final List<? extends MetaData> metaData); @Override void moveColumnsTo(final List<MoveColumnToMetaData> metaData); }
LimitedEntryBRLConditionColumnSynchronizer extends BaseColumnSynchronizer<ColumnMetaData, ColumnMetaData, ColumnMetaData> { @Override public List<BaseColumnFieldDiff> update(final ColumnMetaData originalMetaData, final ColumnMetaData editedMetaData) throws VetoException { if (!(handlesUpdate(originalMetaData) && handlesUpdate(editedMetaData))) { return Collections.emptyList(); } final LimitedEntryBRLConditionColumn originalColumn = (LimitedEntryBRLConditionColumn) originalMetaData.getColumn(); final LimitedEntryBRLConditionColumn editedColumn = (LimitedEntryBRLConditionColumn) editedMetaData.getColumn(); final List<BaseColumnFieldDiff> diffs = originalColumn.diff(editedColumn); update(originalColumn, editedColumn); final boolean isHideUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_HIDE_COLUMN, diffs); final boolean isHeaderUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_HIDE_COLUMN, diffs); if (isHideUpdated) { setColumnVisibility(originalColumn, originalColumn.isHideColumn()); } if (isHeaderUpdated) { setColumnHeader(originalColumn, originalColumn.getHeader()); } return diffs; }  @Override int priority(); @Override boolean handlesAppend(final MetaData metaData); @Override void append(final ColumnMetaData metaData); @Override boolean handlesUpdate(final MetaData metaData); @Override List<BaseColumnFieldDiff> update(final ColumnMetaData originalMetaData,
                                            final ColumnMetaData editedMetaData); @Override boolean handlesDelete(final MetaData metaData); @Override void delete(final ColumnMetaData metaData); @Override boolean handlesMoveColumnsTo(final List<? extends MetaData> metaData); @Override void moveColumnsTo(final List<MoveColumnToMetaData> metaData);  }