lblSorting.setText( Messages.getString( "BaseSeriesDataSheetImpl.Lbl.DataSorting" ) );
lblSorting.setText( Messages.getString( "MultipleSeriesComponent.Label.GroupSorting" ) );
	private void createRightGroupArea( Composite parent, final int axisIndex,			final EList seriesDefn )	{		final String strDesc = getGroupingDescription( axisIndex );		ISelectDataComponent subUIGroupY = new DefaultSelectDataComponent( ) {			public Composite createArea( Composite parent )			{				Composite cmpGroup = ChartUIUtil.createCompositeWrapper( parent );				cmpGroup.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );				Label lblRightYGrouping = new Label( cmpGroup, SWT.WRAP );				{					GridData gd = new GridData( );					gd.widthHint = getStandardWidth( ) * 16;					lblRightYGrouping.setLayoutData( gd );					lblRightYGrouping.setText( strDesc );				}				int selectedSeriesIndex = 0;				if ( !useFirstOnly )				{					selectedSeriesIndex = selectDataUI.getSeriesIndex( )[axisIndex];				}				final SeriesDefinition sd = ( (SeriesDefinition) seriesDefn.get( selectedSeriesIndex ) );				if ( seriesDefn != null && !seriesDefn.isEmpty( ) )				{					// Only display current selected series					ISelectDataComponent subUI = selectDataUI.getAreaComponent( ISelectDataCustomizeUI.GROUPING_SERIES,							sd,							context,							sTitle );					subUI.addListener( new Listener( ) {						public void handleEvent( Event event )						{							final String query = event.text;							// Copy the group query to other query definitions.							ChartAdapter.changeChartWithoutNotification( new IChangeWithoutNotification( ) {								public Object run( )								{									ChartUIUtil.setAllGroupingQueryExceptFirst( context.getModel( ),											query );									return null;								}							} );						}					} );					subUI.createArea( cmpGroup );					components.add( subUI );				}				Label lblSorting = new Label( cmpGroup, SWT.NONE );				lblSorting.setText( Messages.getString( "BaseSeriesDataSheetImpl.Lbl.DataSorting" ) ); //$NON-NLS-1$				final Combo cmbSorting = new Combo( cmpGroup, SWT.DROP_DOWN						| SWT.READ_ONLY );				cmbSorting.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );				// populate sorting combo				cmbSorting.add( UNSORTED_OPTION );				String[] nss = LiteralHelper.sortOptionSet.getDisplayNames( );				for ( int i = 0; i < nss.length; i++ )				{					cmbSorting.add( nss[i] );				}				// Select value				if ( !sd.eIsSet( DataPackage.eINSTANCE.getSeriesDefinition_Sorting( ) ) )				{					cmbSorting.select( 0 );				}				else				{					// plus one for the first is unsorted option.					cmbSorting.select( LiteralHelper.sortOptionSet.getNameIndex( sd.getSorting( )							.getName( ) ) + 1 );				}				cmbSorting.addListener( SWT.Selection, new Listener( ) {					public void handleEvent( Event event )					{						if ( cmbSorting.getText( ).equals( UNSORTED_OPTION ) )						{							sd.eUnset( DataPackage.eINSTANCE.getSeriesDefinition_Sorting( ) );						}						else						{							sd.setSorting( SortOption.getByName( LiteralHelper.sortOptionSet.getNameByDisplayName( cmbSorting.getText( ) ) ) );						}						// Update the query sortings of other series.						ChartAdapter.changeChartWithoutNotification( new IChangeWithoutNotification( ) {							public Object run( )							{								List sds = ChartUIUtil.getAllOrthogonalSeriesDefinitions( context.getModel( ) );								for ( int i = 0; i < sds.size( ); i++ )								{									if ( i != 0 )									{										// Except for the first, which should be										// changed manually.										SeriesDefinition sdf = (SeriesDefinition) sds.get( i );										if ( cmbSorting.getText( )												.equals( UNSORTED_OPTION ) )										{											sdf.eUnset( DataPackage.eINSTANCE.getSeriesDefinition_Sorting( ) );										}										else										{											sdf.setSorting( SortOption.getByName( LiteralHelper.sortOptionSet.getNameByDisplayName( cmbSorting.getText( ) ) ) );										}									}								}								return null;							}						} );					}				} );				return cmpGroup;			}		};		subUIGroupY.createArea( parent );		components.add( subUIGroupY );	}