Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] Renderer or Factory (Adjusting functionality to the treemasterdetail)
[EMF Forms] Renderer or Factory [message #1841910] Wed, 02 June 2021 15:50 Go to next message
Eclipse UserFriend
I have been working with EMFForms for a couple months now and I have created an RCP e4 application with a treemasterdetail, of a half dozen views all with a nice layouts and validation. Works great.

Now I need to do a little customization of the treemasterdetail rendering. Specifically adding selection behavior so that when a user clicks a button on the GUI I have a handler in which it's execute method can get the current selected object in the tree and preform an action with it. Additionally, and secondarily I would like to adjust the "View Editor" title and "Details" title in the headers.

Currently using 1.25 of EMFForms.

So I first ran across this forum post that recommended subclassing the TreeMasterDetailSWTRenderer to adjust the header.
https://www.eclipse.org/forums/index.php/m/1726169/?srch=view+editor+header#msg_1726169
I started down this path and realized that the getPageHeader method and a class variable it was using was private which made me put a hold on this direction.

I then found this post mentioning the factory.
https://www.eclipse.org/forums/index.php/m/1726207/?srch=emf+forms#msg_1726207
Changed out the ECPSWTViewRenderer for the TreeMasterDetailSWTFactory in my part which returns a TreeMasterDetailComposite. I noticed that the factory did not create a top-level node for the tree, no header titles and as was documented no context selection. Things I would need to add back.

Question: Based on my use case which approach makes more sense, create a new renderer extending/copying the TreeMasterDetailSWTRenderer or use the TreeMasterDetailSWTFactory adding the capabilities the renderer had missing from the factory plus the capabilities I need or something else?

I have been trying to map the differences between the renderer and the factory and while experienced with EMF, I am a bit of beginner when it comes to UI work.

Looking to those with more experience. Any guidance is appreciated.

-Max
Re: [EMF Forms] Renderer or Factory [message #1841992 is a reply to message #1841910] Sun, 06 June 2021 10:01 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

it seems you have already digged pretty deep and came up with two viable solutions. If it is only one private method prevents the first option, it sounds simple, while the second sounds more clean and flexible. Please keep in mind that the framework is open source, so you can adapt it to your needs. That means you can make the method protected or extend the factory with the part that is missing.

Best regards,
Jonas
Re: [EMF Forms] Renderer or Factory [message #1842083 is a reply to message #1841992] Tue, 08 June 2021 13:55 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Jonas

I dug even further and ended up using the factory (with TreeMasterDetailSWTCustomization) and the returned composite to get most of what I needed. Grabbed the treeviewer for the last bit with the idea of extending the factory later. Works great for now for this prototype.

Best Regards,

Max


Re: [EMF Forms] Renderer or Factory [message #1842143 is a reply to message #1842083] Thu, 10 June 2021 03:39 Go to previous message
Eclipse UserFriend
Sounds great!

Best regards,
Jonas
Previous Topic:[EMF Forms]
Next Topic:Use Edapt to migrate one model to another one?
Goto Forum:
  


Current Time: Wed Jul 02 14:40:22 EDT 2025

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

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

Back to the top