Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[emf-dev] Allowing custom property editors


I just stumbled over the issue again that I would like to have a custom
property editor for the EMF generated editors. However this seems to be
a bigger task. Either one has to replace a lot of generated classes or
use some other toolset like EEF.

I think there is way to do this with EMF.Edit and started performing the
changes in our own project, Eclipse SCADA. However I would like to see
the changes become part of EMF, if possible.

As far as I have figured it out, the basic problem is, that
AdapterFactoryContentProvider creates the actual IPropertySource
instance, which is derived from a IItemPropertyDescriptor. This process
takes place in PropertyDescriptor.createPropertyEditor(...). However
there seems to be no extensible way to intercept this process and inject
a custom property editor.

I started with a small patch in gerrit [1] which basically allows other
adapters to join in when the conversion from "Object" to
"IPropertySource" takes place. This would be a first step to allow
others to inject custom property editors, if needed. Otherwise the
default process takes place.

This could also be done in a custom implementation on a per project
(editor) base. However if you have a bigger set or models and extension
models. This would mean that all editors have to use this extended
version of AdapterFactoryContentProvider. If one editor implementation
still uses the default implementation, then the whole process would be
broken for a extending model.

Please let me know what you think.

Jens Reimann


Back to the top