|
|
Re: How to Highlight all references to an object in a Sirius Diagram [message #1794363 is a reply to message #1794072] |
Wed, 29 August 2018 15:04 |
Steve Hickman Messages: 56 Registered: August 2017 |
Member |
|
|
Thanks for your rapid response. I am trying this out. I apparently did not properly communicate one key thing.
The items that I select (data structures) do not have a visual representation in the diagram (which contains only nodes,
ports on those nodes, and edges between ports). What I'm trying to do is highlight the nodes, ports and edges that the
data structures flow through. I've written a service method that takes the selected data structures and finds the nodes,
ports, and edges (the semantic elements, not the DRepresentationElements). The challenge I'm facing is that the service method in
the 'Elements to Select' field isn't being called. The service method for the 'Candidates Expression' is being called, so I know
I've properly registered the service class.
In the 'Candidates Expression' field, the successful call looks like this:
service:<method name>()
In the 'Elements to Select' field, I've tried the following:
1) service:<static method call using class.method name>()
2) service:<instance method name where the first parameter is the same type as the one used in the 'Candidates Expression' service method call>()
3) [container.<instance method where the first parameter is the same type as the one used in the 'Candidates Expression' service method call>()/]
4) [element.<instance method>()/]
Note that I have defined methods that take as the first parameter an object of type:
EObject, Collection<EObject>, the type used in the successful 'Candidate Expression' call, as well as a static method that takes no parameters.
None of these methods get called.
None of these have worked. What's the correct call? What is the context this method will be called in? What am I doing wrong?
Other notes:
*) I'm using the standard GEMOC Studio distribution which includes Sirius 5.1.1.201801311428.
1) Users will select a single data structure but that multiple diagram elements will be highlighted as a result. Should the Selection Wizard mulitple box be checked or not in this case?
2) I'm looking at https://www.eclipse.org/forums/index.php/t/1000795/ to see if that will provide additional insight
Follow up:
I changed my method that supplies the 'Candidates Expression' field to return a list of edges (these semantic elements have a graphical representation). I then checked the 'Multiple' field so that element should contain a Collection<EObject> and set the 'Elements to Select' field to 'var:element'
That should mean that all the selected edges should be highlighted after the Selection Wizard is finished. That did not happen. The selection did not change.
More Follow Up:
The Sirius Tool Specification doc , in the 'Selection after tool execution' section, says: In any case, if the default list of elements is not empty, the list of elements returned is filtered with the default selected elements. In case of creation tool, the default list contains newly created elements so, the returned list can contain at most that elements. If I understand this correctly, this means that the list of items finally displayed as selected must be a subset of those selected in the Selection Wizard dialog. In other words, this means that I cannot use the Selection Wizard to select something other than what I want to appear as selected or a superset thereof. If that is true, then I cannot use the Selection Wizard for my original intended purpose because I cannot use the Selection Wizard to select something with no graphical representation, use that input to calculate what I want to appear as selected, and expect the selected elements to change after using the tool.
Is that correct?
[Updated on: Wed, 29 August 2018 20:15] Report message to a moderator
|
|
|
|
|
|
Re: How to Highlight all references to an object in a Sirius Diagram [message #1794725 is a reply to message #1794720] |
Wed, 05 September 2018 14:59 |
Steve Hickman Messages: 56 Registered: August 2017 |
Member |
|
|
Thanks for your rapid response. Going back to the question in the longer post: My attempts to call a service in the 'Elements to Select' field are not working. Why? What should the type of the first parameter of my service be? Should it be the same as the type of an element from the selection list (a structure)? Should it be the type of the semantic element of the diagram as a whole? The type of the semantic element on which the selection list was called? Something else? Or is this what may need a bug report?
[Updated on: Wed, 05 September 2018 16:43] Report message to a moderator
|
|
|
|
Re: How to Highlight all references to an object in a Sirius Diagram [message #1794900 is a reply to message #1794778] |
Mon, 10 September 2018 15:55 |
Steve Hickman Messages: 56 Registered: August 2017 |
Member |
|
|
Thanks for your response. I've tried what you describe and it does not work for me. I added a System.out.println() statement to the method called from the 'Elements to Select' property , which should have printed the string in the console window but nothing showed there. The method used for the 'Candidates Expression' property also has a System.out.println() statement and that string does print in the console window.
I attempted to compare your sample to what I'm doing. I encountered two issues:
1) In the design project, I set the following dependency to optional because I don't have it installed:
org.eclipse.sirius.tests.sample.migration;resolution:=optional,
2) When attempting to load the sample project I got the following:
An internal error occurred during: "Loading models".
The modeling project "sample project" is invalid: Problem during loading models:
The Sirius resource (platform:/resource/sample%20project/representations.aird) can not be loaded because it comes from a more recent Sirius release.
Representation version is: 14.1.0.201808300808
Last Sirius migration version is: 13.0.0.201804031646
Does the first problem cause the second problem?
I've got Sirius 6.0.1.201808231529 installed - I just updated within the last 4 hours. How do i fix the problems?
[Updated on: Mon, 10 September 2018 17:38] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03093 seconds