private Set<String> getExistingAttributeNames() { final Set<String> existingAttributeNames = new HashSet<String>(); for (AttributeCol52 attributeCol : model.getAttributeCols()) { existingAttributeNames.add(attributeCol.getAttribute()); } return existingAttributeNames; }
private void validateAttributes() { for ( final AttributeCol52 attributeCol52 : dtable.getAttributeCols() ) { isValid( attributeCol52 ); } } }
@Override public void deleteColumn(final AttributeCol52 column) throws VetoException { doDeleteColumn(column, () -> refreshAttributesPanelEvent.fire(new RefreshAttributesPanelEvent(this, model.getAttributeCols()))); }
@Override public boolean hasColumnDefinitions() { final boolean hasAttributeCols = model.getAttributeCols().size() > 0; final boolean hasMetadataCols = model.getMetadataCols().size() > 0; final boolean hasConditionCols = model.getConditionsCount() > 0; final boolean hasActionCols = model.getActionCols().size() > 0; return hasAttributeCols || hasConditionCols || hasActionCols || hasMetadataCols; }
private void addAttributeCol( final AttributeCol52 attributeCol52 ) { final ArrayList<AttributeCol52> attributeCol52s = new ArrayList<>(); when( table.getAttributeCols() ).thenReturn( attributeCol52s ); attributeCol52s.add( attributeCol52 ); } }
@Override public void append(final ColumnMetaData metaData) throws VetoException { //Check operation is supported if (!handlesAppend(metaData)) { return; } final AttributeCol52 column = (AttributeCol52) metaData.getColumn(); model.getAttributeCols().add(column); synchroniseAppendColumn(column); }
@Override public void updateColumn(final AttributeCol52 originalColumn, final AttributeCol52 editedColumn) throws VetoException { doUpdateColumn(originalColumn, editedColumn, () -> synchronizer.updateColumn(originalColumn, editedColumn), () -> refreshAttributesPanelEvent.fire(new RefreshAttributesPanelEvent(this, model.getAttributeCols()))); }
@Override public void appendColumn(final AttributeCol52 column) { doAppendColumn(column, () -> synchronizer.appendColumn(column), () -> refreshAttributesPanelEvent.fire(new RefreshAttributesPanelEvent(this, model.getAttributeCols()))); }
@Override public void append(final ColumnMetaData metaData) throws VetoException { //Check operation is supported if (!handlesAppend(metaData)) { return; } final AttributeCol52 column = (AttributeCol52) metaData.getColumn(); model.getAttributeCols().add(column); synchroniseAppendColumn(column); }
void refreshColumnsPage() { refreshAttributesPanelEvent.fire(new RefreshAttributesPanelEvent(this, model.getAttributeCols())); refreshMetaDataPanelEvent.fire(new RefreshMetaDataPanelEvent(this, model.getMetadataCols())); refreshConditionsPanelEvent.fire(new RefreshConditionsPanelEvent(this, model.getConditions())); refreshActionsPanelEvent.fire(new RefreshActionsPanelEvent(this, model.getActionCols())); }
private void addActivationGroup( final String activationGroupType ) { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( GuidedDecisionTable52.ACTIVATION_GROUP_ATTR ); dtable.getAttributeCols() .add( attributeCol52 ); final int columnIndex = dtable.getExpandedColumns() .indexOf( attributeCol52 ); for ( final List<DTCellValue52> row : dtable.getData() ) { row.add( columnIndex, new DTCellValue52( activationGroupType + " " + dtable.getTableName() ) ); } } }
void refreshColumnsPage() { refreshAttributesPanelEvent.fire(new RefreshAttributesPanelEvent(this, model.getAttributeCols())); refreshMetaDataPanelEvent.fire(new RefreshMetaDataPanelEvent(this, model.getMetadataCols())); refreshConditionsPanelEvent.fire(new RefreshConditionsPanelEvent(this, model.getConditions())); refreshActionsPanelEvent.fire(new RefreshActionsPanelEvent(this, model.getActionCols())); }
public void isValidToAdd( final AttributeCol52 attributeCol52 ) { isValid( attributeCol52 ); for ( final AttributeCol52 existingAttributeCol52 : dtable.getAttributeCols() ) { if ( attributeCol52.getAttribute() .equals( existingAttributeCol52.getAttribute() ) ) { throw new DuplicateAttributeException( existingAttributeCol52.getAttribute() ); } } }
public void refresh() { getGuidedDecisionTable52().ifPresent(model -> { refreshAttributeWidget(model.getAttributeCols()); refreshMetaDataWidget(model.getMetadataCols()); refreshConditionsWidget(model.getConditions()); refreshActionsWidget(model.getActionCols()); }); }
@Test(expected = IllegalArgumentException.class) public void blockUseOfSalience() { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( "salience" ); attributeCol52.setDefaultValue( new DTCellValue52( "123" ) ); dtable.getAttributeCols() .add( attributeCol52 ); GuidedDTDRLPersistence.getInstance() .marshal( dtable ); }
@Test(expected = IllegalArgumentException.class) public void blockUseOfSalience() { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( "salience" ); attributeCol52.setDefaultValue( new DTCellValue52( "123" ) ); dtable.getAttributeCols() .add( attributeCol52 ); GuidedDTDRLPersistence.getInstance() .marshal( dtable ); }
@Test(expected = IllegalArgumentException.class) public void blockUseOfActivationGroup() { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( "activation-group" ); attributeCol52.setDefaultValue( new DTCellValue52( "test" ) ); dtable.getAttributeCols() .add( attributeCol52 ); GuidedDTDRLPersistence.getInstance() .marshal( dtable ); }
@Test(expected = IllegalArgumentException.class) public void blockUseOfActivationGroup() { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( "activation-group" ); attributeCol52.setDefaultValue( new DTCellValue52( "test" ) ); dtable.getAttributeCols() .add( attributeCol52 ); GuidedDTDRLPersistence.getInstance() .marshal( dtable ); }
@Test(expected = IllegalArgumentException.class) public void blockUseOfActivationGroup() { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( "activation-group" ); attributeCol52.setDefaultValue( new DTCellValue52( "test" ) ); dtable.getAttributeCols() .add( attributeCol52 ); GuidedDTDRLPersistence.getInstance() .marshal( dtable ); }
@Test(expected = IllegalArgumentException.class) public void blockUseOfSalience() { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( "salience" ); attributeCol52.setDefaultValue( new DTCellValue52( "123" ) ); dtable.getAttributeCols() .add( attributeCol52 ); GuidedDTDRLPersistence.getInstance() .marshal( dtable ); }