Generic Form Editor Pages [message #733423] |
Tue, 04 October 2011 13:21  |
Eclipse User |
|
|
|
Hey all,
I was wondering if there were any plans to support generic form editor pages, in addition to the existing master/details editor pages.
I have started working on something like this, but it is very crude at the moment. I've created a model element representing the page, which contains any number of sections. This is working OK, but I suspect I will have some issues with respect to how the model is incorporated into sections, e.g.: the section applies to a model element other than the root; the section's root element is based on the current selection in another section; the required element does not exist; etc.
As a newb, I'm not sure of the best way to handle these issues. Any advice would be greatly appreciated.
Best,
Rob
|
|
|
|
|
|
Re: Generic Form Editor Pages [message #733754 is a reply to message #733680] |
Wed, 05 October 2011 11:01   |
Eclipse User |
|
|
|
Quote:Regarding missing elements, I'm looking at adding a way to include some sort of create functionality into the form section. Something like this may already be supported through existing constructs. An example use case: a section supports editing a child element, which is optional. The section controls should be disabled or hidden if the element does not exist, but also allow for the creation of the element in that case. When the element is created, the controls should become enabled or visible.
The with construct handles this scenario. When using a regular element property, it will render controls for creating/deleting the element in addition to whatever property editors you wish to show when the element is present. The controlling controls will differ depending on your element property. If it has exactly one possible element type, it will be a checkbox. If it has a few possible element types, it will be a group of radio buttons. If it has many possible element types, it will be a drop-down list.
See presentation of Assistant property in the contacts sample (ContactsDatabaseEditor.sdef).
Quote:I'm using the "with" construct, too. However I was only able to use it with the "ImpliedElementProperty" annotation. Is there any hint for using it with normal ElementProperty annotations?
When using the with construct with regular element properties, you have to create a page for every element type that could be contained in that property. See the above referenced sample. With implied element properties, you commonly utilize the default panel. With regular element properties, the default panel is for the case when the element property holds no element.
- Konstantin
|
|
|
|
|
|
|
|
Re: Generic Form Editor Pages [message #754332 is a reply to message #734992] |
Wed, 02 November 2011 04:21  |
Eclipse User |
|
|
|
Hey Konstantin,
We are expanding our use of sapphire to include several properties file editors so the ability to have a form editor page without the master-detail layout would be nice. I've added myself to CC for the enhancement request. Thanks Rob for starting this thread.
[Updated on: Wed, 02 November 2011 04:21] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.08973 seconds