Skip to main content



      Home
Home » Eclipse Projects » Sirius » How can I add IDoubleClickListener for edition table?(Edition table, IDoubleClickListener)
How can I add IDoubleClickListener for edition table? [message #1828896] Sun, 21 June 2020 13:05 Go to next message
Eclipse UserFriend
Hi there,
I am trying to make my edition table rows respond to double click events, in order to create a instance by double click on a row. I found in the forum that I should implement my own IDoubleClickListener to do such work. But what bothering me is that I don't understand how I can add IDoubleClickListener for the table rows. I found some sample codes on the internet, it seems that the IDoubleClickListener class is attached to a Viewer class. I have no idea how to get that viewer class from Sirius edition table, and my work stuck here.I would like to know the concrete steps to add the IDoubleClickListener for edition table(or other diagrams), and any advice helps a lot.

Thanks very much for your help.
Re: How can I add IDoubleClickListener for edition table? [message #1828908 is a reply to message #1828896] Mon, 22 June 2020 02:24 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

This is not directly supported by Sirius. You *can* access the underlying JFace viewer, but it requires calling on Sirius internal APIs. Something like this (this is non-tested pseudo-code, you will have to adapt to your situation):

IEditingSession editingSession = SessionUIManager.INSTANCE.getUISession(session);
DTableEditor tableEditor = (DTableEditor) editingSession.getEditor(dtable);
org.eclipse.jface.viewers.Viewer viewer = ((org.eclipse.sirius.table.ui.tools.internal.editor.AbstractDTableEditor) tableEditor).getViewer();


Regards,
Pierre-Charles
Re: How can I add IDoubleClickListener for edition table? [message #1829032 is a reply to message #1828908] Wed, 24 June 2020 04:14 Go to previous message
Eclipse UserFriend
Thanks very much for your help and the code snippet works. Just have to change org.eclipse.jface.viewers.Viewer to org.eclipse.sirius.table.ui.tools.internal.editor.DTableTreeViewer.
Previous Topic:Generating code with Acceleo from Sirius digram model
Next Topic:Synchronizing Sirius with Xtext
Goto Forum:
  


Current Time: Fri Jun 13 10:27:26 EDT 2025

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

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

Back to the top