if ( getChart( ).getLegend( ).getItemType( ).getValue( ) == LegendItemType.CATEGORIES_LITERAL.getValue( ) ) { sl.topControl = cmpCategory; cmp.layout( ); ( (SeriesPaletteSheet) popup ).setSeriesDefinition( getCategorySeriesDefinition( ) ); } else { popups.clear( ); sl.topControl = cmpValue; cmp.layout( ); for ( int i = 0; i < popups.size( ); i++ ) { ( (SeriesPaletteSheet) ( (ITaskPopupSheet) popups.get( i ) ) ).setSeriesDefinition( getValueSeriesDefinition( i ) ); } } detachPopup( );
( (SeriesPaletteSheet) popup ).setGroupedPalette( isGroupedPalette( ) ); refreshPopupSheet( );
	public void widgetSelected( SelectionEvent e )	{		// Detach popup dialog if there's selected popup button.		if ( detachPopup( e.widget ) )		{			return;		}		if ( isRegistered( e.widget ) )		{			attachPopup( ( (Button) e.widget ).getText( ) );		}		if ( e.widget.equals( cmbColorBy ) )		{			getChart( ).getLegend( )					.setItemType( LegendItemType.getByName( LiteralHelper.legendItemTypeSet.getNameByDisplayName( cmbColorBy.getText( ) ) ) );			if ( getChart( ).getLegend( ).getItemType( ).getValue( ) == LegendItemType.CATEGORIES_LITERAL.getValue( ) )			{				sl.topControl = cmpCategory;				cmp.layout( );				( (SeriesPaletteSheet) popup ).setSeriesDefinition( getCategorySeriesDefinition( ) );			}			else			{				popups.clear( );				sl.topControl = cmpValue;				cmp.layout( );				for ( int i = 0; i < popups.size( ); i++ )				{					( (SeriesPaletteSheet) ( (ITaskPopupSheet) popups.get( i ) ) ).setSeriesDefinition( getValueSeriesDefinition( i ) );				}			}			detachPopup( );		}	}