|Re: how to locate at the element in table through navigation tool from diagram [message #1821131 is a reply to message #1821072]
||Thu, 06 February 2020 07:33
|| Pierre-Charles David
Registered: July 2009
You would need to create a Java service to invoke from a custom tool to do this (it could be a "Popup Menu" tool that appears in the context menu for example, see https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#popup_menu).
The basic idea for the Java services would be:
* Use DialectManager.INSTANCE.getAllRepresentations() (or another more precise methods if possible) to find the DTable representation you want to open & select.
* Then SessionUIManager.INSTANCE.getUISession(session).getEditor(theDTable) if the table editor is already opened, or DialectUIManager.INSTANCE.openEditor(session, theDTable) to open it.
* Iterate inside the DTable.getLines() (possibly recursively if you use sub-lines), to find the DLine (row) whose getTarget() points to the semantic element you are interested in.
* Finally, given the opened table editor and the specific DLine you want to be selected, call DialectUIManager.INSTANCE.selectAndReveal(theEditor, List.of(theDline));
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
Powered by FUDForum
. Page generated in 0.01595 seconds