[EMF Forms] Renderer or Factory [message #1841910] |
Wed, 02 June 2021 15:50  |
Eclipse User |
|
|
|
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
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05071 seconds