Skip to main content


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 15:35 Go to next message
Alex Kipling is currently offline Alex KiplingFriend
Messages: 260
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 15:47 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
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 11:57 Go to previous messageGo to next message
Alex Kipling is currently offline Alex KiplingFriend
Messages: 260
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 11: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 12:00 Go to previous messageGo to next message
Eclipse UserFriend
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 17:36 Go to previous messageGo to next message
Alex Kipling is currently offline Alex KiplingFriend
Messages: 260
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 20:39 Go to previous messageGo to next message
Eclipse UserFriend
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 13:26 Go to previous message
Alex Kipling is currently offline Alex KiplingFriend
Messages: 260
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: Thu Apr 18 12:22:20 GMT 2024

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

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

Back to the top