Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Open editor in split view by code
Open editor in split view by code [message #989253] Wed, 05 December 2012 06:05 Go to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

how can I open an editor in splitview by code. This means the editor I open shall be positioned next to the editor that is already open. There is a code snippet for Eclipse 3 http://www.eclipse.org/forums/index.php/m/705113/#msg_705113 but I cannot find some of the classes like EditorSashContainer.

Thanks!

Ralph
Re: Open editor in split view by code [message #989748 is a reply to message #989253] Fri, 07 December 2012 09:00 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de Alwis
Messages: 181
Registered: January 2012
Senior Member

You'll need to use the EModelService. Basically you need to create a new part stack, add your new editor to that stack, and then insert the new part stack to the left or right of the part stack containing the other editor using the model service.

Brian,


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Re: Open editor in split view by code [message #991844 is a reply to message #989748] Thu, 20 December 2012 05:33 Go to previous message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

thanks for the reply. I use the following code to try and find an open editor:

EModelService modelService = (EModelService)PlatformUI.getWorkbench().getService(EModelService.class);
MApplication app = (MApplication)PlatformUI.getWorkbench().getService(MApplication.class);
MUIElement uiElement = (MUIElement)modelService.find("id from org.eclipse.ui.editors", app);


This, however, returns a MToolbar instead of an editor. Do you have a plan what goes wrong there?

Ralph

[Updated on: Thu, 20 December 2012 05:34]

Report message to a moderator

Previous Topic:Menu Contribution multiple Parent-Ids possible?
Next Topic:Part / Menus / Menu where does it go?
Goto Forum:
  


Current Time: Thu Aug 28 01:23:38 EDT 2014

Powered by FUDForum. Page generated in 0.26728 seconds