Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » DelegatingWrapperItemProvider : how change the order of the properties
DelegatingWrapperItemProvider : how change the order of the properties [message #1412538] Tue, 26 August 2014 12:02 Go to next message
Philippe Favrais is currently offline Philippe FavraisFriend
Messages: 23
Registered: April 2011
Junior Member
Hello

i work on a editor (which extend EcoreEditor).
I need to display in a certain order the properties of the selected object (of the tree editor.)
This order should be computed with some information (eAnnotations) which are stored in the ecore model.
Unfortunatly, i cannot get the descriptor from the PropertySheetEntry. Do you know how could i get it ?

The other alternative would be to directly get the DynamicEObjectImpl but the selected object is a org.eclipse.emf.edit.provider.DelegatingWrapperItemProvider
and i do not know how to get the corresponding DynamicEObjectImpl. Do you know how to solve that problem ?
thank you in advance

Philippe
Re: DelegatingWrapperItemProvider : how change the order of the properties [message #1412562 is a reply to message #1412538] Tue, 26 August 2014 13:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Philippe,

Comments below.

On 26/08/2014 2:02 PM, Philippe Favrais wrote:
> Hello
>
> i work on a editor (which extend EcoreEditor). I need to display in a
> certain order the properties of the selected object (of the tree editor.)
> This order should be computed with some information (eAnnotations)
> which are stored in the ecore model. Unfortunatly, i cannot get the
> descriptor from the PropertySheetEntry. Do you know how could i get it ?
So I assume you're doing this for a dynamic model and you're using the
reflective editor... It would generally seem the easiest to hook into
org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider.createPropertySource(Object,
IItemPropertySource) because then you have control over what's returned
by
org.eclipse.emf.edit.ui.provider.PropertySource.getPropertyDescriptors(). Given
you're extending an existing editor, it's a little trickier to get your
specialized content provider in place. You'd need to specialize
org.eclipse.emf.ecore.presentation.EcoreEditor.getPropertySheetPage() to
make sure your specialized content provider is used.
>
> The other alternative would be to directly get the DynamicEObjectImpl
> but the selected object is a
> org.eclipse.emf.edit.provider.DelegatingWrapperItemProvider
> and i do not know how to get the corresponding DynamicEObjectImpl. Do
> you know how to solve that problem ?
> thank you in advance
>
> Philippe
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: DelegatingWrapperItemProvider : how change the order of the properties [message #1412618 is a reply to message #1412562] Tue, 26 August 2014 16:04 Go to previous messageGo to next message
Philippe Favrais is currently offline Philippe FavraisFriend
Messages: 23
Registered: April 2011
Junior Member
Thanks Ed,
Yes, you are right, i am working with a dynamic model and using the reflective editor.
From my specialized PropertySource.getPropertyDescriptors(), to be able to change the order of IPropertyDescriptor[],
i need to read the eAnnotations (having the order information) of the DynamicEObjectImpl. However, the objects are of type DelegatingWrapperItemProvider and not DynamicEObjectImpl.
And i do not know how to access this information ?
Philippe


Re: DelegatingWrapperItemProvider : how change the order of the properties [message #1412641 is a reply to message #1412618] Tue, 26 August 2014 17:21 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Philippe,

Comments below.

On 26/08/2014 6:04 PM, Philippe Favrais wrote:
> Thanks Ed,
> Yes, you are right, i am working with a dynamic model and using the
> reflective editor.
> From my specialized PropertySource.getPropertyDescriptors(), to be
> able to change the order of IPropertyDescriptor[],
> i need to read the eAnnotations (having the order information) of the
> DynamicEObjectImpl. However, the objects are of type
> DelegatingWrapperItemProvider and not DynamicEObjectImpl.
You can always unwrap things:
org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.unwrap(Object)
> And i do not know how to access this information ?
> Philippe
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:ECP SWT ViewRenderer
Next Topic:[CDO] Delete values from version history
Goto Forum:
  


Current Time: Fri Mar 29 01:47:08 GMT 2024

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

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

Back to the top