| TEXTS: having a strict service [message #830162] |
Tue, 27 March 2012 05:23  |
Jeremie Bresson Messages: 262 Registered: October 2011 |
Senior Member |
|
|
Hi,
I was wondering if it is possible to write a second TextProviderService that is stricter than the Default. My idea is to have it fail (ProcessingException) if the text is not found.
I would like to overwrite (maybe with a @Priority) the default TEXTS service. I could use that for some tests (maybe dev product, or JUnit Test application).
Is it possible?
(I am on Jan2012 branch; this means that I have already the TextProvider Service coming with Juno.)
Thanks,
|
|
|
|
| Re: TEXTS: having a strict service [message #832134 is a reply to message #830162] |
Thu, 29 March 2012 16:25  |
 |
Claudio Guglielmo Messages: 98 Registered: March 2010 |
Member |
|
|
Hi Jéremie
When using the priority annotation on the text provider services (and as well on the icon provider services) your are actually defining the order of the text resp. icon lookup. This enables overriding of existing texts and icons.
A very low priority means the service is considered last for the lookup. You can try setting the priority of your MyAppTextProviderService to a very low value (f.e. -5000). If any other service can't provide the text your service will be considered.
I haven't tried it. Please let us know if it works.
BTW: Setting the priority annotation has the same effect as setting the service ranking when registering the service in the plugin.xml.
Regards
Claudio
[Updated on: Thu, 29 March 2012 16:27] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01581 seconds