RCP中打开一个rptdesign的报表

			String id =  "org.eclipse.birt.report.designer.ui.editors.ReportEditor";  
			IProject project = null;
			IPath location = null;   
		 
			project = FileHelper.getReportPath();
			location = project.getLocation();
			location = location.append(reportName+ ".rptdesign");
			File file = location.makeAbsolute().toFile();
			String absultePath = file.getAbsolutePath();  
                           
			IFile iFile = project.getFile(location.lastSegment());
			FileEditorInput fileEditorInput = new FileEditorInput(iFile);
			PlatformUI.getWorkbench().getActiveWorkbenchWindow()
					.getActivePage().openEditor(fileEditorInput, id);



它需要调用的方法:
		 FileHelper.getReportPath(){
		 //导出产品xxx[默认为eclipse]目录下的文件夹Report
			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
			IProject project = root.getProject("Report");
			if (!project.exists()) {
				project.create(null);
			}
			if (!project.isOpen()) {
				project.open(null);
			}
			return project;
		 }

你可能感兴趣的:(java,eclipse,UI)