itemBand.setLayout( BandStyleKeys.LAYOUT_AUTO ); groupData.setItemBand( itemBand ); group.setBody( groupData ); report.setRootGroup( group );
public void setElementAt( final int index, final Element element ) { switch ( index ) { case 0: setHeader( (GroupHeader) element ); break; case 1: setBody( (GroupBody) element ); break; case 2: setFooter( (GroupFooter) element ); break; default: throw new IndexOutOfBoundsException(); } }
@Test( expected = IllegalArgumentException.class ) public void testSetBodyException() { group.setBody( mock( GroupBody.class ) ); }
/** * Adds a group to the report. This replaces the group body on the group with a new data-group-body composed of the * existing itemband and no-databand. * * @param group * the group. */ public void addGroup( final RelationalGroup group ) { if ( group == null ) { throw new NullPointerException( "AbstractReporDefinition.addGroup(..) : Null not permitted" ); } final Group existingGroup = getInnerMostRelationalGroup(); final GroupBody gb = existingGroup.getBody(); existingGroup.setBody( new SubGroupBody( group ) ); group.setBody( gb ); }
@Test public void testSetBody() { GroupDataBody body = mock( GroupDataBody.class ); group.setBody( body ); assertThat( group.getBody(), is( instanceOf( GroupDataBody.class ) ) ); assertThat( (GroupDataBody) group.getBody(), is( equalTo( body ) ) ); }
/** * Done parsing. * * @throws SAXException * if there is a parsing error. */ protected void doneParsing() throws SAXException { super.doneParsing(); final RelationalGroup group = getElement(); if ( fieldsReadHandler != null ) { final String[] fields = fieldsReadHandler.getFields(); group.setFields( Arrays.asList( fields ) ); } if ( headerReadHandler != null ) { group.setHeader( headerReadHandler.getElement() ); } if ( footerReadHandler != null ) { group.setFooter( footerReadHandler.getElement() ); } if ( subGroupBodyReadHandler != null ) { group.setBody( subGroupBodyReadHandler.getElement() ); } else if ( dataBodyReadHandler != null ) { group.setBody( dataBodyReadHandler.getElement() ); } }
innerGroup.setBody( new SubGroupBody( g ) );