}
deleteColumn( origColumnIndex,
true );
//Log change to column definition
model.getAuditLog().add( new UpdateColumnAuditLogEntry( identity.getName(),
origColumn,
editColumn ) );
} else {
boolean isHideUpdated = false;
boolean isOperatorUpdated = false;
boolean isFieldTypeUpdated = false;
boolean isFactFieldUpdated = false;
boolean isFactTypeUpdated = false;
boolean isConstraintValueTypeUpdated = false;
boolean isValueListUpdated = false;
List<BaseColumnFieldDiff> diffs = origColumn.diff(editColumn);
if (diffs != null && !diffs.isEmpty()) {
bUpdateColumnDefinition = true;
isHideUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_HIDE_COLUMN, diffs);
isOperatorUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_OPERATOR, diffs);
isFieldTypeUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_FIELD_TYPE, diffs);
isFactFieldUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_FACT_FIELD, diffs);
isFactTypeUpdated = BaseColumnFieldDiffImpl.hasChanged(Pattern52.FIELD_FACT_TYPE, diffs);
isConstraintValueTypeUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_VALUE_LIST, diffs);
isValueListUpdated = BaseColumnFieldDiffImpl.hasChanged(ConditionCol52.FIELD_VALUE_LIST, diffs);
}
// Update column's visibility
if ( isHideUpdated ) {
setColumnVisibility( origColumn,
!editColumn.isHideColumn() );
}
//Clear otherwise if column cannot accept them
if ( isOperatorUpdated && !canAcceptOtherwiseValues( editColumn ) ) {
removeOtherwiseStates( origColumn );
bUpdateColumnData = true;
}
// Update column's Cell type. Other than the obvious change in data-type if the
// Operator changes to or from "not set" (possible for literal columns and formulae)
// the column needs to be changed to or from Text.
if ( isFactTypeUpdated || isFactFieldUpdated || isFieldTypeUpdated || isOperatorUpdated || isConstraintValueTypeUpdated ) {
bUpdateColumnData = true;
}
// Update column's cell content if the Optional Value list has changed
if ( isValueListUpdated ) {
bUpdateColumnData = updateCellsForOptionValueList( editColumn,
origColumn );
}
if ( origColumn.isBound() && editColumn.isBound() && !origColumn.getBinding().equals( editColumn.getBinding() ) ) {
bUpdateColumnDefinition = true;
}
//Log change to column definition
if ( bUpdateColumnDefinition ) {
model.getAuditLog().add( new UpdateColumnAuditLogEntry( identity.getName(),
origColumn,
editColumn, diffs ) );
}
// Copy new values into original column definition