fileChooser.setText( Messages.getString( "ImageBuilderDialog.Chooser.Title" ) );
fileChooser.setText( Messages.getString( "ImageBuilder.Chooser.Title" ) );
	private void swtichToEmbeddedType( )	{		embeddedImageList = new List( inputArea, SWT.NONE				| SWT.SINGLE				| SWT.BORDER				| SWT.V_SCROLL				| SWT.H_SCROLL );		embeddedImageList.setLayoutData( new GridData( GridData.FILL_BOTH ) );		embeddedImageList.addSelectionListener( new SelectionAdapter( ) {			public void widgetSelected( SelectionEvent event )			{				preview( );				updateButtons( );			}		} );		Composite buttonBar = new Composite( inputArea, SWT.NONE );		buttonBar.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );		buttonBar.setLayout( new GridLayout( 2, false ) );		Button importButton = new Button( buttonBar, SWT.PUSH );		importButton.setText( DLG_IMPORT_BUTTON );		GridData gd = new GridData( GridData.HORIZONTAL_ALIGN_END );		gd.grabExcessHorizontalSpace = true;		importButton.setLayoutData( gd );		importButton.addSelectionListener( new SelectionAdapter( ) {			public void widgetSelected( SelectionEvent event )			{				FileDialog fileChooser = new FileDialog( getShell( ), SWT.OPEN );				fileChooser.setText( Messages.getString( "ImageBuilderDialog.Chooser.Title" ) ); //$NON-NLS-1$				fileChooser.setFilterExtensions( new String[]{						"*.gif", "*.jpg", "*.png", "*.ico", "*.bmp" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$				} );				try				{					String fullPath = fileChooser.open( );					if ( fullPath != null )					{						String fileName = fileChooser.getFileName( );						if ( fileName != null )						{							if ( embeddedImageList.indexOf( fileName ) != -1 )							{								ExceptionHandler.openMessageBox( DLG_TITLE_IMPORT_FAIL,										DLG_ERROR_MSG_FILE_EXISTS,										SWT.ICON_WARNING );								return;							}							previewCanvas.loadImage( fullPath );							BirtImageLoader imageLoader = new BirtImageLoader( );							EmbeddedImage image = imageLoader.save( getModuleHandle( ),									fullPath,									fileName );							embeddedImageList.add( image.getName( ) );							embeddedImageList.select( embeddedImageList.indexOf( image.getName( ) ) );							updateButtons( );						}					}				}				catch ( Throwable e )				{					preview( );					if ( e instanceof OutOfMemoryError )					{						e = GUIException.createGUIException( ReportPlugin.REPORT_UI,								e );					}					ExceptionHandler.handle( e,							DLG_TITLE_LOADING_FAIL,							DLG_ERROR_MSG_LOADING_FAIL );				}			}		} );		// removeButton = new Button( buttonBar, SWT.PUSH );		// removeButton.setText( DLG_REMOVE_BUTTON );		// removeButton.setLayoutData( new GridData(		// GridData.HORIZONTAL_ALIGN_END ) );		// removeButton.addSelectionListener( new SelectionAdapter( ) {		//		// public void widgetSelected( SelectionEvent event )		// {		// int index = embeddedImageList.getSelectionIndex( );		// String imageName = embeddedImageList.getItem( index );		// try		// {		// reportHandle.dropImage( imageName );		// embeddedImageList.remove( imageName );		// }		// catch ( SemanticException e )		// {		// ExceptionHandler.handle( e );		// }		// if ( index >= embeddedImageList.getItemCount( ) )		// {//if the image		// // removed is		// // the last		// // image		// index = embeddedImageList.getItemCount( ) - 1;		// }		// if ( index != -1 )		// {//if there are images remained		// embeddedImageList.select( index );		// preview( );		// }		// else		// {// there's no image remained,update buttons		// clearPreivew( );		// updateButtons( );		// }		// }		// } );		initList( );	}