Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 07:19 Go to next message
Qiran Cong is currently offline Qiran CongFriend
Messages: 26
Registered: November 2019
Junior Member
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 07:33 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 701
Registered: July 2009
Senior Member
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


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Selection Wizard
Next Topic:Creating a node for a specific container
Goto Forum:
  


Current Time: Thu Mar 28 15:10:31 GMT 2024

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

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

Back to the top