@Test public void testMoveBRLConditionBlockTo() throws VetoException { final CompositeColumn<BRLConditionVariableColumn> column1 = new BRLConditionColumn(); final BRLConditionVariableColumn column1v0 = new BRLConditionVariableColumn("$age", DataType.TYPE_NUMERIC_INTEGER, "Applicant", "age"); column1v0.setHeader("age"); final BRLConditionVariableColumn column1v1 = new BRLConditionVariableColumn("$name", DataType.TYPE_STRING, "Applicant", "name"); column1v1.setHeader("name"); column1.getChildColumns().add(column1v0); column1.getChildColumns().add(column1v1); final Pattern52 column2 = new Pattern52(); column2.setFactType("Address"); final ConditionCol52 column2v0 = new ConditionCol52(); column2v0.setBinding("$country"); column2v0.setFactField("country"); column2v0.setFieldType(DataType.TYPE_STRING); column2v0.setHeader("country"); modelSynchronizer.appendColumn(column1); modelSynchronizer.appendColumn(column2, column2v0); modelSynchronizer.appendRow(); uiModel.setCellValue(0, 3, new BaseGridCellValue<>(55)); uiModel.setCellValue(0, 4, new BaseGridCellValue<>("Smurf")); uiModel.setCellValue(0, 5, new BaseGridCellValue<>("Canada")); assertEquals(2, model.getConditions().size()); assertEquals(column1, model.getConditions().get(0)); assertEquals(column2, model.getConditions().get(1)); assertEquals(55, model.getData().get(0).get(3).getNumericValue()); assertEquals("Smurf", model.getData().get(0).get(4).getStringValue()); assertEquals("Canada", model.getData().get(0).get(5).getStringValue()); assertEquals(6, uiModel.getColumns().size()); final GridColumn<?> uiModelColumn1_1 = uiModel.getColumns().get(3); final GridColumn<?> uiModelColumn2_1 = uiModel.getColumns().get(4); final GridColumn<?> uiModelColumn3_1 = uiModel.getColumns().get(5); assertEquals("age", uiModelColumn1_1.getHeaderMetaData().get(0).getTitle()); assertEquals("name", uiModelColumn2_1.getHeaderMetaData().get(0).getTitle()); assertTrue(uiModelColumn1_1 instanceof IntegerUiColumn); assertTrue(uiModelColumn2_1 instanceof StringUiColumn); assertTrue(uiModelColumn3_1 instanceof StringUiColumn); assertEquals(3, uiModelColumn1_1.getIndex()); assertEquals(4, uiModelColumn2_1.getIndex()); assertEquals(5, uiModelColumn3_1.getIndex()); assertEquals(55, uiModel.getRow(0).getCells().get(uiModelColumn1_1.getIndex()).getValue().getValue()); assertEquals("Smurf", uiModel.getRow(0).getCells().get(uiModelColumn2_1.getIndex()).getValue().getValue()); assertEquals("Canada", uiModel.getRow(0).getCells().get(uiModelColumn3_1.getIndex()).getValue().getValue()); uiModel.moveColumnsTo(5, new ArrayList<GridColumn<?>>() {{ add(uiModelColumn1_1); add(uiModelColumn2_1); }} ); assertEquals(2, model.getConditions().size()); assertEquals(column2, model.getConditions().get(0)); assertEquals(column1, model.getConditions().get(1)); assertEquals("Canada", model.getData().get(0).get(3).getStringValue()); assertEquals(55, model.getData().get(0).get(4).getNumericValue()); assertEquals("Smurf", model.getData().get(0).get(5).getStringValue()); assertEquals(6, uiModel.getColumns().size()); final GridColumn<?> uiModelColumn1_2 = uiModel.getColumns().get(3); final GridColumn<?> uiModelColumn2_2 = uiModel.getColumns().get(4); final GridColumn<?> uiModelColumn3_2 = uiModel.getColumns().get(5); assertEquals("Address", uiModelColumn1_2.getHeaderMetaData().get(0).getTitle()); assertEquals("age", uiModelColumn2_2.getHeaderMetaData().get(0).getTitle()); assertEquals("name", uiModelColumn3_2.getHeaderMetaData().get(0).getTitle()); assertTrue(uiModelColumn1_2 instanceof StringUiColumn); assertTrue(uiModelColumn2_2 instanceof IntegerUiColumn); assertTrue(uiModelColumn3_2 instanceof StringUiColumn); assertEquals(5, uiModelColumn1_2.getIndex()); assertEquals(3, uiModelColumn2_2.getIndex()); assertEquals(4, uiModelColumn3_2.getIndex()); assertEquals("Canada", uiModel.getRow(0).getCells().get(uiModelColumn1_2.getIndex()).getValue().getValue()); assertEquals(55, uiModel.getRow(0).getCells().get(uiModelColumn2_2.getIndex()).getValue().getValue()); assertEquals("Smurf", uiModel.getRow(0).getCells().get(uiModelColumn3_2.getIndex()).getValue().getValue()); }
@Override public void moveColumnsTo(final List<MoveColumnToMetaData> metaData) throws VetoException { if (!handlesMoveColumnsTo(metaData)) { return; } if (isBRLFragment(metaData)) { doMoveBRLFragment(metaData); } else { throw new ModelSynchronizer.MoveVetoException(); } }
BRLConditionColumnSynchronizer extends BaseColumnSynchronizer<BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData> { @Override public void moveColumnsTo(final List<MoveColumnToMetaData> metaData) throws VetoException { if (!handlesMoveColumnsTo(metaData)) { return; } if (isBRLFragment(metaData)) { doMoveBRLFragment(metaData); } else { throw new ModelSynchronizer.MoveVetoException(); } } }
BRLConditionColumnSynchronizer extends BaseColumnSynchronizer<BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData> { @Override public void moveColumnsTo(final List<MoveColumnToMetaData> metaData) throws VetoException { if (!handlesMoveColumnsTo(metaData)) { return; } if (isBRLFragment(metaData)) { doMoveBRLFragment(metaData); } else { throw new ModelSynchronizer.MoveVetoException(); } }  }
BRLConditionColumnSynchronizer extends BaseColumnSynchronizer<BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData> { @Override public void moveColumnsTo(final List<MoveColumnToMetaData> metaData) throws VetoException { if (!handlesMoveColumnsTo(metaData)) { return; } if (isBRLFragment(metaData)) { doMoveBRLFragment(metaData); } else { throw new ModelSynchronizer.MoveVetoException(); } }  @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); }
BRLConditionColumnSynchronizer extends BaseColumnSynchronizer<BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData> { @Override public void moveColumnsTo(final List<MoveColumnToMetaData> metaData) throws VetoException { if (!handlesMoveColumnsTo(metaData)) { return; } if (isBRLFragment(metaData)) { doMoveBRLFragment(metaData); } else { throw new ModelSynchronizer.MoveVetoException(); } }  @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);  }