int[] data = (int[]) dlg.getResult( ); grid = factory.newGridItem( null, data[1], data[0] );
Object[] data = (Object[]) dlg.getResult( ); grid = factory.newGridItem( null, ( (Integer) data[1] ).intValue( ), ( (Integer) data[0] ).intValue( ) );
		public boolean preHandleMouseUp( )		{			ModuleHandle reportDesignHandle = SessionHandleAdapter.getInstance( )					.getReportDesignHandle( );			// ElementFactory factory = reportDesignHandle.getElementFactory( );			DesignElementFactory factory = DesignElementFactory.getInstance( reportDesignHandle );			String type = (String) getRequest( ).getNewObjectType( );			GridHandle grid = null;			if ( IReportElementConstants.AUTOTEXT_PAGEXOFY.equals( type ) )			{				grid = factory.newGridItem( null, 3, 1 );				try				{					List cellList = ( (RowHandle) grid.getRows( ).get( 0 ) ).getCells( )							.getContents( );					AutoTextHandle autoTextHandle = factory.newAutoText( null );					autoTextHandle.setAutoTextType( DesignChoiceConstants.AUTO_TEXT_PAGE_NUMBER );					( (CellHandle) cellList.get( 0 ) ).getContent( )							.add( autoTextHandle );					TextItemHandle textHandle = factory.newTextItem( null );					textHandle.setContent( "/" ); //$NON-NLS-1$					textHandle.setContentType( DesignChoiceConstants.TEXT_CONTENT_TYPE_PLAIN );					( (CellHandle) cellList.get( 1 ) ).getContent( )							.add( textHandle );					autoTextHandle = factory.newAutoText( null );					autoTextHandle.setAutoTextType( DesignChoiceConstants.AUTO_TEXT_TOTAL_PAGE );					( (CellHandle) cellList.get( 2 ) ).getContent( )							.add( autoTextHandle );				}				catch ( SemanticException e )				{					ExceptionHandler.handle( e );				}			}			else if ( IReportElementConstants.AUTOTEXT_AUTHOR_PAGE_DATE.equals( type ) )			{				grid = factory.newGridItem( null, 3, 1 );				try				{					List cellList = ( (RowHandle) grid.getRows( ).get( 0 ) ).getCells( )							.getContents( );					TextItemHandle textHandle = factory.newTextItem( null );					String text = AUTOTEXT_LABEL_CREATE_BY;					if ( reportDesignHandle.getAuthor( ) != null )					{						text += reportDesignHandle.getAuthor( );					}					textHandle.setContent( text );					( (CellHandle) cellList.get( 0 ) ).getContent( )							.add( textHandle );					AutoTextHandle autoTextHandle = factory.newAutoText( null );					autoTextHandle.setAutoTextType( DesignChoiceConstants.AUTO_TEXT_PAGE_NUMBER );					( (CellHandle) cellList.get( 1 ) ).getContent( )							.add( autoTextHandle );					textHandle = factory.newTextItem( null );					textHandle.setContent( "<value-of>new Date()</value-of>" ); //$NON-NLS-1$					textHandle.setContentType( DesignChoiceConstants.TEXT_CONTENT_TYPE_HTML );					( (CellHandle) cellList.get( 2 ) ).getContent( )							.add( textHandle );				}				catch ( SemanticException e )				{					ExceptionHandler.handle( e );				}			}			else if ( IReportElementConstants.AUTOTEXT_CONFIDENTIAL_PAGE.equals( type ) )			{				grid = factory.newGridItem( null, 2, 1 );				try				{					List cellList = ( (RowHandle) grid.getRows( ).get( 0 ) ).getCells( )							.getContents( );					TextItemHandle textHandle = factory.newTextItem( null );					textHandle.setContent( AUTOTEXT_TEXT_CONFIDENTIAL );					textHandle.setContentType( DesignChoiceConstants.TEXT_CONTENT_TYPE_HTML );					( (CellHandle) cellList.get( 0 ) ).getContent( )							.add( textHandle );					AutoTextHandle autoTextHandle = factory.newAutoText( null );					autoTextHandle.setAutoTextType( DesignChoiceConstants.AUTO_TEXT_PAGE_NUMBER );					( (CellHandle) cellList.get( 1 ) ).getContent( )							.add( autoTextHandle );				}				catch ( SemanticException e )				{					ExceptionHandler.handle( e );				}			}			else if ( IReportElementConstants.REPORT_ELEMENT_GRID.equals( type ) )			{				TableOptionDialog dlg = new TableOptionDialog( UIUtil.getDefaultShell( ),						false );				if ( dlg.open( ) == Window.OK						&& dlg.getResult( ) instanceof int[] )				{					int[] data = (int[]) dlg.getResult( );					grid = factory.newGridItem( null, data[1], data[0] );				}				else				{					return false;				}			}			else			{				return false;			}			InsertInLayoutUtil.setInitWidth( grid );			setModel( grid );			return super.preHandleMouseUp( );		}