Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Custom Label Provider
Custom Label Provider [message #1822290] Tue, 03 March 2020 10:11 Go to next message
Alexandra Tritean is currently offline Alexandra TriteanFriend
Messages: 20
Registered: February 2019
Junior Member
Hello,

I was in need on creating a list of EObjects based on the list of strings, so therefore I used the following code for 'converting' a string to an EObject.
SimpleAnyType wrapper = XMLTypeFactory.eINSTANCE.createSimpleAnyType();
wrapper.setInstanceType(EcorePackage.eINSTANCE.getEString());
wrapper.setValue(myString);

Is there a way in which I can override the LabelProvider for this specific type? More explicitly I would probably need to customize the getText method from the ReflectiveItemProvider class.

I tried to play around with the org.eclipse.emf.edit.itemProviderAdapterFactories extension, but I didn't managed to get it work. I guess I'm doing something wrong, but I'm not sure what exactly.

Thank you!

Kind Regards,

Alexandra

[Updated on: Tue, 03 March 2020 10:12]

Report message to a moderator

Re: Custom Label Provider [message #1822324 is a reply to message #1822290] Wed, 04 March 2020 04:33 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31834
Registered: July 2009
Senior Member
The reflective item provider adapter factory is generally created in the generated editor:
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
You'd have to specialize starting there. It can't be done via any registration because there is no specialized EClass involved, though perhaps providing one for http://www.eclipse.org/emf/2003/XMLType might also do the trick.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Forum on Privacy and Data Protection Challenges in System Development
Next Topic:How to add a attribute or property to a EAttribute type?
Goto Forum:
  


Current Time: Fri Apr 16 12:11:43 GMT 2021

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

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

Back to the top