Skip to main content



      Home
Home » Modeling » TMF (Xtext) » How to implement scoping and validation for an element at same time
How to implement scoping and validation for an element at same time [message #1795618] Wed, 26 September 2018 05:00 Go to next message
Eclipse UserFriend
Hi,
I have Implemented scoping for an element
contentRef<Dropdown list which match some condition >

element in drop down list has implementation with a value for USED as : USED True/False

drop down list will contain elements with USED as True

So in contentRef dropdown it is contain elements with USED as True

Now if in future , if user changes the USED from True to False it should throw error from validation but it is not throwing


Eg :
Correct Example:
abc {
contentRef measureVal
}

measureVal {
USED True

}
measureValue2{
USED False
}

Now user changes the value of USED in measureVal from True to False then contentRef should throw an error from validation but it is not throwing error from validation.Instead it is just throwing a general error as : "Couldn't resolve reference to EObject 'measureVal'."

Wrong example :

abc {
contentRef measureVal //it will throw error as "Couldn't resolve reference to EObject 'measureVal" but I want customized error message
}

measureVal {
USED False

}
measureValue2{
USED False
}



Re: How to implement scoping and validation for an element at same time [message #1795621 is a reply to message #1795618] Wed, 26 September 2018 05:07 Go to previous messageGo to next message
Eclipse UserFriend
you cant, but you can adopt the error message. it s produced by ILinkingDiagnosticMessageProvider. you can return null there

Re: How to implement scoping and validation for an element at same time [message #1795623 is a reply to message #1795621] Wed, 26 September 2018 05:18 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the reply Christian. Can you provide me an example on how to use ILinkingDiagnosticMessageProvider in this case
Re: How to implement scoping and validation for an element at same time [message #1795625 is a reply to message #1795623] Wed, 26 September 2018 05:23 Go to previous message
Eclipse UserFriend
no i cant. read the existing code. use a debugger ...
Previous Topic:Given a ANTLRv3 grammar how to create xtext grammar
Next Topic:JAVA HEAP SPACE (OUT OF MEMEORY)
Goto Forum:
  


Current Time: Tue Jun 24 16:14:37 EDT 2025

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

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

Back to the top