Home » Eclipse Projects » Sirius » [Properties View] Using Custom Widget
[Properties View] Using Custom Widget [message #1740205] |
Wed, 10 August 2016 08:52  |
Eclipse User |
|
|
|
Hi,
I am trying out the new properties view and i can't find any information about using the "Custom Widget" widget. I would like to embed an Xtext editor in the properties view, but i am not sure how it can be done with the tools provided. Is there any example or related documentation somewhere regarding the topic?
Thanks for the help!
Robert
|
|
|
Re: [Properties View] Using Custom Widget [message #1740279 is a reply to message #1740205] |
Thu, 11 August 2016 03:50   |
Eclipse User |
|
|
|
Hi.
In the experimental version released with Sirius 4.0, support for custom widgets is relatively raw. If you want to create such a widget, most stuff happens on the EEF side, and the Sirius-side part (in the VSM) only indicates which EEF extension to use and which configuration parameters to pass to it.
You can find some documentation on the EEF side at https://eclipse.org/eef/#/documentation/1.6.0/language/widgets#customwidgets and https://eclipse.org/eef/#/documentation/1.6.0/developerguide/extensionpoints#eeflifecyclemanagerprovider. There's also an example "color picker" widget in the EEF sources at https://git.eclipse.org/c/eef/org.eclipse.eef.git/tree/samples/org.eclipse.eef.sample.custom.widget.colorpicker.
To use it on the Sirius-side, you must define a CustomWidget element in your VSM, which references the id of the EEF-side extension which registers the widget, and inside the CustomWidget create and fill any CustomExpression that the widget requires to work (the name and meaning of them will depend on each widget).
Note that in the next version (Sirius 4.1 planned later this year) will have better support for this use case (custom widgets), with the added possibility to define your own extension of the VSM language, to expose more complex configurablity in a user-friendly way on the Sirius VSM side. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=496057 for more details.
Regards,
Pierre-Charles
|
|
| | |
Re: [Properties View] Using Custom Widget [message #1741653 is a reply to message #1741500] |
Fri, 26 August 2016 11:22   |
Eclipse User |
|
|
|
Hi,
thank you for the help, after some trial and error and managed to set up this example, and I think I understand how it works internally. However, I would like to give some feedback about features that made it hard to work with the feature:
1. The model-specific properties are not visible in the Properties view of the .odesign editor at all. They are not added to the nice Properties view automatically, and the default table-based editor is also not visible on a tab. I had to open it on a separate EMF Reflective Editor to enter the configuration values.
2. At first I have entered some incorrect values as parameters (e.g. referred to an EAttribute instead of an EReference). As a result, the widget has not appeared, neither any error message, log entry or exception in the background. The only way to figure out what happened to use the debugger and find out which methods are called or not. At least I'd recommend adding a default error widget that no corresponding IEEFLifecycleManagerProvider could return any widget, but even better would be if the LifecycleManagers could return some structured error information. Or is it the responsibility of the lifecycle provider to return a widget with the error message? If yes, then the ExtReference example does not fulfill this contract.
I hope, this feedback is useful.
Best regards,
Zoltán
|
|
| |
Re: [Properties View] Using Custom Widget [message #1741826 is a reply to message #1741736] |
Mon, 29 August 2016 18:13  |
Eclipse User |
|
|
|
Hi,
1- I see, then it must have been some configuration error on my end that this did not work. I will have another look at it. However, this also means, that as a custom widget developer I should also include Property Contributors for my own widgets. Maybe it would ease development, if the default EMF Property sheet would be included as an Advanced tab. Given the odesign editor is usually used by developers who know about the details of EMF, this would not unexpected, but reduces the initial effort of providing custom widgets.
2- I see now why returning null as a widget is useful; still the current behavior makes it extremely hard to find out the source of misconfigurations. More specifically, if nobody contributes a widget that was specified in the odesign file some feedback on the user interface would be much appreciated. Furthermore, in a lot of cases we can detect misconfigurations during runtime, but there is no way to display it (except manually providing some UI elements to represent that). Given the number of models, extensions and features one has to implement for a custom widget, some feedback option would be very welcome.
Best regards,
Zoltán
|
|
|
Goto Forum:
Current Time: Fri Mar 21 17:38:56 EDT 2025
Powered by FUDForum. Page generated in 0.02377 seconds
|