Posts

eclipse e4 – create Application.xmi

How do you create this? The XMI is just a serialized form of the model instances. Its really xml so create an xml file the usual eclipse way. Just ran into this. I don't know if there is a wizard that has already been made (there is a sample Application.xmi in the workbench fragment bundle) but you can just create an XML file with .xmi extension and add the application namespace to it. Then just right click and select the generic ecore emf form editor or "other..." (and find the generic ecore emf form editor in the etools feature). I think you can add these entries to the top element: 1: < application:MApplication xmi:version ="2.0" 2: xmlns:xmi ="http://www.omg.org/XMI" 3: xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" 4: xmlns:application ="http://www.eclipse.org/ui/2008/Application" 5: xmlns:workbench ="http://www.eclipse.org./ui/2008/Workbench" > 6:   7: .....

Hibernate, EMF objects and eclipse databinding – ensure you have an equals method

Ran into a few problems the other day around creating UI forms with EMF that is backed by Hibernate and Teneo. The jface databinding snippets almost always use strings as the model object, however, most model objects have embedded objects in them that then, down the road, relate back to user-readable strings.  Hence the snippets don’t always show some nuances around the model objects. Its important to realize that some of the jface databinding support classes, such as those producing object-to-label maps (which is why there are always IObservableMaps being used for everything are good in the sense that you can create a map between domain objects and the strings that should be displayed. These can be created automatically for you using jface databinding or you can create the maps directly yourself (no one really does that though). The real issues is to realize that many of these object-to-label maps that are created automatically use a backing map (hashtable) that hashes the object...