Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Parts nested within of a SWT Widget?
Parts nested within of a SWT Widget? [message #991173] Mon, 17 December 2012 10:35 Go to next message
Alex Kipling is currently offline Alex Kipling
Messages: 250
Registered: July 2012
Senior Member
Is it possible to nest Model elements (Parts) within of SWT widgets?

The background of the question: I have my own SWT Widget, which provides the container for my application. Inside of this Widget I would add some parts.
Re: Parts nested within of a SWT Widget? [message #991180 is a reply to message #991173] Mon, 17 December 2012 10:47 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1255
Registered: July 2012
Senior Member
Well, as a part is a POJO, you can reuse it wherever you want. But I guess then it wouldn't be a part anymore in terms of the application model. Wink
Re: Parts nested within of a SWT Widget? [message #991293 is a reply to message #991173] Tue, 18 December 2012 06:57 Go to previous messageGo to next message
Alex Kipling is currently offline Alex Kipling
Messages: 250
Registered: July 2012
Senior Member
Ok, maybe I should reformulate my question:

I have a hierarchy of parts.

part1
-> part2
--> part3
--> part4
--> part5

I have some custom behaviour for the part2. For now I have an SWT Widget, which behaves like that.

Is it possible to implement an own part container?
One which would layout parts,
which could be added to the model.
With other words - is it possible to turn an SWT Widget into a PartContainer?

[Updated on: Tue, 18 December 2012 06:57]

Report message to a moderator

Re: Parts nested within of a SWT Widget? [message #991294 is a reply to message #991293] Tue, 18 December 2012 07:00 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 597
Registered: December 2010
Senior Member

There is a class (renderer class) which transforms a MPart into a SWT composite (ContributedPartRenderer). Override that? http://www.vogella.com/articles/Eclipse4Renderer/article.html It's not trivial but you have unlimited power.
Re: Parts nested within of a SWT Widget? [message #991362 is a reply to message #991294] Tue, 18 December 2012 12:36 Go to previous messageGo to next message
Alex Kipling is currently offline Alex Kipling
Messages: 250
Registered: July 2012
Senior Member
And will it be possible to use my own containers inside the e4 Application Model editor? Where do the Modelconteiners inside the Editor come from?
Re: Parts nested within of a SWT Widget? [message #991386 is a reply to message #991362] Tue, 18 December 2012 15:39 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot Cela
Messages: 597
Registered: December 2010
Senior Member

Modelconteiners? You mean those elements in the tree on the left?

You of course can extend the model, provide your own MMyFancyPartStack or MCustomPart and provide a renderer for it to tell the framework how to translate the model into a widget. If you want editor support in the tooling for your new model element you can supply an extension to tell the e4 editor how to edit it.

For the first and second you can find tutorials online. For the editor support I implemented a sample one here https://github.com/semanticsoft/vaaclipse/pull/4
Re: Parts nested within of a SWT Widget? [message #991490 is a reply to message #991386] Wed, 19 December 2012 08:26 Go to previous message
Alex Kipling is currently offline Alex Kipling
Messages: 250
Registered: July 2012
Senior Member
Thnk you very much!
Previous Topic:Tab placement always remove most used window
Next Topic:Menu Contribution multiple Parent-Ids possible?
Goto Forum:
  


Current Time: Fri Aug 22 06:06:04 EDT 2014

Powered by FUDForum. Page generated in 0.01596 seconds