@Override public List<BaseColumnFieldDiff> diff( BaseColumn otherColumn ) { if ( otherColumn == null ) { return null; } List<BaseColumnFieldDiff> result = super.diff( otherColumn ); ActionInsertFactFieldsPattern other = (ActionInsertFactFieldsPattern) otherColumn; // Field: isInsertedLogically. if ( this.isInsertedLogically() != other.isInsertedLogically() ) { result.add( new BaseColumnFieldDiffImpl( FIELD_IS_INSERTED_LOGICALLY, this.isInsertedLogically(), other.isInsertedLogically() ) ); } return result; }
@Override public void makeResult(final GuidedDecisionTable52 model) { //Copy actions to decision table model int fi = 1; for (Map.Entry<ActionInsertFactFieldsPattern, List<ActionInsertFactCol52>> ps : patternToActionsMap.entrySet()) { final ActionInsertFactFieldsPattern p = ps.getKey(); if (!getValidator().isPatternValid(p)) { String binding = NEW_FACT_PREFIX + (fi++); p.setBoundName(binding); while (!getValidator().isPatternBindingUnique(p)) { binding = NEW_FACT_PREFIX + (fi++); p.setBoundName(binding); } } final String factType = p.getFactType(); final String boundName = p.getBoundName(); final boolean isLogicalInsert = p.isInsertedLogically(); for (ActionInsertFactCol52 aif : ps.getValue()) { aif.setFactType(factType); aif.setBoundName(boundName); aif.setInsertLogical(isLogicalInsert); model.getActionCols().add(aif); } } }
@Override public void makeResult(final GuidedDecisionTable52 model) { //Copy actions to decision table model int fi = 1; for (Map.Entry<ActionInsertFactFieldsPattern, List<ActionInsertFactCol52>> ps : patternToActionsMap.entrySet()) { final ActionInsertFactFieldsPattern p = ps.getKey(); if (!getValidator().isPatternValid(p)) { String binding = NEW_FACT_PREFIX + (fi++); p.setBoundName(binding); while (!getValidator().isPatternBindingUnique(p)) { binding = NEW_FACT_PREFIX + (fi++); p.setBoundName(binding); } } final String factType = p.getFactType(); final String boundName = p.getBoundName(); final boolean isLogicalInsert = p.isInsertedLogically(); for (ActionInsertFactCol52 aif : ps.getValue()) { aif.setFactType(factType); aif.setBoundName(boundName); aif.setInsertLogical(isLogicalInsert); model.getActionCols().add(aif); } } }
private void chosenPatternsSelected( final Set<ActionInsertFactFieldsPattern> cps ) { btnRemoveFactTypes.setEnabled( cps.size() > 0 ); fieldDefinition.setVisible( false ); if ( cps.size() == 1 ) { chosenPatternsSelection = cps.iterator().next(); presenter.selectPattern( chosenPatternsSelection ); patternDefinition.setVisible( true ); validateBinding(); txtBinding.setEnabled( true ); txtBinding.setVisible( true ); txtBinding.setText( chosenPatternsSelection.getBoundName() ); chkLogicalInsert.setEnabled( true ); chkLogicalInsert.setVisible( true ); chkLogicalInsert.setValue( chosenPatternsSelection.isInsertedLogically() ); } else { chosenPatternsSelection = null; setAvailableFields( new ArrayList<AvailableField>() ); setChosenFields( new ArrayList<ActionInsertFactCol52>() ); patternDefinition.setVisible( false ); txtBinding.setEnabled( false ); txtBinding.setVisible( false ); txtBinding.setText( "" ); chkLogicalInsert.setEnabled( false ); chkLogicalInsert.setVisible( false ); } }
private void chosenPatternsSelected( final Set<ActionInsertFactFieldsPattern> cps ) { btnRemoveFactTypes.setEnabled( cps.size() > 0 ); fieldDefinition.setVisible( false ); if ( cps.size() == 1 ) { chosenPatternsSelection = cps.iterator().next(); presenter.selectPattern( chosenPatternsSelection ); patternDefinition.setVisible( true ); validateBinding(); txtBinding.setEnabled( true ); txtBinding.setVisible( true ); txtBinding.setText( chosenPatternsSelection.getBoundName() ); chkLogicalInsert.setEnabled( true ); chkLogicalInsert.setVisible( true ); chkLogicalInsert.setValue( chosenPatternsSelection.isInsertedLogically() ); } else { chosenPatternsSelection = null; setAvailableFields( new ArrayList<AvailableField>() ); setChosenFields( new ArrayList<ActionInsertFactCol52>() ); patternDefinition.setVisible( false ); txtBinding.setEnabled( false ); txtBinding.setVisible( false ); txtBinding.setText( "" ); chkLogicalInsert.setEnabled( false ); chkLogicalInsert.setVisible( false ); } }