label.setText( ResultSetColumnProvider.getDisplayName( model ) );
label.setText( getDisplayName( model ) );
	protected static DataItemHandle performInsertDataSetColumn(			ResultSetColumnHandle model, Object target, Object targetParent )			throws SemanticException	{		/*		 * search the target container, if container has the same dataset, add		 * the column binding if it does not exist in the container. If the		 * container's dataset is not the dragged dataset column's dataset,		 * column binding will be added to the new dataitem, and set dataitem's		 * dataset with the dragged dataset column's dataset.		 */		DataItemHandle dataHandle = DesignElementFactory.getInstance( )				.newDataItem( null );		DataSetHandle dataSet = (DataSetHandle) model.getElementHandle( );		dataHandle.setResultSetColumn( model.getColumnName( ) );		if ( targetParent instanceof ReportItemHandle )		{			ReportItemHandle container = (ReportItemHandle) targetParent;			ComputedColumn bindingColumn = StructureFactory.newComputedColumn( dataHandle,					model.getColumnName( ) );			bindingColumn.setDataType( model.getDataType( ) );			bindingColumn.setExpression( DEUtil.getExpression( model ) );			if ( target instanceof DesignElementHandle )			{				if ( ExpressionUtil.hasAggregation( bindingColumn.getExpression( ) ) )				{					String groupType = DEUtil.getGroupControlType( (DesignElementHandle) target );					if ( groupType.equals( DEUtil.TYPE_GROUP_GROUP ) )						bindingColumn.setAggregateOn( ( (GroupHandle) DEUtil.getGroups( (DesignElementHandle) target )								.get( 0 ) ).getName( ) );					else if ( groupType.equals( DEUtil.TYPE_GROUP_LISTING ) )						bindingColumn.setAggregateOn( null );				}			}			DataSetHandle containerDataSet = DEUtil.getFirstDataSet( container );			container = DEUtil.getListingContainer( container );			if ( containerDataSet == null && container != null )			{				container.setDataSet( dataSet );				containerDataSet = dataSet;			}			if ( dataSet.equals( containerDataSet ) && container != null )			{				container.addColumnBinding( bindingColumn, false );			}			else			{				// should not happen				dataHandle.setDataSet( dataSet );				dataHandle.addColumnBinding( bindingColumn, false );			}			// GroupHandle groupHandle = getGroupHandle( target );			// if ( groupHandle != null )			// {			// ComputedColumn bindingColumn =			// StructureFactory.newComputedColumn( groupHandle,			// model.getColumnName( ) );			// // bindingColumn.setColumnName( model.getColumnName( ) );			// bindingColumn.setDataType( model.getDataType( ) );			// bindingColumn.setExpression( DEUtil.getExpression( model ) );			//			// groupHandle.addColumnBinding( bindingColumn, false );			// }			// else			// {			// ComputedColumn bindingColumn =			// StructureFactory.newComputedColumn( container,			// model.getColumnName( ) );			// bindingColumn.setDataType( model.getDataType( ) );			// bindingColumn.setExpression( DEUtil.getExpression( model ) );			// container.addColumnBinding( bindingColumn, false );			// }			// ComputedColumn bindingColumn =			// StructureFactory.createComputedColumn( );			// bindingColumn.setName( model.getColumnName( ) );			// bindingColumn.setDataType( model.getDataType( ) );			// bindingColumn.setExpression( DEUtil.getExpression( model ) );			// GroupHandle groupHandle = getGroupHandle( target );			//			// if ( groupHandle != null )			// {			// for ( Iterator iter = groupHandle.getColumnBindings( )			// .iterator( ); iter.hasNext( ); )			// {			// ComputedColumnHandle element = (ComputedColumnHandle) iter.next(			// );			// if ( element.getStructure( ).equals( bindingColumn ) )			// {			// bindingExist = true;			// break;			// }			// }			// }			// else			// {			// for ( Iterator iter = container.getColumnBindings( ).iterator( );			// iter.hasNext( ); )			// {			// ComputedColumnHandle element = (ComputedColumnHandle) iter.next(			// );			// if ( element.getStructure( ).equals( bindingColumn ) )			// {			// bindingExist = true;			// break;			// }			// }			//			// }		}		else		{			ComputedColumn bindingColumn = StructureFactory.newComputedColumn( dataHandle,					model.getColumnName( ) );			bindingColumn.setDataType( model.getDataType( ) );			bindingColumn.setExpression( DEUtil.getExpression( model ) );			if ( target instanceof DesignElementHandle )			{				if ( ExpressionUtil.hasAggregation( bindingColumn.getExpression( ) ) )				{					String groupType = DEUtil.getGroupControlType( (DesignElementHandle) target );					if ( groupType.equals( DEUtil.TYPE_GROUP_GROUP ) )						bindingColumn.setAggregateOn( ( (GroupHandle) DEUtil.getGroups( (DesignElementHandle) target )								.get( 0 ) ).getName( ) );					else if ( groupType.equals( DEUtil.TYPE_GROUP_LISTING ) )						bindingColumn.setAggregateOn( null );				}			}			dataHandle.addColumnBinding( bindingColumn, false );			dataHandle.setDataSet( dataSet );		}		// if ( !bindingExist )		// {		// ComputedColumn bindingColumn = StructureFactory.newComputedColumn(		// dataHandle,		// model.getColumnName( ) );		// bindingColumn.setDataType( model.getDataType( ) );		// bindingColumn.setExpression( DEUtil.getExpression( model ) );		// dataHandle.addColumnBinding( bindingColumn, false );		// dataHandle.setDataSet( dataSet );		// }		InsertInLayoutRule rule = new LabelAddRule( target );		if ( rule.canInsert( ) )		{			// LabelHandle label = SessionHandleAdapter.getInstance( )			// .getReportDesignHandle( )			// .getElementFactory( )			// .newLabel( null );			LabelHandle label = DesignElementFactory.getInstance( )					.newLabel( null );			label.setText( ResultSetColumnProvider.getDisplayName( model ) );			rule.insert( label );		}		rule = new GroupKeySetRule( target, model );		if ( rule.canInsert( ) )		{			rule.insert( model );		}		return dataHandle;	}