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

Examples of org.drools.guvnor.client.widgets.decoratedgrid.CellValue.GroupedCellValue


    @SuppressWarnings({"unchecked", "rawtypes"})
    boolean addChildRow(DynamicDataRow childRow) {
        for ( int iCol = 0; iCol < childRow.size(); iCol++ ) {
            if ( this.get( iCol ) instanceof GroupedCellValue ) {
                GroupedCellValue gcv = (GroupedCellValue) this.get( iCol );
                gcv.addCellToGroup( childRow.get( iCol ) );
            }
        }
        return this.groupedRows.add( childRow );
    }
View Full Code Here


    @SuppressWarnings({"unchecked", "rawtypes"})
    boolean addChildRow(DynamicDataRow childRow) {
        for ( int iCol = 0; iCol < childRow.size(); iCol++ ) {
            if ( this.get( iCol ) instanceof GroupedCellValue ) {
                GroupedCellValue gcv = (GroupedCellValue) this.get( iCol );
                gcv.addCellToGroup( childRow.get( iCol ) );
            }
        }
        return this.groupedRows.add( childRow );
    }
View Full Code Here

            //Styling depending upon state
            if ( cellData.isOtherwise() ) {
                tce.addClassName( style.cellTableCellOtherwise() );
            }
            if ( cellData instanceof GroupedCellValue ) {
                GroupedCellValue gcv = (GroupedCellValue) cellData;
                if ( gcv.hasMultipleValues() ) {
                    tce.addClassName( style.cellTableCellMultipleValues() );
                }
            }
            if ( cellData.isSelected() ) {
                tce.removeClassName( style.cellTableCellMultipleValues() );
View Full Code Here

        int startRowIndex = startCell.getCoordinate().getRow();
        int endRowIndex = findMergedCellExtent( startCell.getCoordinate() ).getRow();
        int colIndex = startCell.getCoordinate().getCol();

        //Delete grouped rows replacing with a single "grouped" row
        GroupedCellValue groupedCell;
        DynamicDataRow row = data.get( startRowIndex );
        GroupedDynamicDataRow groupedRow = new GroupedDynamicDataRow();
        for ( int iCol = 0; iCol < row.size(); iCol++ ) {
            groupedCell = row.get( iCol ).convertToGroupedCell();
            if ( iCol == colIndex ) {
                groupedCell.addState( CellState.GROUPED );
            } else {
                groupedCell.removeState( CellState.GROUPED );
            }
            groupedRow.add( groupedCell );
        }

        //Add individual cells to "grouped" row
View Full Code Here

            //Re-apply applicable styling
            if ( cell.isOtherwise() ) {
                tce.addClassName( cellOtherwiseStyle );
            }
            if ( cell instanceof GroupedCellValue ) {
                GroupedCellValue gcv = (GroupedCellValue) cell;
                if ( gcv.hasMultipleValues() ) {
                    tce.addClassName( cellMultipleValuesStyle );
                }
            }
        }
    }
View Full Code Here

                    boolean bSplit = true;
                    if ( !cell1.isEmpty() && !cell2.isEmpty() ) {
                        if ( cell1.getValue().equals( cell2.getValue() ) ) {
                            bSplit = false;
                            if ( cell1 instanceof GroupedCellValue ) {
                                GroupedCellValue gcv = (GroupedCellValue) cell1;
                                if ( gcv.hasMultipleValues() ) {
                                    bSplit = true;
                                }
                            }
                            if ( cell2 instanceof GroupedCellValue ) {
                                GroupedCellValue gcv = (GroupedCellValue) cell2;
                                if ( gcv.hasMultipleValues() ) {
                                    bSplit = true;
                                }
                            }
                        }
                    } else if ( cell1.isOtherwise() && cell2.isOtherwise() ) {
                        bSplit = false;
                        if ( cell1 instanceof GroupedCellValue ) {
                            GroupedCellValue gcv = (GroupedCellValue) cell1;
                            if ( gcv.hasMultipleValues() ) {
                                bSplit = true;
                            }
                        }
                        if ( cell2 instanceof GroupedCellValue ) {
                            GroupedCellValue gcv = (GroupedCellValue) cell2;
                            if ( gcv.hasMultipleValues() ) {
                                bSplit = true;
                            }
                        }
                    }
