Bug 322512 Refactor data set editor pages' codes[30357]
Build Identifier: Refactor data set editor pages' codes. Reproducible: Always
UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/dataset/ResultSetPreviewPage.java
/**
	 * Populate records to be retrieved when re-render resultSetTable
	 * 
	 * @param metaData
	 * @param query
	 * @throws BirtException
	 */
	private void populateRecords( IResultIterator iter )
	{
		try
		{
			if ( iter != null )
			{
				IResultMetaData meta = iter.getResultMetaData( );
				while ( iter.next( ) )
				{
					CellValue[] record = new CellValue[meta.getColumnCount( )];
					for ( int n = 0; n < record.length; n++ )
					{
						CellValue cv = new CellValue( );
						Object value = iter.getValue( meta.getColumnName( n+1 ) );
						String disp = null;
						if( value instanceof Number )
							disp = value.toString( );
						else
							disp = iter.getString( meta.getColumnName( n+1 )  );
						cv.setDisplayValue( disp );
						cv.setRealValue( value );
						record[n] = cv;
					}