Template selTemplate = templateChoicePage.getTemplate( ); String fullName = selTemplate.getReportFullName( ); URL url = Platform.find( Platform.getBundle( ReportPlugin.REPORT_UI ), new Path(fullName ) ); if ( url != null ) { try { streamFromPage = url.openStream( ); } catch ( IOException e1 ) {  } } else { try { streamFromPage = new FileInputStream( fullName ); } catch ( FileNotFoundException e ) { } }
ReportDesignHandle selTemplate = templateChoicePage.getTemplate( ); final String templateName = selTemplate.getFileName( );
	public boolean performFinish( )	{		final IPath containerName = newReportFileWizardPage.getContainerFullPath( );		String fn = newReportFileWizardPage.getFileName( );		final String fileName;		if ( !fn.endsWith( "." + fileExtension ) ) //$NON-NLS-1$		{			fileName = fn + "." + fileExtension; //$NON-NLS-1$		}		else		{			fileName = fn;		}		InputStream streamFromPage = null;		String cheatSheetIdFromPage = "";//$NON-NLS-1$		boolean showCheatSheetFromPage = false;		// Temporary remark the choice page for that feature is not supported in		// R1		// if ( choicePage.isBlank( ) )		// {		// // blank report		// URL url = Platform.find( Platform.getBundle( ReportPlugin.REPORT_UI		// ),		// new Path( templateChoicePage.getBlankTemplate( ).reportPath ) );		// if ( url != null )		// {		// try		// {		// streamFromPage = url.openStream( );		// }		// catch ( IOException e1 )		// {		// //ignore.		// }		// }		//		// cheatSheetIdFromPage = templateChoicePage.getBlankTemplate(		// ).cheatSheetId;		// showCheatSheetFromPage = false;		// }		// else if ( !choicePage.isCustom( ) )		// {		// predefined template		Template selTemplate = templateChoicePage.getTemplate( );		String fullName = selTemplate.getReportFullName( );		URL url = Platform.find( Platform.getBundle( ReportPlugin.REPORT_UI ),				new Path(fullName ) );		if ( url != null )		{			try			{				streamFromPage = url.openStream( );			}			catch ( IOException e1 )			{				// ignore.			}		}		else		{			try			{				streamFromPage = new FileInputStream( fullName );			}			catch ( FileNotFoundException e )			{			}		}		cheatSheetIdFromPage = templateChoicePage.getTemplate( )				.getCheatSheetId( );		showCheatSheetFromPage = templateChoicePage.getShowCheatSheet( );		// Temporary remark the choice page for that feature is not supported in		// R1		// }		// else		// {		// // custom template		// try		// {		// streamFromPage = new FileInputStream(		// customTemplatePage.getReportPath( ) );		// String xmlPath = customTemplatePage.getReportPath( )		// .replaceFirst( ".rptdesign", ".xml" );		// File f = new File( xmlPath );		// if ( f.exists( ) )		// {		// cheatSheetIdFromPage = f.toURL( ).toString( );		// // commented out until opencheatsheetaction bug is fixed in		// // eclipse		// // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88481		// // showCheatSheetFromPage =		// // customTemplatePage.getShowCheatSheet( );		// }		//		// }		// catch ( Exception e )		// {		// ExceptionHandler.handle( e );		// return false;		// }		// }		final InputStream stream = streamFromPage;		final String cheatSheetId = cheatSheetIdFromPage;		final boolean showCheatSheet = showCheatSheetFromPage;		IRunnableWithProgress op = new IRunnableWithProgress( ) {			public void run( IProgressMonitor monitor )					throws InvocationTargetException			{				try				{					doFinish( containerName,							fileName,							stream,							cheatSheetId,							showCheatSheet,							monitor );				}				catch ( CoreException e )				{					throw new InvocationTargetException( e );				}				finally				{					monitor.done( );				}			}		};		try		{			getContainer( ).run( true, false, op );		}		catch ( InterruptedException e )		{			return false;		}		catch ( InvocationTargetException e )		{			Throwable realException = e.getTargetException( );			ExceptionHandler.handle( realException );			return false;		}		return true;	}