Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] integrate Buttons for operations
[EMF Forms] integrate Buttons for operations [message #1755575] Sun, 05 March 2017 22:11 Go to next message
Jens Kutzsche is currently offline Jens KutzscheFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,

I would like to integrate a button into a form. This button should invokes an operation of the root data model object. I could neither find a button as view model element, nor a possibility to bind an operation to an element. If I want to write my own renderer for the button, then I miss the possibility to access the root data model element which is linked to the form.

Please give me a hint which is the recommended procedure for my purposes.

Best regards
Jens
Re: [EMF Forms] integrate Buttons for operations [message #1755725 is a reply to message #1755575] Tue, 07 March 2017 09:04 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 111
Registered: September 2016
Senior Member
Hi,

you can access the domain model using viewmodelContext.getDomainModel()

Best regards
Jonas

--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/


--
Jonas Helming
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] integrate Buttons for operations [message #1755741 is a reply to message #1755725] Tue, 07 March 2017 11:39 Go to previous messageGo to next message
Jens Kutzsche is currently offline Jens KutzscheFriend
Messages: 4
Registered: July 2009
Junior Member
Hi Jonas,

thank you for your answer. Is there also a way to create a reference to an operation in the view model? Otherwise I would have to write for each individual button one renderer, which knows the referenced operation.

Is there another recommended procedure to insert buttons in forms?

Best regards
Jens
Re: [EMF Forms] integrate Buttons for operations [message #1755815 is a reply to message #1755741] Wed, 08 March 2017 11:50 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 111
Registered: September 2016
Senior Member
Hi Jens,

absolutly! The view model itself is and EMF model. Further it has been designed in a very modular way, so it is absolutly possible to add new elements (e.g. action). We thought about adding this several times in the past. However, all use cases that we had so fra were actually actiosn which are directly related to an attribute and were therefore implemented within custom renderers. There might be a use case to really place button. Would be interesting to learn more about that.
About adding new view model elements: Best starting point would be to look at an existing element, which is not part of the code, e.g. "group" or "controlgrid". Adding a new view model element consists of:
1. Adding the model (the definition of the view model)
2. Adding a renderer + tests
3. Optionally adapting the tooling (as the view model editor uses EMF Forms itself, this is usually trivial)

Please note, that we use the "emfforms" namespace for new bundles rather then the "ecp" one.
Would be interesting to learn more about your plans!

Best regards

Jonas
--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/


--
Jonas Helming
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] integrate Buttons for operations [message #1758237 is a reply to message #1755815] Sat, 25 March 2017 13:41 Go to previous messageGo to next message
Jens Kutzsche is currently offline Jens KutzscheFriend
Messages: 4
Registered: July 2009
Junior Member
Hi Jonas,

thank you for your answer and sorry for my late answer, but I stopped my try with EMF Forms. My application has an to less formal UI and to many custom renderers would have been necessary. So other things were more important in recent weeks.

I use the MVVM Pattern for my application. I thought EMF Forms is perfect for this pattern if the framework renders my view model as UI and bind the widgets to the view model. My model has several operations e.g. for loading and saving of different file types and this actions should be buttons. So I missed the possibility to call an operation with a button.

Best regards
Jens
Re: [EMF Forms] integrate Buttons for operations [message #1758246 is a reply to message #1758237] Sat, 25 March 2017 18:32 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 111
Registered: September 2016
Senior Member
Hi Jens,

actually, adding a custom renderer ist usally not more work then implementing 2-3 occurences manually. The difference is that you can then very efficiently reuse that new concept anywhere. Extending the framework with custom renderers is a default case, so most projects do that.

Best regards

Jonas


--
Jonas Helming
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:EMF Refactor
Next Topic:[EMF/EMF Forms] RCP Dependencies / Requirements
Goto Forum:
  


Current Time: Thu May 02 14:05:47 GMT 2024

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

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

Back to the top