| [news.eclipse.tools.emf] Re: [Validation] How to change text of validation messages |
https://bugs.eclipse.org/bugs/show_bug.cgi?id=216983
Ed Merks wrote:Right now we do getEcoreResourceLocator().getString(...) but if we did getString(...) and had a protected getString(...) method that does getEcoreResourceLocator().getString(...) you'd have a little more flexibility to redirect the lookups. And if I did that, I could perhaps even pass in "data" that will be part of the final diagnostic, so you could pick out the eObject and include it in the message as part of an override... Or perhaps better yet, instead of calling new BasicDiagnostic, I call a helper method that is passed in the severity, the source, the code, the key for the message, the substitutions for the message, and the data for the diagnostic. Then you'd have all the information you could possibly need... It certainly has some appeal...> ...I wonder if the above proposal has value. What do you think? (When we generate the validator, we could encourage this pattern by generating the helper method and the TODO bodies in this more flexible form.)
It's been a couple of months since I looked at this stuff, but IIRC that kind of refactoring would have helped me. Let us know if you open a Bugzilla about it so I can monitor it (and maybe even contribute feedback or <gasp> code).
Eric