Skip to main content



      Home
Home » Eclipse Projects » Sirius » how to locate at the element in table through navigation tool from diagram
how to locate at the element in table through navigation tool from diagram [message #1821072] Wed, 05 February 2020 02:19 Go to next message
Eclipse UserFriend
Hi,
the case is like that:
I have a diagram and a table, both contain same elements. Now I want to have a tool in diagram, the tool applies to all elements, through which tool I can navigate to the table and locate at the row of the implemented element. ara there any way to do this?
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 02:33 Go to previous message
Eclipse UserFriend
Hi,

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));

Regards,
Pierre-Charles
Previous Topic:Selection Wizard
Next Topic:Creating a node for a specific container
Goto Forum:
  


Current Time: Thu Jun 19 03:27:43 EDT 2025

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

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

Back to the top