Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 17:05 Go to next message
Yufei Zhou is currently offline Yufei ZhouFriend
Messages: 44
Registered: March 2020
Member
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 06:24 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 703
Registered: July 2009
Senior Member
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


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How can I add IDoubleClickListener for edition table? [message #1829032 is a reply to message #1828908] Wed, 24 June 2020 08:14 Go to previous message
Yufei Zhou is currently offline Yufei ZhouFriend
Messages: 44
Registered: March 2020
Member
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: Thu Apr 25 18:57:41 GMT 2024

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

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

Back to the top