Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Views open in wrong pane when using v3.x compatibilty layer(Wildcards don't match viewpart IDs / explicit IDs don't work either)
Views open in wrong pane when using v3.x compatibilty layer [message #1768163] Fri, 14 July 2017 09:00
Michael Moser is currently offline Michael MoserFriend
Messages: 29
Registered: October 2012
Location: Z├╝rich, Switzerland
Junior Member
We are migrating an older v3.x RCP application that monitors misc. EMS queues and topics to v4.x. The v3.x compatibility layer works well except that views (viewparts) open in the wrong pane (or "layout folder").

Our perspective so far defined two "folders":
an upper "main area" and a lower "consoleFolder". The "consoleFolder" was just for the console view, "main area" for everything else.

The correct placement was achieved by adding the line
    main.addPlaceholder("*"); //$NON-NLS-1$
to the main folder definition.

This doesn't work with v4.x and all views opened later by the user appear in the lower "consoleFolder"-pane. As a Workaround I also tried to "pre-register" all potential views by adding placeholders using their explicit ids, but that doesn't work, either!

How can I force the appearance of additional views in the first "main" folder without major changes to my existing code base?

For reference: the below is my current class, containing both, addPlaceholder(...) by Wildcard and addPlaceholder(...) by explicit ID, but neither of these works!

Any ideas or suggestions?


public class Perspective implements IPerspectiveFactory {

  @Override
  public void createInitialLayout(final IPageLayout layout) {
    layout.setEditorAreaVisible(false);
    layout.setFixed(false);

    final IFolderLayout main = layout.createFolder("main area", IPageLayout.TOP, 0.7f, layout.getEditorArea()); //$NON-NLS-1$
    main.addView(IPadMockViewPart.ID);
    main.addPlaceholder("*"); //$NON-NLS-1$

    // the addPlaceHolder(...) with wildcards does not work in Eclipse 4.x (see bug https://www.eclipse.org/forums/index.php/t/358552/)
    // thus trying to add individual placeholders: - this doesn't work, either :-(
    main.addPlaceholder(EmsConnectionStatusViewPart.ID);
    main.addPlaceholder(EmsDeliveryStatusViewPart.ID);
    main.addPlaceholder(EmsQueueViewPart.ID);
    main.addPlaceholder(EmsTopicViewPart.ID);
    main.addPlaceholder(EmsQueueSenderViewPart.ID);

    final IFolderLayout consoleFolder = layout.createFolder("console area", IPageLayout.BOTTOM, 0.3f, //$NON-NLS-1$
        layout.getEditorArea());
    consoleFolder.addView(ConsoleViewPart.ID);
  }
}

[Updated on: Fri, 14 July 2017 09:03]

Report message to a moderator

Previous Topic:[SOLVED] Workbench: Could not run processor
Next Topic:Problem with combination of restoring state + processing fragments with placeholders
Goto Forum:
  


Current Time: Sat Nov 25 02:20:15 GMT 2017

Powered by FUDForum. Page generated in 0.01946 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software