@Test public void testDelete() throws VetoException { final BRLConditionColumn column = new BRLConditionColumn(); final BRLConditionVariableColumn columnV0 = new BRLConditionVariableColumn("$age", DataType.TYPE_NUMERIC_INTEGER, "Applicant", "age"); final BRLConditionVariableColumn columnV1 = new BRLConditionVariableColumn("$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.getConditions().size()); assertEquals(5, uiModel.getColumns().size()); modelSynchronizer.deleteColumn(column); assertEquals(3, model.getExpandedColumns().size()); assertEquals(0, model.getConditions().size()); assertEquals(3, uiModel.getColumns().size()); }
@Override public void delete(final ColumnMetaData metaData) throws VetoException { if (!handlesDelete(metaData)) { return; } final BRLConditionColumn column = (BRLConditionColumn) metaData.getColumn(); final Set<String> bindings = getPatternBindings(column); for (String binding : bindings) { if (rm.isBoundFactUsed(binding)) { throw new VetoDeletePatternInUseException(); } } doDelete(column); }
BRLConditionColumnSynchronizer extends BaseColumnSynchronizer<BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData> { @Override public void delete(final ColumnMetaData metaData) throws VetoException { if (!handlesDelete(metaData)) { return; } final BRLConditionColumn column = (BRLConditionColumn) metaData.getColumn(); final Set<String> bindings = getPatternBindings(column); for (String binding : bindings) { if (rm.isBoundFactUsed(binding)) { throw new VetoDeletePatternInUseException(); } } doDelete(column); } }
BRLConditionColumnSynchronizer extends BaseColumnSynchronizer<BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData> { @Override public void delete(final ColumnMetaData metaData) throws VetoException { if (!handlesDelete(metaData)) { return; } final BRLConditionColumn column = (BRLConditionColumn) metaData.getColumn(); final Set<String> bindings = getPatternBindings(column); for (String binding : bindings) { if (rm.isBoundFactUsed(binding)) { throw new VetoDeletePatternInUseException(); } } doDelete(column); }  }
BRLConditionColumnSynchronizer extends BaseColumnSynchronizer<BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData> { @Override public void delete(final ColumnMetaData metaData) throws VetoException { if (!handlesDelete(metaData)) { return; } final BRLConditionColumn column = (BRLConditionColumn) metaData.getColumn(); final Set<String> bindings = getPatternBindings(column); for (String binding : bindings) { if (rm.isBoundFactUsed(binding)) { throw new VetoDeletePatternInUseException(); } } doDelete(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); }
BRLConditionColumnSynchronizer extends BaseColumnSynchronizer<BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData, BaseColumnSynchronizer.ColumnMetaData> { @Override public void delete(final ColumnMetaData metaData) throws VetoException { if (!handlesDelete(metaData)) { return; } final BRLConditionColumn column = (BRLConditionColumn) metaData.getColumn(); final Set<String> bindings = getPatternBindings(column); for (String binding : bindings) { if (rm.isBoundFactUsed(binding)) { throw new VetoDeletePatternInUseException(); } } doDelete(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);  }