this.setFill( imgFill ); fireHandleEvent( FillChooserComposite.FILL_CHANGED_EVENT );
	public void widgetSelected( SelectionEvent e )	{		Object oSource = e.getSource( );		if ( oSource.equals( btnDown ) )		{			fireHandleEvent( MOUSE_CLICKED_EVENT );			toggleDropDown( );		}		else if ( oSource.equals( this.btnImage ) )		{			FileDialog fDlg = new FileDialog( this.getShell( ), SWT.OPEN );			cmpDropDown.getParent( ).dispose( );			fDlg.setFilterExtensions( saImageTypes );			String sStartFolder = System.getProperty( "user.dir" ); //$NON-NLS-1$			String sImageFile = ""; //$NON-NLS-1$			if ( fCurrent instanceof Image )			{				String sFullPath = ( (Image) fCurrent ).getURL( ).toString( );				sImageFile = sFullPath.substring( sFullPath.lastIndexOf( "/" ) + 1 ); //$NON-NLS-1$				sStartFolder = sFullPath.substring( 0,						sFullPath.lastIndexOf( "/" ) ); //$NON-NLS-1$			}			fDlg.setFilterPath( sStartFolder );			fDlg.setFileName( sImageFile );			String sImgPath = fDlg.open( );			// Do nothing if dialog was cancelled			if ( sImgPath == null )			{				return;			}			try			{				new URL( sImgPath );			}			catch ( MalformedURLException e1 )			{				sImgPath = "file:///" + fDlg.getFilterPath( ) + File.separator + fDlg.getFileName( ); //$NON-NLS-1$			}			if ( sImgPath != null && sImgPath.trim( ).length( ) > 0 )			{				Image imgFill = AttributeFactory.eINSTANCE.createImage( );				imgFill.setURL( sImgPath );				if ( fCurrent != null )				{					imgFill.eAdapters( ).addAll( fCurrent.eAdapters( ) );				}				this.setFill( imgFill );				fireHandleEvent( FillChooserComposite.FILL_CHANGED_EVENT );			}		}		else if ( oSource.equals( this.btnCustom ) )		{			ColorDialog cDlg = new ColorDialog( this.getShell( ), SWT.NONE );			cmpDropDown.getParent( ).dispose( );			int iTrans = 255;			if ( fCurrent instanceof ColorDefinition )			{				if ( !fCurrent.equals( ColorDefinitionImpl.TRANSPARENT( ) ) )				{					iTransparency = ( (ColorDefinition) fCurrent ).getTransparency( );				}				cDlg.setRGB( new RGB( ( (ColorDefinition) this.fCurrent ).getRed( ),						( (ColorDefinition) this.fCurrent ).getGreen( ),						( (ColorDefinition) this.fCurrent ).getBlue( ) ) );			}			RGB rgb = cDlg.open( );			if ( rgb != null )			{				ColorDefinition cdNew = AttributeFactory.eINSTANCE.createColorDefinition( );				cdNew.set( rgb.red, rgb.green, rgb.blue );				cdNew.setTransparency( ( bTransparencyChanged ) ? this.iTransparency						: iTrans );				if ( fCurrent != null )				{					cdNew.eAdapters( ).addAll( fCurrent.eAdapters( ) );				}				this.setFill( cdNew );				fireHandleEvent( FillChooserComposite.FILL_CHANGED_EVENT );			}		}		else if ( oSource.equals( this.btnGradient ) )		{			GradientEditorDialog ged = null;			cmpDropDown.getParent( ).dispose( );						if ( fCurrent instanceof Gradient )			{				ged = new GradientEditorDialog( this.getShell( ),						(Gradient) fCurrent );			}			else if ( fCurrent instanceof ColorDefinition )			{				ged = new GradientEditorDialog( this.getShell( ),						null,						(ColorDefinition) fCurrent );			}			else			{				ged = new GradientEditorDialog( this.getShell( ), null );			}			if ( ged.getGradient( ) != null )			{				Fill fTmp = ged.getGradient( );				if ( fCurrent != null )				{					fTmp.eAdapters( ).addAll( fCurrent.eAdapters( ) );				}				if ( fCurrent == null || !( fCurrent.equals( fTmp ) ) )				{					this.setFill( fTmp );					fireHandleEvent( FillChooserComposite.FILL_CHANGED_EVENT );				}			}		}		else if ( oSource.equals( srTransparency ) )		{			iTransparency = srTransparency.getSelection( );			lblTransparency.setText( new MessageFormat( Messages.getString( "FillChooserComposite.Lbl.Opacity" ) ) //$NON-NLS-1$					.format( new Object[]{						new Integer( iTransparency )					} ) );			srTransparency.setToolTipText( String.valueOf( srTransparency.getSelection( ) ) );			if ( fCurrent instanceof ColorDefinition )			{				( (ColorDefinition) fCurrent ).setTransparency( iTransparency );			}			setFill( fCurrent );			bTransparencyChanged = true;		}	}