Bug 318835 Refactor data set editor pages' codes[27965]
Build Identifier: 20100702 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
if ( columnsModel == null
				|| columnsModel.length == 0 || index < 0
				|| index > columnsModel.length )
		{
			return "";
		}
		String externalizedName = columnsModel[index].getExternalizedName( );
		if ( externalizedName != null && ( !externalizedName.equals( "" ) ) )
			return externalizedName;
		return columnsModel[index].getDisplayName( );
	}
	/**
	 * Add listener to a column
	 * 
	 * @param column
	 * @param n
	 */
	private void addColumnSortListener( TableColumn column, final int index )
	{
		column.addSelectionListener( new SelectionListener( ) {
			private boolean asc = false;
			public void widgetSelected( SelectionEvent e )
			{
				sort( index, asc );
				asc = !asc;
			}
			public void widgetDefaultSelected( SelectionEvent e )
			{
			}
		} );