|
Re: custom createItemPropertyDescriptor [message #1815638 is a reply to message #1815615] |
Mon, 07 October 2019 15:41 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
One approach would be to use the GenModel property Edit -> Provide Root Extends Class to specify the fully qualified name of some hand-written extension of ItemProviderAdapter. Then all you generated item providers will extends this class and you could override org.eclipse.emf.edit.provider.ItemProviderAdapter.createItemPropertyDescriptor(AdapterFactory, ResourceLocator, String, String, EStructuralFeature, boolean, boolean, boolean, Object, String, String[], Object) in this one class. You might add your own EAnnotations to your EStructuralFeatures which you could use to implement different behaviors in your specialized "central" property descriptor.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: custom createItemPropertyDescriptor [message #1815741 is a reply to message #1815724] |
Wed, 09 October 2019 15:07 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
The EAnnotation idea was just if you want to somehow selectively control various behaviors on a per-feature basis. The underlying implementation of org.eclipse.emf.edit.provider.ItemPropertyDescriptor.getComboBoxObjects(Object) also does rather brute force visiting of all objects in the resource set to find ones of the correct type. You might just call super and filter to those in in your special "containers". But whatever works, if it performs reasonably, is just fine of course.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03994 seconds