Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to open multiple workbench windows?
icon5.gif  How to open multiple workbench windows? [message #1016858] Thu, 07 March 2013 22:44 Go to next message
Guido Schnepp is currently offline Guido SchneppFriend
Messages: 2
Registered: March 2013
Junior Member
Hi all,

is it still possible to open different windows (pages?) in E4 from a single Workbench? So I don'T talk about additional editors or views, but full Workbench windows. I've a fairly complex UI built with different PartSashContainers, PartStacks and Parts building an associated set of parts for my new RCP app. Now I need to open this full set of parts multiple times, one for each file the users wants to work with (if the user opens three files, this full set has to be shown three times, one per workbench window each). I could restart the full workbench three times, but there must be a more elegant way. Using complex editor parts seem's not to be a good solution either, since I'd lose the flexibility of user-arranged tabs and subwindows then. To hold everthing together, I'm thinking about a launcher object with main menu, if the product starts without file.

I've googled around a few hours, but only find 3.x samples using the PlatformUI.getWorkbench().openWorkbenchWindow(...) way. Since PlatformUI is no longer part of E4, I maybe just don't know what object to inject to get a similar functionality. While there are different samples available using EPartService to clone parts and switch Perspectives, I don't feel to be able to open additional Workbench windows this way (Q: To find the Workbench object, what search string/id do I have to use?)

Thanks in advance,
Guido
Re: How to open multiple workbench windows? [message #1021930 is a reply to message #1016858] Thu, 21 March 2013 00:09 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 418
Registered: July 2009
Senior Member
Hi Guido,

I think you can use the EModelService. Experiment with findElements and
Cloneelement.

Best regards,

Wim


> Hi all,
>
> is it still possible to open different windows (pages?) in E4 from a single
Workbench? So I don'T talk about additional editors or views, but full
Workbench windows. I've a fairly complex UI built with different
PartSashContainers, PartStacks and Parts building an associated set of parts
for my new RCP app. Now I need to open this full set of parts multiple times,
one for each file the users wants to work with (if the user opens three
files, this full set has to be shown three times, one per workbench window
each). I could restart the full workbench three times, but there must be a
more elegant way. Using complex editor parts seem's not to be a good solution
either, since I'd lose the flexibility of user-arranged tabs and subwindows
then. To hold everthing together, I'm thinking about a launcher object with
main menu, if the product starts without file.
>
> I've googled around a few hours, but only find 3.x samples using the
PlatformUI.getWorkbench().openWorkbenchWindow(...) way. Since PlatformUI is
no longer part of E4, I maybe just don't know what object to inject to get a
similar functionality. While there are different samples available using
EPartService to clone parts and switch Perspectives, I don't feel to be able
to open additional Workbench windows this way (Q: To find the Workbench
object, what search string/id do I have to use?)
>
> Thanks in advance,
> Guido
Re: How to open multiple workbench windows? [message #1022642 is a reply to message #1021930] Fri, 22 March 2013 09:26 Go to previous messageGo to next message
Guido Schnepp is currently offline Guido SchneppFriend
Messages: 2
Registered: March 2013
Junior Member
Wim,

thank you very much! The following code works for me (as a first test). A new workbench window is opened on exactly the same position of the old:

MUIElement otw = ms.find("com.lookup2.streams.trimmedwindow.0", application);
MWindow ntw = (MWindow) ms.cloneElement(otw, application);
ntw.setToBeRendered(true);
ntw.setVisible(true);
ntw.setOnTop(true);
application.getChildren().add(ntw);
ms.bringToTop(ntw);

Thanks,
Guido

P.S. Are you the same Wim from Netherlands sitting in back of my class held by Lars in Berlin last autumn?
Re: Re: How to open multiple workbench windows? [message #1022739 is a reply to message #1022642] Fri, 22 March 2013 12:56 Go to previous message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 418
Registered: July 2009
Senior Member
Hi Guido,

> thank you very much! The following code works for me (as a first test). A
new workbench window is opened on exactly the same position of the old:

Great. You can use the model to alter the positions of the window.

> P.S. Are you the same Wim from Netherlands sitting in back of my class held
by Lars in Berlin last autumn?

Yes I am. Glad to see you working on e4.

Best regards,

Wim
Previous Topic:Project Explorer View
Next Topic:Question about the tabbed properties view
Goto Forum:
  


Current Time: Sun Dec 21 10:58:26 GMT 2014

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

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