Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] Custom Databinding converters(How to specify and inject custom databinding converters)
[EMF Forms] Custom Databinding converters [message #1750404] Tue, 20 December 2016 18:28 Go to next message
Regent LArcheveque is currently offline Regent LArchevequeFriend
Messages: 94
Registered: May 2010
Member
Hi,

I have a model that contains EAttribute with annotations used to define the engineering units such as Celcius or kilometers etc. These annotations are based on the JScience package (javax.measure.unit.Unit). I use EMFForms Renderer Service to contribute custom SWT control to display the units. This works well. Now, I'd like to know how if it is possible to contribute custom converters to the EMFForms databindings. This would allow me to convert data specified in an engineering format into a different but compatible engineering format (e.g. km/h into miles/h, lbs to kg). I do not know where to implement and specify the databinding converters.

Thanks for your help.
Re: [EMF Forms] Custom Databinding converters [message #1750465 is a reply to message #1750404] Wed, 21 December 2016 10:35 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 174
Registered: May 2015
Senior Member
Hi,
as you already have custom controls, you can override the org.eclipse.emf.ecp.view.spi.core.swt.SimpleControlSWTControlSWTRenderer.createBindings(Control) method.
Take a look at the NumberControlSWTRenderer how it overrides the createBindings with custom converter etc.

Cheers,
Eugen
--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] Custom Databinding converters [message #1750476 is a reply to message #1750465] Wed, 21 December 2016 13:56 Go to previous message
Regent LArcheveque is currently offline Regent LArchevequeFriend
Messages: 94
Registered: May 2010
Member
Thanks Eugen.
Previous Topic:[EMF Forms] bi-directional references - new entries are created as root entries
Next Topic:How to add parameters to texo annotations
Goto Forum:
  


Current Time: Fri Apr 26 04:45:13 GMT 2024

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

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

Back to the top