Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EEF/User Guide/Custom Element Editor"
(→CustomElementEditor in the EEF views model) |
|||
Line 24: | Line 24: | ||
[[Image:EEF_SampleCEE_Componentsmodelchange.png | Referencing the CustomElementEditor in the associated PropertiesEditionElement]] | [[Image:EEF_SampleCEE_Componentsmodelchange.png | Referencing the CustomElementEditor in the associated PropertiesEditionElement]] | ||
+ | |||
+ | These changes made, we can regenerate the EEF code. |
Revision as of 06:59, 5 January 2012
Need of new widget ?
EEF generators offer a set of widget to build EMF editing forms. Sometime other widget needs appear to create more efficient GUIs. In this case, EEF users can employ CustomElementEditor to generate user code areas inside the EEF properties code.
Let's start this sample with this sample Ecore model :
By following the first generation tutorial, EEF generates theses forms :
Now suppose we want to use a spinner instead of a Text for the age entry. Spinners aren't yet available in the EEF generation. We can, in this case use a CustomElementEditor.
CustomElementEditor in the EEF views model
The first step is to replace the ElementEditor generated by the EEF Initializer with a CustomElementEditor. This must be done in the View associated to our EClass Person, the "Person" View.
The removed ElementEditor was defined as the view of the "age" PropertiesEditionElement of the "Person" PropertiesEditionComponent. We need to define our CustomElementEditor as the new "age" PropertiesEditionElement view.
These changes made, we can regenerate the EEF code.