Search in sources :

Example 11 with Synchronizer

use of org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.Synchronizer in project drools-wb by kiegroup.

the class ModelSynchronizerImpl method updateColumn.

@Override
@SuppressWarnings("unchecked")
public List<BaseColumnFieldDiff> updateColumn(final BaseColumn originalColumn, final BaseColumn editedColumn) throws VetoException {
    final MetaData originalMetaData = new BaseColumnSynchronizer.ColumnMetaDataImpl(originalColumn);
    final MetaData editedMetaData = new BaseColumnSynchronizer.ColumnMetaDataImpl(editedColumn);
    for (Synchronizer synchronizer : synchronizers) {
        if (synchronizer.handlesUpdate(originalMetaData)) {
            final List<BaseColumnFieldDiff> diffs = synchronizer.update(originalMetaData, editedMetaData);
            final boolean isSalienceUseRowNumberUpdated = BaseColumnFieldDiffImpl.hasChanged(AttributeCol52.FIELD_USE_ROW_NUMBER, diffs);
            final boolean isSalienceUseReverseOrderUpdated = BaseColumnFieldDiffImpl.hasChanged(AttributeCol52.FIELD_REVERSE_ORDER, diffs);
            if (isSalienceUseRowNumberUpdated || isSalienceUseReverseOrderUpdated) {
                systemControlledColumnValuesSynchronizer.updateSystemControlledColumnValues();
            }
            return diffs;
        }
    }
    return Collections.emptyList();
}
Also used : Synchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.Synchronizer) ModelSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.ModelSynchronizer) PatternConditionMetaData(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.PatternConditionMetaData) MoveRowToMetaData(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.MoveRowToMetaData) MetaData(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BaseColumnSynchronizer.MetaData) MoveColumnToMetaData(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.MoveColumnToMetaData) BaseColumnFieldDiff(org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)

Example 12 with Synchronizer

use of org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.Synchronizer in project drools-wb by kiegroup.

the class ModelSynchronizerImpl method deleteColumn.

@Override
@SuppressWarnings("unchecked")
public void deleteColumn(final BaseColumn column) throws VetoException {
    final int columnIndex = model.getExpandedColumns().indexOf(column);
    final MetaData metaData = new BaseColumnSynchronizer.ColumnMetaDataImpl(column);
    for (Synchronizer synchronizer : synchronizers) {
        if (synchronizer.handlesDelete(metaData)) {
            synchronizer.delete(metaData);
            break;
        }
    }
    fireAfterColumnDeletedEvent(columnIndex);
}
Also used : Synchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.Synchronizer) ModelSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.ModelSynchronizer) PatternConditionMetaData(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.PatternConditionMetaData) MoveRowToMetaData(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.MoveRowToMetaData) MetaData(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BaseColumnSynchronizer.MetaData) MoveColumnToMetaData(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.MoveColumnToMetaData)

Example 13 with Synchronizer

use of org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.Synchronizer in project drools-wb by kiegroup.

the class ModelSynchronizerImpl method deleteRow.

@Override
@SuppressWarnings("unchecked")
public void deleteRow(final int rowIndex) throws VetoException {
    final MetaData metaData = new RowSynchronizer.RowMetaDataImpl(rowIndex);
    for (Synchronizer synchronizer : synchronizers) {
        if (synchronizer.handlesDelete(metaData)) {
            synchronizer.delete(metaData);
            break;
        }
    }
    fireDeleteRowEvent(rowIndex);
    systemControlledColumnValuesSynchronizer.deleteRow(rowIndex);
    fireUpdateColumnDataEvent();
}
Also used : Synchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.Synchronizer) ModelSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.ModelSynchronizer) PatternConditionMetaData(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.PatternConditionMetaData) MoveRowToMetaData(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.MoveRowToMetaData) MetaData(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BaseColumnSynchronizer.MetaData) MoveColumnToMetaData(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.MoveColumnToMetaData)

Aggregations

Synchronizer (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.Synchronizer)13 ModelSynchronizer (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.ModelSynchronizer)12 MoveColumnToMetaData (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.MoveColumnToMetaData)8 PatternConditionMetaData (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.PatternConditionMetaData)8 MoveRowToMetaData (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.MoveRowToMetaData)7 MetaData (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BaseColumnSynchronizer.MetaData)6 ArrayList (java.util.ArrayList)4 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)2 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)2 BaseColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.BaseColumnConverter)2 MoveColumnToMetaDataImpl (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.MoveColumnToMetaDataImpl)2 EventBus (com.google.gwt.event.shared.EventBus)1 AbsolutePanel (com.google.gwt.user.client.ui.AbsolutePanel)1 Iterator (java.util.Iterator)1 Set (java.util.Set)1 PortableWorkDefinition (org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition)1 BRLRuleModel (org.drools.workbench.models.guided.dtable.shared.model.BRLRuleModel)1 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)1 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)1 DescriptionCol52 (org.drools.workbench.models.guided.dtable.shared.model.DescriptionCol52)1