Package org.drools.guvnor.client.widgets.decoratedgrid

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


        addColumn( modelColumn,
                   true );
    }

    public void appendRow() {
        DynamicDataRow row = makeNewRow();
        widget.appendRow( row );
        updateSystemControlledColumnValues();
        redrawSystemControlledColumns();
    }
View Full Code Here


    public void insertRowBefore(DynamicDataRow rowBefore) {
        if ( rowBefore == null ) {
            throw new IllegalArgumentException( "rowBefore cannot be null" );
        }

        DynamicDataRow newRow = makeNewRow();
        widget.insertRowBefore( rowBefore,
                                newRow );
        updateSystemControlledColumnValues();
        redrawSystemControlledColumns();
    }
View Full Code Here

        DynamicData data = widget.getData();
        List<DynamicColumn<DTColumnConfig>> columns = widget.getColumns();
        final int GRID_ROWS = data.size();
        String[][] grid = new String[GRID_ROWS][];
        for ( int iRow = 0; iRow < GRID_ROWS; iRow++ ) {
            DynamicDataRow dataRow = data.get( iRow );
            String[] row = new String[dataRow.size()];
            for ( int iCol = 0; iCol < columns.size(); iCol++ ) {
                CellValue< ? > cv = dataRow.get( iCol );
                DynamicColumn<DTColumnConfig> column = columns.get( iCol );
                String serialisedValue = cellValueFactory.serialiseValue( column.getModelColumn(),
                                                                          cv );
                row[iCol] = serialisedValue;
            }
View Full Code Here

        widget.getColumns().clear();

        // Dummy rows because the underlying DecoratedGridWidget expects there
        // to be enough rows to receive the columns data
        for ( int iRow = 0; iRow < model.getData().length; iRow++ ) {
            widget.getData().add( new DynamicDataRow() );
        }

        // Static columns, Row#
        int colIndex = 0;
        DTColumnConfig colStatic;
View Full Code Here

                 && isEqualOrNull( origColumn.getFactField(),
                                   editColumn.getFactField() )
                 && origColumn.getConstraintValueType() == editColumn.getConstraintValueType() ) {

                for ( int iRow = 0; iRow < widget.getData().size(); iRow++ ) {
                    DynamicDataRow row = widget.getData().get( iRow );
                    CellValue< ? > oldCell = row.get( origColIndex );
                    CellValue< ? > newCell = row.get( editColIndex );
                    newCell.setValue( oldCell.getValue() );
                }
            }

            // Delete old column and redraw
View Full Code Here

        return columnData;
    }

    // Construct a new row for insertion into a DecoratedGridWidget
    private DynamicDataRow makeNewRow() {
        DynamicDataRow row = new DynamicDataRow();
        List<DynamicColumn<DTColumnConfig>> columns = widget.getColumns();
        for ( int iCol = 0; iCol < columns.size(); iCol++ ) {
            DTColumnConfig col = columns.get( iCol ).getModelColumn();
            CellValue< ? extends Comparable< ? >> cv = cellValueFactory.getCellValue( col,
                                                                                      0,
                                                                                      iCol,
                                                                                      col.getDefaultValue() );
            row.add( cv );
        }
        return row;
    }
View Full Code Here

    private void updateCellsForDataType(final DTColumnConfig editColumn,
                                        final DynamicColumn<DTColumnConfig> column) {
        DynamicData data = widget.getData();
        column.setCell( cellFactory.getCell( editColumn ) );
        for ( int iRow = 0; iRow < data.size(); iRow++ ) {
            DynamicDataRow row = data.get( iRow );
            row.set( column.getColumnIndex(),
                     cellValueFactory.getCellValue( editColumn,
                                                    iRow,
                                                    column.getColumnIndex(),
                                                    null ) );
        }
View Full Code Here

        List<String> vals = Arrays.asList( model.getValueList( editColumn,
                                                               sce ) );
        column.setCell( cellFactory.getCell( editColumn ) );
        int iCol = column.getColumnIndex();
        for ( int iRow = 0; iRow < data.size(); iRow++ ) {
            DynamicDataRow row = data.get( iRow );
            if ( !vals.contains( row.get( iCol ).getValue() ) ) {
                row.get( iCol ).setValue( null );
                bRedrawRequired = true;
            }
        }
        return bRedrawRequired;
    }
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.widgets.decoratedgrid.DynamicDataRow

Copyright © 2018 www.massapicom. 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.