My work requires me to develop for Eclipse 3.4 (ganymede). I would like to show the Help View from the Eclipse Help System at startup in my perspective.

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):

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


To show the HelpView, try adding this to your ApplicationWorkbenchAdvisor.postStartup() method:

@Override
public void postStartup() {
    :
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        page.showView("org.eclipse.help.ui.HelpView");
    :
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top