Bug 213965 Can only select the first four rows in the Data Preview table in chart builder.
description: Can only select the first four rows in the Data Preview table in chart builder. build version: 2.2.2 v20071228-1951 steps to reproduce: 1. Under preference->Report Design->Chart, set the Max row number of Data Preview larger than 4. 2. New a report. 3. New a datasource with sample DB and new a dataset with table CUSTOMERS. 4. Insert a chart to the report, bind the dataset, define customername as category and define customernumber as value series. On Date Preview table, try to select the rows at the bottom. Expected reslut: Rows can be selected and highlighted. Actual result: Rows can not be selected and rows at the top are highlighted.
chart/org.eclipse.birt.chart.ui/src/org/eclipse/birt/chart/ui/swt/CustomPreviewTable.java
*/
		private int calculateMaxColumnWidth( int columnIndex, Control control )
		{
			int maxWidth = 10;
			GC gc = new GC( control );
			Vector columnTexts = cells[columnIndex];
			for ( int rowIndex = 0; rowIndex < columnTexts.size( ); rowIndex++ )
			{
				Object obj = columnTexts.get( rowIndex );
				if ( obj != null && obj instanceof String )
				{
					maxWidth = Math.max( gc.textExtent( (String) obj ).x,
							maxWidth );
				}
			}
			gc.dispose( );
			return maxWidth;
		}
		public void addColumn( Color clr )
		{
			Vector[] newCells = new Vector[cells.length + 1];
			Color[] newColors = new Color[colors.length + 1];
			for ( int i = 0; i < cells.length; i++ )
			{
				newCells[i] = cells[i];
				newColors[i] = colors[i];
			}
			newCells[cells.length] = new Vector( );
			newColors[colors.length] = ( clr != null ) ? clr
					: Display.getDefault( )