I built a small e4 RCP application containing a tree view of "e4 xmi" populated with model code generated by emf (using ComposedAdapterFactory) and a "representation of e3 properties."
I tried the following "dirksmetric tutorial" to display a property view in application.e4xmi (common elements) with an empty property view.
To get the selected tree element displayed in my properties page (IItemPropertySource), I performed the following steps:
On my side of the e4 treeviewer, I use the e4 picker service in #createComposite:
// Register the viewer as the selection provider (for use in the property view ...) viewer.addSelectionChangedListener (new ISelectionChangedListener () {@Override public void selectionChanged (event SelectionChangedEvent) {IStructuredSelection selection = (IStructuredSelection) event.getSelection (); // set the selection to the service selectionService.setSelection (selection.size () == 1? selection.getFirstElement (): selection.toArray ());}});
On the side of the e3 βclassicβ property table, I defined a couple of things:
- I called IDE.registerAdapters in the initialization of ApplicationWorkbenchAdvisor #.
- I declared my resource source adapter as shown in my plugin.xml file:
extension point = "org.eclipse.core.runtime.adapters"> factory adaptableType = "org.eclipse.emf.ecore.EObject" class = "myappmodeler.properties.ModelPropertiesAdapter"> Adapter type = "org.eclipse.ui.views .properties.IPropertySource ">
- My ModelPropertiesAdapter # getAdapter returns the source of the property:
public Object getAdapter (Object adaptableObject, Class adapterType) {if (adapterType == IPropertySource.class && adaptableObject instanceof EObject) {emfGlobalFactory = new ComposedAdapterFactory (); emfGlobalFactory.addAdapterFactory (new RepositorystructureItemProviderAdapterFactory ()); emfGlobalFactory.addAdapterFactory (new ApplicationItemProviderAdapterFactory ()); emfGlobalFactory.addAdapterFactory (new ServiceItemProviderAdapterFactory ()); return a new AdapterFactoryContentProvider (emfGlobalFactory) .getPropertySource (adaptableObject); } return null; }
My problem is that this adapter did not even complete.
Currently using Eclipse neon (it has recently been updated to synchronize E3 and E4 selection services) https://bugs.eclipse.org/bugs/show_bug.cgi?id=403930
eclipse-rcp e4 eclipse-emf
Watto watto
source share