Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsCustom label provider for Model Navigator view
https://www.eclipse.org/forums/index.php/mv/msg/1081855/1745430/#msg_1745430
I want to customize standard papyrus label provider to add custom icons to UML model, depending on profile, profile attributes, model elements and user preferences.
I've tried to use CNF <override> mechanics, but it looks like Papyrus does not respect CNF registrations of label providers and instead always uses it's own implementation.
So, there sure should be a way to use custom/delegating label provider to use custom icons for some element types and delegate to the default provider for the rest.
So, the question is how to register a custom label provider in Model Elements view using Papyrus API?
Many thanks in advance!]]>Leonid Ripeynih2016-10-10T14:59:42-00:00Re: Custom label provider for Model Navigator view
https://www.eclipse.org/forums/index.php/mv/msg/1081855/1745495/#msg_1745495
Papyrus offers a few different mechanisms for customization of the icons in the Model Explorer. Firstly, if an element has a stereotype applied that has a custom icon defined in the profile, then that icon should be used.
But, for more flexibility, the Papyrus APIs include a Label Provider Service. Search references in plugin.xml to the org.eclipse.papyrus.infra.services.labelprovider.labelProvider extension point for examples of how to register a label provider with this service and how to give it priority over other providers and filter its applicability to specific elements in the Model Explorer.