GridHandle grid = factory.newGridItem( null, 3, 3 ); InsertInLayoutUtil.setInitWidth( grid ); return grid;
TableOptionDialog dlg = new TableOptionDialog( UIUtil.getDefaultShell( ), false ); if ( dlg.open( ) == Window.OK && dlg.getResult( ) instanceof int[] ) { int[] data = (int[]) dlg.getResult( ); GridHandle grid = factory.newGridItem( null, data[1], data[0] ); InsertInLayoutUtil.setInitWidth( grid ); return grid; } return null;
	protected DesignElementHandle createElement( String type ) throws Exception	{		ElementFactory factory = SessionHandleAdapter.getInstance( )				.getReportDesignHandle( )				.getElementFactory( );		if ( ReportDesignConstants.TABLE_ITEM.equals( type ) )		{			TableHandle table = factory.newTableItem( null, 3 );			InsertInLayoutUtil.setInitWidth( table );			return table;		}		else if ( ReportDesignConstants.GRID_ITEM.equals( type ) )		{			GridHandle grid = factory.newGridItem( null, 3, 3 );			InsertInLayoutUtil.setInitWidth( grid );			return grid;		}		else if ( ReportDesignConstants.IMAGE_ITEM.equals( type ) )		{			ImageBuilderDialog dialog = new ImageBuilderDialog( PlatformUI.getWorkbench( )					.getDisplay( )					.getActiveShell( ) );			if ( dialog.open( ) == Dialog.OK )			{				return (DesignElementHandle) dialog.getResult( );			}			return null;		}		return factory.newElement( type, null );	}