if ( inputGroup instanceof TableGroupHandle ) { if ( includeHeader.getSelection( ) != inputGroup.hasHeader( ) ) { if ( includeHeader.getSelection( ) ) { inputGroup.getHeader( ).add( createRow( ) ); } else { inputGroup.clearContents( GroupHandle.HEADER_SLOT ); } } if ( includeFooter.getSelection( ) != inputGroup.hasFooter( ) ) { if ( includeFooter.getSelection( ) ) { inputGroup.getFooter( ).add( createRow( ) ); } else { inputGroup.clearContents( GroupHandle.FOOTER_SLOT ); } } }
	protected void okPressed( )	{		try		{			inputGroup.setName( nameEditor.getText( ) );			String newToc = UIUtil.convertToModelString( tocEditor.getText( ),					true );			if ( newToc != inputGroup.getTocExpression( ) )			{				if ( newToc == null						|| !newToc.equals( inputGroup.getTocExpression( ) ) )				{					inputGroup.setTocExpression( newToc );				}			}			int index = keyChooser.getSelectionIndex( );			String oldKeyExpr = inputGroup.getKeyExpr( );			String newKeyExpr = getKeyExpression( );			inputGroup.setKeyExpr( newKeyExpr );			if ( newKeyExpr != null					&& newKeyExpr.length( ) != 0					&& !newKeyExpr.equals( oldKeyExpr )					&& index != -1 )			{				SlotHandle slotHandle = null;				// SlotHandle headerHandle = null;				if ( inputGroup instanceof ListGroupHandle )				{					slotHandle = inputGroup.getHeader( );					// headerHandle = ( (ListHandle) inputGroup.getContainer( )					// ).getHeader( );				}				else if ( inputGroup instanceof TableGroupHandle )				{					if ( inputGroup.getHeader( ).getCount( ) != 0 )					{						RowHandle rowHandle = ( (RowHandle) inputGroup.getHeader( )								.get( 0 ) );						CellHandle cellHandle = (CellHandle) rowHandle.getCells( )								.get( 0 );						slotHandle = cellHandle.getContent( );					}					// headerHandle = ( (TableHandle) inputGroup.getContainer( )					// ).getHeader( );					// if ( headerHandle.getCount( ) != 0 )					// {					// headerHandle = ( (RowHandle) headerHandle.get( 0 )					// ).getCells( );					// if ( headerHandle.getCount( ) != 0 )					// {					// headerHandle = ( (CellHandle) headerHandle.get( 0 )					// ).getContent( );					// }					// }				}				if ( slotHandle != null )				{					DataItemHandle dataItemHandle = inputGroup.getElementFactory( )							.newDataItem( null );					dataItemHandle.setResultSetColumn( ( (ComputedColumnHandle) columnList.get( index ) ).getName( ) );					slotHandle.add( dataItemHandle );				}			}			index = intervalType.getSelectionIndex( );			inputGroup.setInterval( intervalChoices[index].getName( ) );			if ( index != 0 )			{				inputGroup.setIntervalRange( intervalRange.getSelection( ) );			}			else			{				inputGroup.setProperty( GroupHandle.INTERVAL_RANGE_PROP, null );			}			if ( intervalBaseText.getEnabled( ) )			{				inputGroup.setIntervalBase( UIUtil.convertToModelString( intervalBaseText.getText( ),						false ) );			}			else			{				inputGroup.setIntervalBase( null );			}			inputGroup.setHideDetail( hideDetail.getSelection( ) );			if ( inputGroup instanceof TableGroupHandle )			{				if ( includeHeader.getSelection( ) != inputGroup.hasHeader( ) )				{// the include header status changed					if ( includeHeader.getSelection( ) )					{// from unchecked to checked						inputGroup.getHeader( ).add( createRow( ) );					}					else					{// from checked to unchecked,clear the slot						inputGroup.clearContents( GroupHandle.HEADER_SLOT );					}				}				if ( includeFooter.getSelection( ) != inputGroup.hasFooter( ) )				{// the include footer status changed					if ( includeFooter.getSelection( ) )					{// from unchecked to checked						inputGroup.getFooter( ).add( createRow( ) );					}					else					{// from checked to unchecked,clear the slot						inputGroup.clearContents( GroupHandle.FOOTER_SLOT );					}				}			}			if ( ascending.getSelection( ) )			{				inputGroup.setSortDirection( DesignChoiceConstants.SORT_DIRECTION_ASC );			}			else			{				inputGroup.setSortDirection( DesignChoiceConstants.SORT_DIRECTION_DESC );			}			inputGroup.setPageBreakBefore( pagebreakBeforeChoicesAll[pagebreakBeforeCombo.getSelectionIndex( )].getName( ) );			inputGroup.setPageBreakAfter( pagebreakAfterChoicesAll[pagebreakAfterCombo.getSelectionIndex( )].getName( ) );			inputGroup.setRepeatHeader( repeatHeaderButton.getSelection( ) );		}		catch ( SemanticException e )		{			ExceptionHandler.handle( e );			return;		}		setResult( inputGroup );		super.okPressed( );	}