简体   繁体   English

如何在启动时在Eclipse Ganymede中显示无用户输入的帮助视图?

[英]How to show Help View at startup without User Input in Eclipse Ganymede?

My work requires me to develop for Eclipse 3.4 (ganymede). 我的工作需要我为Eclipse 3.4(ganymede)开发。 I would like to show the Help View from the Eclipse Help System at startup in my perspective. 我希望从启动时的角度显示Eclipse帮助系统中的帮助视图。

Trying to do it like this: 尝试这样做:

public class Perspective implements IPerspectiveFactory {

    public void createInitialLayout(IPageLayout layout) {

        layout.setEditorAreaVisible(true);
        IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, IPageLayout.DEFAULT_VIEW_RATIO, IPageLayout.ID_EDITOR_AREA);
        left.addView(WorkspaceViewMock.ID);
        layout.addView("org.eclipse.help.ui.HelpView", IPageLayout.RIGHT, IPageLayout.DEFAULT_VIEW_RATIO, IPageLayout.ID_EDITOR_AREA);


    }
}

will not result in the desired result, but rather give me a message in the log file: 不会得到理想的结果,而是在日志文件中给我一条消息:

!MESSAGE Part already exists in page layout: org.eclipse.help.ui.HelpView.

So how do I show the Help View now? 那么,如何立即显示“帮助视图”?

You can remove the line where you're adding the HelpView to your layout (as the message you're getting indicates, it's already in there): 您可以删除将HelpView添加到布局中的行(如所收到的消息所示,该行已在其中):

layout.addView("org.eclipse.help.ui.HelpView", ...);


To show the HelpView, try adding this to your ApplicationWorkbenchAdvisor.postStartup() method: 要显示HelpView,请尝试将其添加到ApplicationWorkbenchAdvisor.postStartup()方法中:

@Override
public void postStartup() {
    :
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        page.showView("org.eclipse.help.ui.HelpView");
    :
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM