Re: [emf-dev] Allowing custom property editors
Interesting. Will this help me to solve one of my long outstanding actions:
Provide a custom Cell Editor for the UML Model Editor using the
Essential OCL Editor in place of the default multiline text editor.
On 18/06/2014 15:59, Jens Reimann wrote:
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  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.
emf-dev mailing list
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4592 / Virus Database: 3972/7698 - Release Date: 06/18/14