Bug 316695 Refactor data set editor pages' codes[26568]
Build Identifier: 20100610 Refactor data set editor pages' codes[26568]. Reproducible: Always
UI/org.eclipse.birt.report.designer.ui.data/src/org/eclipse/birt/report/designer/data/ui/dataset/DataSetParametersPage.java
/**
	 * Re-indexes the parameters starting at 1 from the 1st in the list.
	 */
	protected final void refreshPositions( )
	{
		if ( parameters == null )
		{
			parameters = ( (DataSetHandle) getContainer( ).getModel( ) ).getPropertyHandle( DataSetHandle.PARAMETERS_PROP );
		}
		if ( parameters != null )
		{
			int position = 1;
			Iterator iter = parameters.iterator( );
			if ( iter != null )
			{
				while ( iter.hasNext( ) )
				{
					DataSetParameterHandle parameter = (DataSetParameterHandle) iter.next( );
					if ( parameter instanceof OdaDataSetParameterHandle )
					{
						boolean hasNativeName = ( (OdaDataSetParameterHandle) parameter ).getNativeName( ) != null
								&& ( (OdaDataSetParameterHandle) parameter ).getNativeName( )
										.trim( )
										.length( ) > 0;
						if ( !hasNativeName
								&& ( parameter.getPosition( ) == null || parameter.getPosition( )
										.intValue( ) != position ) )
						{
							parameter.setPosition( new Integer( position ) );
						}