View Full Code Here

        int startRowIndex = startCell.getCoordinate().getRow();
        int endRowIndex = findMergedCellExtent( startCell.getCoordinate() ).getRow();
        int colIndex = startCell.getCoordinate().getCol();

        //Delete grouped rows replacing with a single "grouped" row
        GroupedCellValue groupedCell;
        DynamicDataRow row = data.get( startRowIndex );
        GroupedDynamicDataRow groupedRow = new GroupedDynamicDataRow();
        for ( int iCol = 0; iCol < row.size(); iCol++ ) {
            groupedCell = row.get( iCol ).convertToGroupedCell();
            if ( iCol == colIndex ) {
                groupedCell.addState( CellState.GROUPED );
            } else {
                groupedCell.removeState( CellState.GROUPED );
            }
            groupedRow.add( groupedCell );
        }

        //Add individual cells to "grouped" row
View Full Code Here

                    boolean bSplit = true;
                    if ( !cell1.isEmpty() && !cell2.isEmpty() ) {
                        if ( cell1.getValue().equals( cell2.getValue() ) ) {
                            bSplit = false;
                            if ( cell1 instanceof GroupedCellValue ) {
                                GroupedCellValue gcv = (GroupedCellValue) cell1;
                                if ( gcv.hasMultipleValues() ) {
                                    bSplit = true;
                                }
                            }
                            if ( cell2 instanceof GroupedCellValue ) {
                                GroupedCellValue gcv = (GroupedCellValue) cell2;
                                if ( gcv.hasMultipleValues() ) {
                                    bSplit = true;
                                }
                            }
                        }
                    } else if ( cell1.isOtherwise() && cell2.isOtherwise() ) {
                        bSplit = false;
                        if ( cell1 instanceof GroupedCellValue ) {
                            GroupedCellValue gcv = (GroupedCellValue) cell1;
                            if ( gcv.hasMultipleValues() ) {
                                bSplit = true;
                            }
                        }
                        if ( cell2 instanceof GroupedCellValue ) {
                            GroupedCellValue gcv = (GroupedCellValue) cell2;
                            if ( gcv.hasMultipleValues() ) {
                                bSplit = true;
                            }
                        }
                    }
View Full Code Here

    @SuppressWarnings("rawtypes")
    public void testDataGrouping() {
        //[1][-][3] --> [1][x][x]
        //[1][2][*] --> [-][2][3]
        //[-][2][3] -->
        GroupedCellValue gcv;
        CellValue< ? extends Comparable< ? >> cv = data.get( 0 ).get( 0 );

        data.setMerged( true );
        data.applyModelGrouping( cv );

        assertEquals( data.size(),
                      2 );

        cv = data.get( 0 ).get( 0 );
        assertTrue( cv instanceof GroupedCellValue );
        gcv = (GroupedCellValue) cv;
        assertFalse( gcv.hasMultipleValues() );
        assertEquals( cv.getValue(),
                      "1" );
        cv = data.get( 0 ).get( 1 );
        assertTrue( cv instanceof GroupedCellValue );
        gcv = (GroupedCellValue) cv;
        assertTrue( gcv.hasMultipleValues() );
        cv = data.get( 0 ).get( 2 );
        assertTrue( cv instanceof GroupedCellValue );
        gcv = (GroupedCellValue) cv;
        assertTrue( gcv.hasMultipleValues() );
        assertEquals( cv.getValue(),
                      "3" );

        cv = data.get( 1 ).get( 0 );
        assertFalse( cv instanceof GroupedCellValue );
View Full Code Here

    @SuppressWarnings("rawtypes")
    public void testDataGrouping() {
        //[1][-][3] --> [1][x][3]
        //[1][2][3] --> [-][2][3]
        //[-][2][3] -->
        GroupedCellValue gcv;
        CellValue< ? extends Comparable< ? >> cv = data.get( 0 ).get( 0 );

        data.setMerged( true );
        data.applyModelGrouping( cv );

        assertEquals( data.size(),
                      2 );

        cv = data.get( 0 ).get( 0 );
        assertTrue( cv instanceof GroupedCellValue );
        gcv = (GroupedCellValue) cv;
        assertFalse( gcv.hasMultipleValues() );
        assertEquals( cv.getValue(),
                      "1" );
        cv = data.get( 0 ).get( 1 );
        assertTrue( cv instanceof GroupedCellValue );
        gcv = (GroupedCellValue) cv;
        assertTrue( gcv.hasMultipleValues() );
        cv = data.get( 0 ).get( 2 );
        assertTrue( cv instanceof GroupedCellValue );
        gcv = (GroupedCellValue) cv;
        assertFalse( gcv.hasMultipleValues() );
        assertEquals( cv.getValue(),
                      "3" );

        cv = data.get( 1 ).get( 0 );
        assertFalse( cv instanceof GroupedCellValue );
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.widgets.decoratedgrid.CellValue.GroupedCellValue

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.