0
votes

I am developing a mixed rcp application.
with the following tutorial I am able to open Pydev Perspective using 3.x commands

Eclipse rcp e4 with 3.x views, etc

...
OpenPerspective("org.python.pydev.ui.PythonPerspective");
...

public static void OpenPerspective(String idPerspective) 
{
    IPerspectiveDescriptor[] perspectives = 
    PlatformUI.getWorkbench().getPerspectiveRegistry().getPerspectives();
    IPerspectiveDescriptor per = null;
    IWorkbenchPage page = getActivePage();

    for (IPerspectiveDescriptor descriptor : perspectives) {
        if (descriptor.getId().equals(idPerspective)) {
            per = descriptor;
        }
    }

    if (page != null) {
        page.setPerspective(per);
    } else {
    }
}

private static IWorkbenchPage getActivePage() 
{
    IWorkbenchPage result = null;
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window != null) {
        result = window.getActivePage();
    }
    return result;
}

I am having a problem when i add a menu in Application.e4xmi, i ran the product and all is ok. In the second run the main toolbar disappear.

I find that is related with the following bug

https://bugs.eclipse.org/bugs/show_bug.cgi?id=388808

but i can't make work the workaround.

Anybody have a good example, step by step how make work the workaround. Thanks

1

1 Answers

0
votes

You have to add the mentioned ForceMainMenuProcessor to the org.eclipse.e4.workbench.model - extension point as a processor (with beforefragment:true and apply:always).

You can do so in your plugin.xml under tab "Extensions":

Hit the "Add..." Button, search for org.eclipse.e4.workbench.model and add it with ID=MainAppModel. plugin xml 1 Right-click on the extension lets you add a processor. plugin xml 2

Provided that you dropped the class ForceMainMenuProcessor in package my.package of your plugin.