Plugins 从RCP应用程序的“帮助”菜单中打开pdf

Plugins 从RCP应用程序的“帮助”菜单中打开pdf,plugins,swt,Plugins,Swt,我在我的RCP应用程序中包含了ActionFactory的HELP_内容操作,但我希望在应用程序中调用它时打开一个PDF文件,而不是普通的xml文件。可能吗?我没有在网上找到任何示例。如果您使用HelpContentsAction,那么您将获得Eclipse帮助。如果要显示自己的文件,请创建自己的操作(如果需要,可以重用图标和文本) 使用。openEditor(ieditorinputinput,stringeditorid)方法打开PDF文件: org.eclipse.core.resourc

我在我的RCP应用程序中包含了ActionFactory的HELP_内容操作,但我希望在应用程序中调用它时打开一个PDF文件,而不是普通的xml文件。可能吗?我没有在网上找到任何示例。

如果您使用
HelpContentsAction
,那么您将获得Eclipse帮助。如果要显示自己的文件,请创建自己的操作(如果需要,可以重用图标和文本)

使用。
openEditor(ieditorinputinput,stringeditorid)
方法打开PDF文件:

org.eclipse.core.resources.IFile workspaceFile;
java.io.File externalFile;

//PDF in workspace
IEditorInput input = new FileEditorInput(workspaceFile);
//or external
IFileSystem fs = org.eclipse.core.filesystem.EFS.getLocalFileSystem();
IFileStore fileStore = fs.fromLocalFile(externalFile);
input = new FileStoreEditorInput(fileStore);

IWorkbenchPage page =
  PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.openEditor(input, IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID);