case SWT.MouseDown : if ( !bEnabled ) { return; } fireHandleEvent( MOUSE_CLICKED_EVENT ); if ( event.widget.equals( cnvSelection ) ) { if ( !cnvSelection.isDisposed( ) ) { toggleDropDown( ); } } else if ( event.widget instanceof ColorSelectionCanvas ) { ColorDefinition cTmp = AttributeFactory.eINSTANCE.createColorDefinition( ); Color clrTmp = ( (ColorSelectionCanvas) event.widget ).getColorAt( event.x, event.y ); cTmp.set( clrTmp.getRed( ), clrTmp.getGreen( ), clrTmp.getBlue( ) ); int iTransparency = 255; if ( fCurrent instanceof ColorDefinition && this.iTransparency != 0 ) { iTransparency = ( bTransparencyChanged ) ? this.iTransparency : ( (ColorDefinition) fCurrent ).getTransparency( ); } cTmp.setTransparency( iTransparency ); addAdapters( cTmp ); setFill( cTmp ); fireHandleEvent( FillChooserComposite.FILL_CHANGED_EVENT ); cmpDropDown.getShell( ).close( ); } break;
	public void handleEvent( Event event )	{		switch ( event.type )		{			case SWT.FocusOut :				if ( isPopupControl( event.widget ) )				{					// Condition added to handle behavior under Linux					Control cTmp = isPressingKey ? Display.getCurrent( )							.getFocusControl( ) : Display.getCurrent( )							.getCursorControl( );					// Set default value back					isPressingKey = false;					if ( cTmp != null )					{						if ( isPopupControl( cTmp )								|| SWT.getPlatform( ).indexOf( "win32" ) == 0//$NON-NLS-1$								&& ( cTmp.equals( cnvSelection ) || cTmp.equals( btnDown ) ) )						{							return;						}						if ( cTmp.equals( cnvSelection )								|| cTmp.equals( btnDown ) )						{							bJustFocusLost = true;						}					}					cmpDropDown.getShell( ).close( );				}				break;			case SWT.KeyDown :				if ( cmpDropDown != null						&& !cmpDropDown.getShell( ).isDisposed( ) )				{					if ( event.keyCode == SWT.ARROW_UP )					{						cmpDropDown.getShell( ).close( );					}					else if ( event.keyCode == SWT.CR							|| event.keyCode == SWT.KEYPAD_CR )					{						this.iTransparency = srTransparency.getSelection( );						if ( fCurrent instanceof ColorDefinition								&& bTransparencyChanged )						{							( (ColorDefinition) fCurrent ).setTransparency( this.iTransparency );						}						this.setFill( fCurrent );						cmpDropDown.getShell( ).close( );					}				}				break;			case SWT.MouseDown :				if ( !bEnabled )				{					return;				}				fireHandleEvent( MOUSE_CLICKED_EVENT );				if ( event.widget.equals( cnvSelection ) )				{					if ( !cnvSelection.isDisposed( ) )					{						toggleDropDown( );					}				}				else if ( event.widget instanceof ColorSelectionCanvas )				{					ColorDefinition cTmp = AttributeFactory.eINSTANCE.createColorDefinition( );					Color clrTmp = ( (ColorSelectionCanvas) event.widget ).getColorAt( event.x,							event.y );					cTmp.set( clrTmp.getRed( ),							clrTmp.getGreen( ),							clrTmp.getBlue( ) );					int iTransparency = 255;					if ( fCurrent instanceof ColorDefinition							&& this.iTransparency != 0 )					{						iTransparency = ( bTransparencyChanged )								? this.iTransparency								: ( (ColorDefinition) fCurrent ).getTransparency( );					}					cTmp.setTransparency( iTransparency );					addAdapters( cTmp );					setFill( cTmp );					fireHandleEvent( FillChooserComposite.FILL_CHANGED_EVENT );					cmpDropDown.getShell( ).close( );				}				break;			case SWT.Traverse :				switch ( event.detail )				{					case SWT.TRAVERSE_TAB_NEXT :					case SWT.TRAVERSE_TAB_PREVIOUS :						// Indicates getting focus control rather than cursor						// control						isPressingKey = true;				}				break;		}	}