Examples of DynamicDataRow


Examples of org.drools.guvnor.client.widgets.drools.decoratedgrid.data.DynamicDataRow

        }

        //Redraw replacement rows
        for ( int iRow = startRedrawIndex; iRow <= endRedrawIndex; iRow++ ) {

            DynamicDataRow rowData = data.get( iRow );

            TableRowElement tre = Document.get().createTRElement();
            populateTableRowElement( tre,
                                     rowData );
            tbody.replaceChild( tre,
View Full Code Here

Examples of org.drools.guvnor.client.widgets.drools.decoratedgrid.data.DynamicDataRow

        if ( index > columns.size() ) {
            throw new IllegalArgumentException( "index cannot be greater than the number of rows" );
        }

        for ( int iRow = 0; iRow < data.size(); iRow++ ) {
            DynamicDataRow rowData = data.get( iRow );
            CellValue< ? extends Comparable< ? >> cell = rowData.get( index );

            if ( cell.getRowSpan() > 0 ) {
                Coordinate hc = cell.getHtmlCoordinate();
                TableRowElement tre = tbody.getRows().getItem( hc.getRow() );
                TableCellElement tce = tre.getCells().getItem( hc.getCol() );
View Full Code Here

Examples of org.drools.guvnor.client.widgets.drools.decoratedgrid.data.DynamicDataRow

        if ( index > columns.size() ) {
            throw new IllegalArgumentException( "index cannot be greater than the number of rows" );
        }

        for ( int iRow = 0; iRow < data.size(); iRow++ ) {
            DynamicDataRow rowData = data.get( iRow );
            TableCellElement tce = makeTableCellElement( index,
                                                         rowData );
            if ( tce != null ) {

                CellValue< ? extends Comparable< ? >> cell = rowData.get( index );
                Coordinate hc = cell.getHtmlCoordinate();

                TableRowElement tre = tbody.getRows().getItem( hc.getRow() );
                TableCellElement ntce = tre.insertCell( hc.getCol() );
                tre.replaceChild( tce,
View Full Code Here

Examples of org.drools.guvnor.client.widgets.drools.decoratedgrid.data.DynamicDataRow

     * @param cell
     * @return
     */
    @Override
    public DynamicDataRow makeUIRowData() {
        DynamicDataRow data = new DynamicDataRow();
        InterpolationVariable[] variables = model.getInterpolationVariablesList();
        for ( InterpolationVariable var : variables ) {
            TemplateDataColumn column = makeModelColumn( var );
            String dcv = makeModelCellValue( column );
            CellValue< ? extends Comparable< ? >> cell = convertModelCellValue( column,
                                                                                dcv );
            data.add( cell );
        }

        return data;
    }
View Full Code Here

Examples of org.drools.guvnor.client.widgets.drools.decoratedgrid.data.DynamicDataRow

        data.addRow( makeRow() );

    }

    protected DynamicDataRow makeRow() {
        DynamicDataRow row = new DynamicDataRow();
        for ( CellValue< ? > cell : makeCellValueList() ) {
            row.add( cell );
        }
        return row;
    }
View Full Code Here

Examples of org.kie.workbench.common.widgets.decoratedgrid.client.widget.data.DynamicDataRow

     * Construct a new row of data for the MergableGridWidget
     * @return
     */
    @Override
    public DynamicDataRow makeUIRowData() {
        DynamicDataRow data = new DynamicDataRow();
        List<BaseColumn> columns = model.getExpandedColumns();
        for ( BaseColumn column : columns ) {
            DTCellValue52 dcv = makeModelCellValue( column );
            DataType.DataTypes dataType = utilities.getDataType( column );
            utilities.assertDTCellValue( dataType,
                                         dcv );
            CellValue<? extends Comparable<?>> cell = convertModelCellValue( column,
                                                                             dcv );
            data.add( cell );
        }

        return data;
    }
View Full Code Here

Examples of org.kie.workbench.common.widgets.decoratedgrid.client.widget.data.DynamicDataRow

     * Construct a new row of data for the MergableGridWidget
     * @return
     */
    @Override
    public DynamicDataRow makeUIRowData() {
        DynamicDataRow data = new DynamicDataRow();
        InterpolationVariable[] variables = model.getInterpolationVariablesList();
        for ( InterpolationVariable var : variables ) {
            TemplateDataColumn column = makeModelColumn( var );
            String dcv = makeModelCellValue( column );
            CellValue<? extends Comparable<?>> cell = convertModelCellValue( column,
                                                                             dcv );
            data.add( cell );
        }

        return data;
    }
View Full Code Here

Examples of org.kie.workbench.common.widgets.decoratedgrid.client.widget.data.DynamicDataRow

     * Construct a new row of data for the MergableGridWidget
     * @return
     */
    @Override
    public DynamicDataRow makeUIRowData() {
        DynamicDataRow data = new DynamicDataRow();
        InterpolationVariable[] variables = model.getInterpolationVariablesList();
        for ( InterpolationVariable var : variables ) {
            TemplateDataColumn column = makeModelColumn( var );
            String dcv = makeModelCellValue( column );
            CellValue<? extends Comparable<?>> cell = convertModelCellValue( column,
                                                                             dcv );
            data.add( cell );
        }

        return data;
    }
View Full Code Here

Examples of org.kie.workbench.common.widgets.decoratedgrid.client.widget.data.DynamicDataRow

     * Construct a new row of data for the MergableGridWidget
     * @return
     */
    @Override
    public DynamicDataRow makeUIRowData() {
        DynamicDataRow data = new DynamicDataRow();
        List<BaseColumn> columns = model.getExpandedColumns();
        for ( BaseColumn column : columns ) {
            DTCellValue52 dcv = makeModelCellValue( column );
            DataType.DataTypes dataType = utilities.getDataType( column );
            utilities.assertDTCellValue( dataType,
                                         dcv );
            CellValue<? extends Comparable<?>> cell = convertModelCellValue( column,
                                                                             dcv );
            data.add( cell );
        }

        return data;
    }
View Full Code Here

Examples of org.kie.workbench.common.widgets.decoratedgrid.client.widget.data.DynamicDataRow

    public Map<String, String> getCurrentValueMap( Context context ) {
        Map<String, String> currentValueMap = new HashMap<String, String>();

        final int iBaseRowIndex = context.getIndex();
        final int iBaseColIndex = context.getColumn();
        final DynamicDataRow rowData = this.data.get( iBaseRowIndex );

        //Get the column for the cell being edited
        List<BaseColumn> allColumns = this.model.getExpandedColumns();
        BaseColumn baseColumn = allColumns.get( iBaseColIndex );

        //Get values for all Constraints or Actions on the same pattern as the baseColumn
        if ( baseColumn instanceof BRLConditionVariableColumn ) {
            final BRLConditionVariableColumn baseBRLConditionColumn = (BRLConditionVariableColumn) baseColumn;
            final BRLConditionColumn brl = model.getBRLColumn( baseBRLConditionColumn );
            final RuleModel rm = new RuleModel();
            IPattern[] lhs = new IPattern[ brl.getDefinition().size() ];
            brl.getDefinition().toArray( lhs );
            rm.lhs = lhs;

            final RuleModelPeerVariableVisitor peerVariableVisitor = new RuleModelPeerVariableVisitor( rm,
                                                                                                       baseBRLConditionColumn.getVarName() );
            List<RuleModelPeerVariableVisitor.ValueHolder> peerVariables = peerVariableVisitor.getPeerVariables();

            //Add other variables values
            for ( ValueHolder valueHolder : peerVariables ) {
                switch ( valueHolder.getType() ) {
                    case TEMPLATE_KEY:
                        final BRLConditionVariableColumn vc = getConditionVariableColumnIndex( brl.getChildColumns(),
                                                                                               valueHolder.getValue() );
                        final int iCol = model.getExpandedColumns().indexOf( vc );
                        final CellValue<?> cv = this.data.get( iBaseRowIndex ).get( iCol );
                        final String field = vc.getFactField();
                        final String value = getValue( vc,
                                                       cv );
                        currentValueMap.put( field,
                                             value );
                        break;
                    case VALUE:
                        currentValueMap.put( valueHolder.getFieldName(),
                                             valueHolder.getValue() );
                }
            }

        } else if ( baseColumn instanceof BRLActionVariableColumn ) {
            final BRLActionVariableColumn baseBRLActionColumn = (BRLActionVariableColumn) baseColumn;
            final BRLActionColumn brl = model.getBRLColumn( baseBRLActionColumn );
            final RuleModel rm = new RuleModel();
            IAction[] rhs = new IAction[ brl.getDefinition().size() ];
            brl.getDefinition().toArray( rhs );
            rm.rhs = rhs;

            final RuleModelPeerVariableVisitor peerVariableVisitor = new RuleModelPeerVariableVisitor( rm,
                                                                                                       baseBRLActionColumn.getVarName() );
            List<ValueHolder> peerVariables = peerVariableVisitor.getPeerVariables();

            //Add other variables values
            for ( ValueHolder valueHolder : peerVariables ) {
                switch ( valueHolder.getType() ) {
                    case TEMPLATE_KEY:
                        final BRLActionVariableColumn vc = getActionVariableColumnIndex( brl.getChildColumns(),
                                                                                         valueHolder.getValue() );
                        final int iCol = model.getExpandedColumns().indexOf( vc );
                        final CellValue<?> cv = this.data.get( iBaseRowIndex ).get( iCol );
                        final String field = vc.getFactField();
                        final String value = getValue( vc,
                                                       cv );
                        currentValueMap.put( field,
                                             value );
                        break;
                    case VALUE:
                        currentValueMap.put( valueHolder.getFieldName(),
                                             valueHolder.getValue() );
                }
            }

        } else if ( baseColumn instanceof ConditionCol52 ) {
            final ConditionCol52 baseConditionColumn = (ConditionCol52) baseColumn;
            final Pattern52 basePattern = this.model.getPattern( baseConditionColumn );
            for ( ConditionCol52 cc : basePattern.getChildColumns() ) {
                final int iCol = allColumns.indexOf( cc );
                currentValueMap.put( cc.getFactField(),
                                     getValue( cc,
                                               rowData.get( iCol ) ) );
            }

        } else if ( baseColumn instanceof ActionSetFieldCol52 ) {
            ActionSetFieldCol52 baseActionColumn = (ActionSetFieldCol52) baseColumn;
            final String binding = baseActionColumn.getBoundName();
            for ( ActionCol52 ac : this.model.getActionCols() ) {
                if ( ac instanceof ActionSetFieldCol52 ) {
                    final ActionSetFieldCol52 asf = (ActionSetFieldCol52) ac;
                    if ( asf.getBoundName().equals( binding ) ) {
                        final int iCol = allColumns.indexOf( asf );
                        currentValueMap.put( asf.getFactField(),
                                             getValue( asf,
                                                       rowData.get( iCol ) ) );
                    }
                }
            }

        } else if ( baseColumn instanceof ActionInsertFactCol52 ) {
            ActionInsertFactCol52 baseActionColumn = (ActionInsertFactCol52) baseColumn;
            final String binding = baseActionColumn.getBoundName();
            for ( ActionCol52 ac : this.model.getActionCols() ) {
                if ( ac instanceof ActionInsertFactCol52 ) {
                    final ActionInsertFactCol52 aif = (ActionInsertFactCol52) ac;
                    if ( aif.getBoundName().equals( binding ) ) {
                        final int iCol = allColumns.indexOf( aif );
                        currentValueMap.put( aif.getFactField(),
                                             getValue( aif,
                                                       rowData.get( iCol ) ) );
                    }
                }
            }

        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.