String key = ( (Template) templates.get( selectedIndex ) ).getPicturePath( ); key = convertFileName2Absolute(key);
Template selTemplate = (Template) templates.get( selectedIndex ); String key = selTemplate.getPicturePath( );
		public void handleEvent( Event event )		{			// change description/image			selectedIndex = templateList.getSelectionIndex( );			description.setText( ( (Template) templates.get( selectedIndex ) ).getTemplateDescription( ) );			// we need to relayout if the new text has different number of lines			previewPane.layout( );			String key = ( (Template) templates.get( selectedIndex ) ).getPicturePath( );			key = convertFileName2Absolute(key);			Object img = null;			if ( key == null || "".equals( key.trim( ) ) ) //$NON-NLS-1$			{				previewCanvas.setVisible( false );				previewThumbnail.setVisible( true );				Control[] children = previewThumbnail.getChildren( );				for ( int i = 0; i < children.length; i++ )				{					children[i].dispose( );				}				ReportGraphicsViewComposite thumbnail = new ReportGraphicsViewComposite( previewThumbnail,						SWT.NULL,						( (Template) templates.get( selectedIndex ) ).getReportDesignHandle( ) );				previewThumbnail.layout( );			}			else			{				img = imageMap.get( key );				if ( img == null )				{					img = ReportPlugin.getImage( key );					imageMap.put( key, img );				}				previewCanvas.setVisible( true );				previewThumbnail.setVisible( false );				previewCanvas.clear( );				previewCanvas.loadImage( ( (Image) img ) );				previewCanvas.showOriginal( );			}			chkBox.setEnabled( !( ( (Template) templates.get( selectedIndex ) ).getCheatSheetId( )					.equals( "" ) || ( (Template) templates.get( selectedIndex ) ).getCheatSheetId( )					.equals( "org.eclipse.birt.report.designer.ui.cheatsheet.firstreport" ) ) ); //$NON-NLS-1$		}