Search in sources :

Example 1 with MetaData

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

the class ModelSynchronizerImpl method insertRow.

@Override
public void insertRow(final int rowIndex) throws VetoException {
    final MetaData metaData = new RowSynchronizer.RowMetaDataImpl(rowIndex);
    for (Synchronizer synchronizer : synchronizers) {
        if (synchronizer.handlesInsert(metaData)) {
            synchronizer.insert(metaData);
            break;
        }
    }
    fireInsertRowEvent(rowIndex);
    systemControlledColumnValuesSynchronizer.insertRow(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)

Example 2 with MetaData

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

the class ModelSynchronizerImpl method appendRow.

@Override
@SuppressWarnings("unchecked")
public void appendRow() throws VetoException {
    final MetaData metaData = new RowSynchronizer.RowMetaDataImpl();
    for (Synchronizer synchronizer : synchronizers) {
        if (synchronizer.handlesAppend(metaData)) {
            synchronizer.append(metaData);
            break;
        }
    }
    fireAppendRowEvent();
    systemControlledColumnValuesSynchronizer.appendRow();
    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)

Example 3 with MetaData

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

the class ModelSynchronizerImpl method appendColumn.

@Override
@SuppressWarnings("unchecked")
public void appendColumn(final BaseColumn column) throws VetoException {
    final MetaData metaData = new BaseColumnSynchronizer.ColumnMetaDataImpl(column);
    for (Synchronizer synchronizer : synchronizers) {
        if (synchronizer.handlesAppend(metaData)) {
            synchronizer.append(metaData);
            break;
        }
    }
    fireAfterColumnInsertedEvent(column);
}
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 4 with MetaData

use of org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BaseColumnSynchronizer.MetaData 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 5 with MetaData

use of org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BaseColumnSynchronizer.MetaData 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)

Aggregations

ModelSynchronizer (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.ModelSynchronizer)6 Synchronizer (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.Synchronizer)6 MetaData (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BaseColumnSynchronizer.MetaData)6 MoveColumnToMetaData (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.MoveColumnToMetaData)6 MoveRowToMetaData (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.MoveRowToMetaData)6 PatternConditionMetaData (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer.PatternConditionMetaData)6 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)1