Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Customizing messages of Java Audit Rules
Customizing messages of Java Audit Rules [message #193286] Wed, 18 June 2008 14:42 Go to next message
Eclipse UserFriend
Originally posted by: edebauer.freenet.de

Hey out there,

i am currently working on Java-Audits-Rules. They are evaluated to a
simple boolean value, if the validation is started. But if they are
evaluated to false, i need to print out a message that is not static.
Currently in the definition of audit rules i am only able to define a
Name and a static message to be shown in this situation.
Is there any possibility to add for example a self made string to the
message at a particular position or to create the message to be shown
dynamically, dependant on the situation exists in the model?

Thanks for helping me :)

Regards,
Ede
Re: Customizing messages of Java Audit Rules [message #193309 is a reply to message #193286] Wed, 18 June 2008 16:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

--=-RdfKxM8rAPKMDyVmRKlu
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Ede,

As you are using Java to implement your constraints, your audit message
pattern can have {0}, {1}, etc. variables as per the
java.text.MessageFormat specification. Then, when your constraint is
violated, pass your array of substitutions for these variables to the
IValidationContext::createFailureStatus(Object...) method.

HTH,

Christian


On Wed, 2008-06-18 at 16:42 +0200, Ede Bauer wrote:

> Hey out there,
>
> i am currently working on Java-Audits-Rules. They are evaluated to a
> simple boolean value, if the validation is started. But if they are
> evaluated to false, i need to print out a message that is not static.
> Currently in the definition of audit rules i am only able to define a
> Name and a static message to be shown in this situation.
> Is there any possibility to add for example a self made string to the
> message at a particular position or to create the message to be shown
> dynamically, dependant on the situation exists in the model?
>
> Thanks for helping me :)
>
> Regards,
> Ede

--=-RdfKxM8rAPKMDyVmRKlu
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.0">
</HEAD>
<BODY>
Hi, Ede,<BR>
<BR>
As you are using Java to implement your constraints, your audit message pattern can have {0}, {1}, etc. variables as per the java.text.MessageFormat specification.&nbsp; Then, when your constraint is violated, pass your array of substitutions for these variables to the IValidationContext::createFailureStatus(Object...) method.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Wed, 2008-06-18 at 16:42 +0200, Ede Bauer wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hey out there,</FONT>

<FONT COLOR="#000000">i am currently working on Java-Audits-Rules. They are evaluated to a </FONT>
<FONT COLOR="#000000">simple boolean value, if the validation is started. But if they are </FONT>
<FONT COLOR="#000000">evaluated to false, i need to print out a message that is not static. </FONT>
<FONT COLOR="#000000">Currently in the definition of audit rules i am only able to define a </FONT>
<FONT COLOR="#000000">Name and a static message to be shown in this situation.</FONT>
<FONT COLOR="#000000">Is there any possibility to add for example a self made string to the </FONT>
<FONT COLOR="#000000">message at a particular position or to create the message to be shown </FONT>
<FONT COLOR="#000000">dynamically, dependant on the situation exists in the model?</FONT>

<FONT COLOR="#000000">Thanks for helping me :)</FONT>

<FONT COLOR="#000000">Regards,</FONT>
<FONT COLOR="#000000">Ede</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-RdfKxM8rAPKMDyVmRKlu--
Re: Customizing messages of Java Audit Rules [message #193357 is a reply to message #193309] Wed, 18 June 2008 22:05 Go to previous message
Eclipse UserFriend
Originally posted by: edebauer.freenet.de

Hey Christian,

yes it helped a lot, thank you.

With kind regards,
Ede

Christian W. Damus schrieb:
> Hi, Ede,
>
> As you are using Java to implement your constraints, your audit message
> pattern can have {0}, {1}, etc. variables as per the
> java.text.MessageFormat specification. Then, when your constraint is
> violated, pass your array of substitutions for these variables to the
> IValidationContext::createFailureStatus(Object...) method.
>
> HTH,
>
> Christian
>
>
> On Wed, 2008-06-18 at 16:42 +0200, Ede Bauer wrote:
>> Hey out there,
>>
>> i am currently working on Java-Audits-Rules. They are evaluated to a
>> simple boolean value, if the validation is started. But if they are
>> evaluated to false, i need to print out a message that is not static.
>> Currently in the definition of audit rules i am only able to define a
>> Name and a static message to be shown in this situation.
>> Is there any possibility to add for example a self made string to the
>> message at a particular position or to create the message to be shown
>> dynamically, dependant on the situation exists in the model?
>>
>> Thanks for helping me :)
>>
>> Regards,
>> Ede
Previous Topic:Highlighting a list of model elements
Next Topic:Merging GMF with existing RCP product
Goto Forum:
  


Current Time: Fri Apr 26 09:19:13 GMT 2024

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

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

Back to the top