Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Cannot access the newValue in the radio button widget
Cannot access the newValue in the radio button widget [message #1790885] Tue, 19 June 2018 15:17 Go to next message
Kostas Triantafyllidis is currently offline Kostas TriantafyllidisFriend
Messages: 15
Registered: March 2011
Junior Member
Hello all,

I have created a radio button widget under the Properties view. The data are correctly represented but i cannot make use of the newValue variable when i am changing my radio button choice. I am using services and i would like to pass the newValue as argument in one service which will set the new choice. The code of the service is:


public void setMaxSpeedUnit(Speed s, Unit newVal)
{
ValueWithUnit v = ExprFactory.eINSTANCE.createValueWithUnit();
v.setValue(s.getMaxSpeed().getValue());
v.setUnit(newVal);
s.setMaxSpeed(v);
}

When i execute it, i get the following error:
org.eclipse.sirius.common.tools.api.interpreter.EvaluationException: No compatible implementation of service setMaxSpeedUnit found for [Ljava.lang.Object;@1d2b8bd7
at org.eclipse.sirius.common.tools.internal.interpreter.PolymorphicService.call(PolymorphicService.java:63)
at org.eclipse.sirius.common.tools.internal.interpreter.ServiceInterpreter.callService(ServiceInterpreter.java:163)
at org.eclipse.sirius.common.tools.internal.interpreter.ServiceInterpreter.evaluate(ServiceInterpreter.java:155)
................

Is there any chance that there is a bug in handling/updating the newValue variable? Should the newValues variable be of specific type? I have tried also with simplified methods using EObjects, but whenever passing the newValue as argument i get the same error. When i pass the variable self, the service is executed.

The Sirius model is attached as well.
index.php/fa/33166/0/
index.php/fa/33169/0/
index.php/fa/33168/0/

Thank you in advance.




  • Attachment: sirius1.jpg
    (Size: 26.58KB, Downloaded 126 times)
  • Attachment: sirius3.jpg
    (Size: 19.92KB, Downloaded 75 times)
  • Attachment: sirius2.jpg
    (Size: 69.62KB, Downloaded 67 times)

[Updated on: Wed, 20 June 2018 07:53]

Report message to a moderator

Re: Cannot access the newValue in the radio button widget [message #1790924 is a reply to message #1790885] Wed, 20 June 2018 09:27 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 194
Registered: August 2010
Senior Member
Hi,

You can try to modify your service signature by setMaxSpeedUnit(Speed, Object). The type of the candidate variable may no be a Unit.

Regards,

Florian
Re: Cannot access the newValue in the radio button widget [message #1790936 is a reply to message #1790924] Wed, 20 June 2018 11:08 Go to previous message
Kostas Triantafyllidis is currently offline Kostas TriantafyllidisFriend
Messages: 15
Registered: March 2011
Junior Member
Thanks for your message. I tried what you proposed and it indeed worked. For a weird reason i was trying this yesterday and it did not work. So the trick Unit to Object and back to Unit did the trick (i guess that it cleared some kind of cache in Eclipse?). I restarted the laptop and maybe this has helped as well. So the newValue was indeed Unit type, but it would not trigger the method. Then i changed the method to accept Object, debugged and confirmed that the newValue is indeed of type Unit. Then i switched back the argument in the method to Unit and it worked..

Thanks!
Previous Topic:How to limit edge creation to direct children only
Next Topic:All layers are equal (or not?)
Goto Forum:
  


Current Time: Wed Sep 26 09:05:29 GMT 2018

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

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

Back to the top