@Test public void testRemoveElement() { CrosstabOtherGroup crosstab = new CrosstabOtherGroup(); GroupHeader header = crosstab.getHeader(); GroupFooter footer = crosstab.getFooter(); crosstab.removeElement( mock( Element.class ) ); assertThat( crosstab.getFooter(), is( equalTo( footer ) ) ); assertThat( crosstab.getHeader(), is( equalTo( header ) ) ); crosstab.removeElement( footer ); assertThat( crosstab.getFooter(), is( not( equalTo( footer ) ) ) ); assertThat( crosstab.getHeader(), is( equalTo( header ) ) ); crosstab.removeElement( header ); assertThat( crosstab.getFooter(), is( not( equalTo( footer ) ) ) ); assertThat( crosstab.getHeader(), is( not( equalTo( header ) ) ) ); }
protected void removeElement( final Element element ) { if ( element == null ) { throw new NullPointerException(); } if ( footer == element ) { this.footer.setParent( null ); this.footer = new GroupFooter(); this.footer.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.footer ); } else if ( header == element ) { this.header.setParent( null ); this.header = new GroupHeader(); this.header.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.header ); } else { super.removeElement( element ); } }
CrosstabOtherGroup extends Group { protected void removeElement( final Element element ) { if ( element == null ) { throw new NullPointerException(); } if ( footer == element ) { this.footer.setParent( null ); this.footer = new GroupFooter(); this.footer.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.footer ); } else if ( header == element ) { this.header.setParent( null ); this.header = new GroupHeader(); this.header.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.header ); } else { super.removeElement( element ); } } }
CrosstabOtherGroup extends Group { protected void removeElement( final Element element ) { if ( element == null ) { throw new NullPointerException(); } if ( footer == element ) { this.footer.setParent( null ); this.footer = new GroupFooter(); this.footer.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.footer ); } else if ( header == element ) { this.header.setParent( null ); this.header = new GroupHeader(); this.header.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.header ); } else { super.removeElement( element ); } } CrosstabOtherGroup();  CrosstabOtherGroup( final GroupBody body );  CrosstabOtherGroup( final CrosstabCellBody body );  CrosstabOtherGroup( final CrosstabColumnGroupBody body ); }
CrosstabOtherGroup extends Group { protected void removeElement( final Element element ) { if ( element == null ) { throw new NullPointerException(); } if ( footer == element ) { this.footer.setParent( null ); this.footer = new GroupFooter(); this.footer.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.footer ); } else if ( header == element ) { this.header.setParent( null ); this.header = new GroupHeader(); this.header.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.header ); } else { super.removeElement( element ); } } CrosstabOtherGroup();  CrosstabOtherGroup( final GroupBody body );  CrosstabOtherGroup( final CrosstabCellBody body );  CrosstabOtherGroup( final CrosstabColumnGroupBody body ); GroupHeader getHeader(); void setHeader( final GroupHeader header ); GroupFooter getFooter(); void setFooter( final GroupFooter footer ); CrosstabOtherGroup clone(); CrosstabOtherGroup derive( final boolean preserveElementInstanceIds ); Element getElement( final int index ); int getElementCount(); void setElementAt( final int index, final Element element ); String getField(); void setField( final String field ); void setBody( final GroupBody body ); boolean isGroupChange( final DataRow dataRow ); List<SortConstraint> getSortingConstraint(); }
CrosstabOtherGroup extends Group { protected void removeElement( final Element element ) { if ( element == null ) { throw new NullPointerException(); } if ( footer == element ) { this.footer.setParent( null ); this.footer = new GroupFooter(); this.footer.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.footer ); } else if ( header == element ) { this.header.setParent( null ); this.header = new GroupHeader(); this.header.setParent( this ); notifyNodeChildRemoved( element ); notifyNodeChildAdded( this.header ); } else { super.removeElement( element ); } } CrosstabOtherGroup();  CrosstabOtherGroup( final GroupBody body );  CrosstabOtherGroup( final CrosstabCellBody body );  CrosstabOtherGroup( final CrosstabColumnGroupBody body ); GroupHeader getHeader(); void setHeader( final GroupHeader header ); GroupFooter getFooter(); void setFooter( final GroupFooter footer ); CrosstabOtherGroup clone(); CrosstabOtherGroup derive( final boolean preserveElementInstanceIds ); Element getElement( final int index ); int getElementCount(); void setElementAt( final int index, final Element element ); String getField(); void setField( final String field ); void setBody( final GroupBody body ); boolean isGroupChange( final DataRow dataRow ); List<SortConstraint> getSortingConstraint();  }