Skip to main content



      Home
Home » Eclipse Projects » Sirius » [Properties View] Using Custom Widget
[Properties View] Using Custom Widget [message #1740205] Wed, 10 August 2016 08:52 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #1741464 is a reply to message #1740279] Thu, 25 August 2016 07:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I have taken a look at the mentioned https://bugs.eclipse.org/bugs/show_bug.cgi?id=496057, that seems to be closed/fixed, with an impressive planned list of capabilities. However, given I am not that familiar with the internals of EEF/Sirius, I am at a loss at how I should start with using these new custom widgets. Is there any documentation or example somewhere to check at least the basics, especially on the Sirius side?

Best regards,
Zoltán
Re: [Properties View] Using Custom Widget [message #1741500 is a reply to message #1741464] Thu, 25 August 2016 10:31 Go to previous messageGo to next message
Eclipse UserFriend
Hi.

There is currently no documentation for this feature (we were probably a little too quick in closing the issue without some), but there is an example for a "reference edition" widget.

On the EEF side (independant on Sirius), there are 3 plug-ins:
* org.eclipse.eef.ext.widgets.reference: extends the EEF metamodel (which describes the widgets existing at runtime) with an element to describe the EEFExtReferenceDescription;
* org.eclipse.eef.core.ext.widgets.reference: the UI-independent part of the new widget's behavior;
* org.eclipse.eef.ide.ui.ext.widgets.reference: the UI-dependant part of the new widget. This is also where it is "plugged into" the list of widgets known to EEF, through the org.eclipse.eef.ide.ui.eefLifecycleManagerProvider extension point (see https://www.eclipse.org/eef/#/documentation/1.7.0/developerguide/extensionpoints)

On the Sirius side:
* org.eclipse.sirius.properties.ext.widgets.reference: extends the Sirius metamodel (the one used in the VSMs) to allow the specification/configuration of the new widget;
* org.eclipse.sirius.properties.ext.widgets.reference.edit and org.eclipse.sirius.editor.properties.ext.widgets.reference: the ".edit" and ".editor" for that small metamodel;
* org.eclipse.sirius.ui.properties.ext.widgets.reference: uses the org.eclipse.sirius.ui.properties.descriptionConverter extension point to convert widget definitions occuring in the VSM (instance of the Sirius-side metamodel) into an equivalent instance of EEFExtReferenceDescription (the EEF-side metamodel).

So basically:
* 2 metamodels: one "front-end" which is configured by the specifier in the Sirius VSM, and one "back-end" which is used at runtime by EEF as a description of the concrete widget;
* 1 converter (in org.eclipse.sirius.ui.properties.ext.widgets.reference) between the two sides;
* the actual runtime/graphical behavior of the widget itself (org.eclipse.eef.ide.ui.ext.widgets.reference).

Hope it helps.

Regards,
Pierre-Charles David
Re: [Properties View] Using Custom Widget [message #1741653 is a reply to message #1741500] Fri, 26 August 2016 11:22 Go to previous messageGo to next message
Eclipse UserFriend
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 #1741736 is a reply to message #1741653] Mon, 29 August 2016 03:47 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

1- The plugin org.eclipse.sirius.editor.properties.ext.widgets.reference provides the Properties view of the ExtReference widget for the odesign editor thanks to the property section extension point.
2 - By doing nothing if nothing matches it let the specifier use the widget without having to specify a complex precondition for complex use cases. Right now this behavior is the expected one, it allows us to create a reference widget for an EReference without having to wonder whether or not this reference is actually there for all the selected elements.

Regards,

Stéphane Bégaudeau, Obeo
Re: [Properties View] Using Custom Widget [message #1741826 is a reply to message #1741736] Mon, 29 August 2016 18:13 Go to previous message
Eclipse UserFriend
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
Previous Topic:Change layout on Creation via ModelChangeTrigger
Next Topic:Deployment: Icons for graphical elements
Goto Forum:
  


Current Time: Fri Mar 21 17:38:56 EDT 2025

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

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

Back to the top