Getting an object from a different session with the Select widget [message #1850223] |
Tue, 22 February 2022 02:55  |
Eclipse User |
|
|
|
Hello all,
In my graphical model, I am able to create two kinds of items: ActualItem and PointerItem. The PointerItem has a reference to the ActualItem in my metamodel. When the user creates a PointerItem in the editor, a dialog box which includes a selection widget pops up. The user can select any ActualItem as a reference by using the selection widget. The user can also select an ActualItem from a model in a different Session (I will call these ActualItems as remote items from now on). I need to call a service function after selecting the ActualItem for a PointerItem. Until now, everything was OK, but the things started to be a bit complicated during the execution of the service function. I want to save the Session information of the remote item in somewhere in Java code. However, I cannot do it by using the reference attribute of the PointerItem, because it is a clone of the actual object. So, the session information is the information about the current session, not the external one. In short, I cannot access any data about the external Session. I tried to access the remote item by adding operations to the select widget in my .odesign file, but it did not work. Is there any solution or trick that can help me to figure out this problem.
Thanks in advance.
|
|
|
|
Re: Getting an object from a different session with the Select widget [message #1850262 is a reply to message #1850243] |
Wed, 23 February 2022 04:09  |
Eclipse User |
|
|
|
Thank you very much Glenn. Actually, thanks to the code that you sent I can access all elements in an external session. However, my problem is that the reference object in the PointerItem is not the same with the ActualItem. Instead, it is a clone of the ActualItem. Therefore, I cannot find the item with the "==" operator in the for loop. I can find it by comparing every attribute of those two ActualItem objects, but it does not sound reasonable. By the way, if the ActualItem is in the same Session, then "==" operator works because the items are really the same (not clone).
|
|
|
Powered by
FUDForum. Page generated in 0.23597 seconds