Cannot access the newValue in the radio button widget [message #1790885] |
Tue, 19 June 2018 11:17  |
Eclipse User |
|
|
|
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.



Thank you in advance.
Attachment: sirius1.jpg
(Size: 26.58KB, Downloaded 389 times)
Attachment: sirius3.jpg
(Size: 19.92KB, Downloaded 365 times)
Attachment: sirius2.jpg
(Size: 69.62KB, Downloaded 304 times)
[Updated on: Wed, 20 June 2018 03:53] by Moderator
|
|
|
|
Re: Cannot access the newValue in the radio button widget [message #1790936 is a reply to message #1790924] |
Wed, 20 June 2018 07:08  |
Eclipse User |
|
|
|
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!
|
|
|
Powered by
FUDForum. Page generated in 0.03393 seconds