Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Preview Style tooltip
Preview Style tooltip [message #1806115] Thu, 02 May 2019 21:32 Go to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi All,

I was wondering if anyone knows any hint about how to preview a diagram as a tooltip (on mouseover). I know how to catch mouseovers or tooltips but I don't exactly know how to generate that preview! Moreover, I don't know if there a best practice for it? I can guess that one way would be to export an image of the diagram and then create a cutom tooltip to show that image to the user. Is that what the tools really do? For instance, below is an screenshot from Papyrus (I pointed on Gate C and then the tool displayed a preview of the GateC diagram) . I need something similar to this.

index.php/fa/35451/0/

Thanks,
Parsa

[Updated on: Thu, 02 May 2019 21:33]

Report message to a moderator

Re: Preview Style tooltip [message #1806455 is a reply to message #1806115] Thu, 09 May 2019 09:51 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 491
Registered: July 2009
Senior Member
It looks like the code used by Papyrus is here: https://git.eclipse.org/r/plugins/gitiles/papyrus/org.eclipse.papyrus/+/master/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/internal/ImageToolTipManager.java

They are able to do this because all the Papyrus diagrams are opened (and rendered) inside a single editor, so when showing Gate_A, the SWT control for diagram Gate_C is available and can render into an image. This technique will not work with Sirius as each diagram has its own editor which may not be opened. You can however produce images of your diagrams using the org.eclipse.sirius.ui.business.api.dialect.DialectUIServices.exportWithResult(DRepresentation, Session, IPath, ExportFormat, IProgressMonitor) method and then use the image from that file as tooltip.

Regards,
Pierre-Charles


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Edge creation tool and display issue
Next Topic:Issue on adding meta model - Add from registry is not showing packages.
Goto Forum:
  


Current Time: Thu Oct 24 05:10:54 GMT 2019

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

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

Back to the top