Dynamic message while defining Audit Rules [message #235669] |
Wed, 08 July 2009 15:16 |
Maxence VANBÉSIEN Messages: 40 Registered: July 2009 Location: Lille, France |
Member |
|
|
Hello,
When defining label mapping, it is possible to define a pattern (e.g. {0}
-> {1}), and this pattern is formatted at runtime.
It is possible to define the same kind of process for messages resulting
from Audit Rules, by using patterns or things like that?
(As an example, in the gmfmap file, I would like to put as message a thing
like "The type is not set for attribute named {0}", and then, format this
pattern at runtime only, to have dynamic error messages.)
Thanks in advance for your answer,
Maxence
|
|
|
|
Re: Dynamic message while defining Audit Rules [message #236002 is a reply to message #235735] |
Fri, 10 July 2009 13:23 |
Maxence VANBÉSIEN Messages: 40 Registered: July 2009 Location: Lille, France |
Member |
|
|
Hello !
Just for information, I continued to have a look at this issue and I found
something very interesting. In fact, while manipulating audit constraints,
which extend the AbstractModelConstraint class, the message stored in the
plugin.xml file is formatted using the NLS Framework.
So, when I create my error message using
validationContext.createFailureStatus("myString"), the message stored in
the plugin.xml is formatted with the provided parameter. Si, if I follow
the NLS rules, e.g. I set my plugin.xml message to "Value is not correct
for {0}", the result will be "Value is not correct for myString" in the
Eclipse problems view.
Hope this helps ;)
Maxence
|
|
|
Powered by
FUDForum. Page generated in 0.02884 seconds