Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Does e4 support opening a view in a dialog shell?!
icon3.gif  Does e4 support opening a view in a dialog shell?! [message #959059] Fri, 26 October 2012 08:26 Go to next message
Justin Dolezy is currently offline Justin Dolezy
Messages: 68
Registered: July 2009
Member
Just back from a great EclipseCon Europe, so now have a pile of reading to do and questions to ask!

So, I'm wondering: is it possible to directly open/show a view part in a dialog shell?

The use-case is to open the tabbed properties view in a modeless tool-style window. With 3.x I've achieved this by hacking extra 'API' into my own copy of the workbench plugin to allow this via DetatchedWindow. Obviously ugly and makes upgrading my platform a real pain... so I really want to get away from this!

Is this something e4 makes possible perhaps?
Or perhaps it's achievable using internal API instead of having to modify it?!

Thanks,
Justin
Re: Does e4 support opening a view in a dialog shell?! [message #959081 is a reply to message #959059] Fri, 26 October 2012 08:47 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1236
Registered: July 2012
Senior Member
Hi Justin,

not quite sure if I understand what you mean. But as you were in the Eclipse 4 tutorial, have you tried if it fits your needs if you simply add a Window under the Windows section in your application model, and only add a part to that window?

Maybe it would be helpful if you attach some kind of screenshot so we understand what exactly you are trying to achieve.

Greez,
Dirk
Re: Does e4 support opening a view in a dialog shell?! [message #959088 is a reply to message #959059] Fri, 26 October 2012 08:47 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5262
Registered: July 2009
Senior Member
Take a look how we host the css editor into the preference dialog. IIRC
it uses EModelService#hostElement()

Tom

Am 26.10.12 14:26, schrieb Justin Dolezy:
> Just back from a great EclipseCon Europe, so now have a pile of reading
> to do and questions to ask!
>
> So, I'm wondering: is it possible to directly open/show a view part in a
> dialog shell?
>
> The use-case is to open the tabbed properties view in a modeless
> tool-style window. With 3.x I've achieved this by hacking extra 'API'
> into my own copy of the workbench plugin to allow this via
> DetatchedWindow. Obviously ugly and makes upgrading my platform a real
> pain... so I really want to get away from this!
>
> Is this something e4 makes possible perhaps?
> Or perhaps it's achievable using internal API instead of having to
> modify it?!
>
> Thanks,
> Justin
Re: Does e4 support opening a view in a dialog shell?! [message #959228 is a reply to message #959088] Fri, 26 October 2012 10:59 Go to previous messageGo to next message
Justin Dolezy is currently offline Justin Dolezy
Messages: 68
Registered: July 2009
Member
@Dirk
I suppose that might be worth a try, but I'm guessing that'll produce a reqular framed window? I don't see options in the XMI editor for the shell styles I need - STW.TOOL & SWT.ON_TOP, so presumably I still need to create the shell myself directly...

@Tom
That sounds like just what I'nd need - hopefully Smile Have tracked the CSS editor to a ViewPreferencesPage tweaklet contrib: CSSEditorPreferences, but I don't seem to have source for org.eclipse.e4.tools.css.editor.ui. I guess I need to clone this from git somewhere?
Re: Does e4 support opening a view in a dialog shell?! [message #959398 is a reply to message #959228] Fri, 26 October 2012 13:35 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph Keimel
Messages: 335
Registered: December 2010
Location: Germany
Senior Member
Since the part class is just a POJO, you could just reuse it.
1) In the dialog: create a child context
2) Put the Composite of the dialog in the context where you want your part controls to be created
3) Call ContextInjectionFactory.make to create the part
Re: Does e4 support opening a view in a dialog shell?! [message #960353 is a reply to message #959398] Sat, 27 October 2012 07:58 Go to previous messageGo to next message
Justin Dolezy is currently offline Justin Dolezy
Messages: 68
Registered: July 2009
Member
@Christoph
Sounds simple, but being new to e4 you lost me at step 1! Guess that's IEclipseContext.createChild(), right?

Maybe I should get some more reading done and then come back to this, but it sounds like there's a few possibilities which is great; e4 is looking like it's very flexible and will help solve a few of my pet problems!
Re: Does e4 support opening a view in a dialog shell?! [message #961401 is a reply to message #960353] Sun, 28 October 2012 04:32 Go to previous message
Christoph Keimel is currently offline Christoph Keimel
Messages: 335
Registered: December 2010
Location: Germany
Senior Member
@Justin: Yeah, that's my thinking. A part contribution gets the Composite injected, where it can create it's controls. So all you have to do is give it a context with your the Composite where you want the controls to go.
Previous Topic:Manually triggering a class with injections?
Next Topic:SWT deprecated in Eclipse 4
Goto Forum:
  


Current Time: Fri Aug 01 20:26:32 EDT 2014

Powered by FUDForum. Page generated in 0.02071 seconds