@Test public void testDelete() throws VetoException { final BRLActionColumn column = new BRLActionColumn(); final BRLActionVariableColumn columnV0 = new BRLActionVariableColumn("$age", DataType.TYPE_NUMERIC_INTEGER, "Applicant", "age"); final BRLActionVariableColumn columnV1 = new BRLActionVariableColumn("$name", DataType.TYPE_STRING, "Applicant", "name"); column.getChildColumns().add(columnV0); column.getChildColumns().add(columnV1); column.setHeader("col1"); columnV0.setHeader("col1v0"); columnV1.setHeader("col1v1"); modelSynchronizer.appendColumn(column); assertEquals(5, model.getExpandedColumns().size()); assertEquals(1, model.getActionCols().size()); assertEquals(5, uiModel.getColumns().size()); modelSynchronizer.deleteColumn(column); assertEquals(3, model.getExpandedColumns().size()); assertEquals(0, model.getActionCols().size()); assertEquals(3, uiModel.getColumns().size()); }
@Override public void delete(final ColumnMetaData metaData) throws VetoException { if (!handlesDelete(metaData)) { return; } final BRLActionColumn column = (BRLActionColumn) metaData.getColumn(); if (column.getChildColumns().size() > 0) { final int iFirstColumnIndex = model.getExpandedColumns().indexOf(column.getChildColumns().get(0)); for (int iColumnIndex = 0; iColumnIndex < column.getChildColumns().size(); iColumnIndex++) { synchroniseDeleteColumn(iFirstColumnIndex); } } model.getActionCols().remove(column); }
BRLActionColumnSynchronizer extends BaseColumnSynchronizer<BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData> { @Override public void delete(final ColumnMetaData metaData) throws VetoException { if (!handlesDelete(metaData)) { return; } final BRLActionColumn column = (BRLActionColumn) metaData.getColumn(); if (column.getChildColumns().size() > 0) { final int iFirstColumnIndex = model.getExpandedColumns().indexOf(column.getChildColumns().get(0)); for (int iColumnIndex = 0; iColumnIndex < column.getChildColumns().size(); iColumnIndex++) { synchroniseDeleteColumn(iFirstColumnIndex); } } model.getActionCols().remove(column); } }
BRLActionColumnSynchronizer extends BaseColumnSynchronizer<BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData> { @Override public void delete(final ColumnMetaData metaData) throws VetoException { if (!handlesDelete(metaData)) { return; } final BRLActionColumn column = (BRLActionColumn) metaData.getColumn(); if (column.getChildColumns().size() > 0) { final int iFirstColumnIndex = model.getExpandedColumns().indexOf(column.getChildColumns().get(0)); for (int iColumnIndex = 0; iColumnIndex < column.getChildColumns().size(); iColumnIndex++) { synchroniseDeleteColumn(iFirstColumnIndex); } } model.getActionCols().remove(column); }  }
BRLActionColumnSynchronizer extends BaseColumnSynchronizer<BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData> { @Override public void delete(final ColumnMetaData metaData) throws VetoException { if (!handlesDelete(metaData)) { return; } final BRLActionColumn column = (BRLActionColumn) metaData.getColumn(); if (column.getChildColumns().size() > 0) { final int iFirstColumnIndex = model.getExpandedColumns().indexOf(column.getChildColumns().get(0)); for (int iColumnIndex = 0; iColumnIndex < column.getChildColumns().size(); iColumnIndex++) { synchroniseDeleteColumn(iFirstColumnIndex); } } model.getActionCols().remove(column); }  @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); }
BRLActionColumnSynchronizer extends BaseColumnSynchronizer<BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData> { @Override public void delete(final ColumnMetaData metaData) throws VetoException { if (!handlesDelete(metaData)) { return; } final BRLActionColumn column = (BRLActionColumn) metaData.getColumn(); if (column.getChildColumns().size() > 0) { final int iFirstColumnIndex = model.getExpandedColumns().indexOf(column.getChildColumns().get(0)); for (int iColumnIndex = 0; iColumnIndex < column.getChildColumns().size(); iColumnIndex++) { synchroniseDeleteColumn(iFirstColumnIndex); } } model.getActionCols().remove(column); }  @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);  }