Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Why DiagramPrinter does not take existing DiagramEditPart instance?
Why DiagramPrinter does not take existing DiagramEditPart instance? [message #162149] Thu, 22 November 2007 20:19 Go to next message
Li Ding is currently offline Li DingFriend
Messages: 29
Registered: July 2009
Junior Member
Hi,

When printing a diagram, DiagramPrinter calls PrinterHelper to create a
new DiagramEditPart. This is good for headless mode without opening an
editor. However, if editor does open already, why DiagramPrinter can not
simply take existing DiagramEditPart from the editor ? To me, creating a
new DiagramEditPart, its children EditParts and Figures adds lots of
overhead. More than that,the states set in existing editPart instances in
editor will be lost in the newly created editparts for printing.
I want to extend DiagramPrinter to take existing DiagramEditPart if it
exists but DiagramPrinter is internal. I am also afraid GMF runtime does
this way ( create new editparts ) with specific reason.
Any explanation for this will be appreciated.

Li
Re: Why DiagramPrinter does not take existing DiagramEditPart instance? [message #162425 is a reply to message #162149] Fri, 23 November 2007 18:25 Go to previous messageGo to next message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Li,

DiagramPrinter was changed in September (in 2.1) to use the open diagram
editor if one exists for the reason you stated. See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=160731.

- Cherie

Li Ding wrote:
> Hi,
>
> When printing a diagram, DiagramPrinter calls PrinterHelper to create a
> new DiagramEditPart. This is good for headless mode without opening an
> editor. However, if editor does open already, why DiagramPrinter can
> not simply take existing DiagramEditPart from the editor ? To me,
> creating a new DiagramEditPart, its children EditParts and Figures adds
> lots of overhead. More than that,the states set in existing editPart
> instances in editor will be lost in the newly created editparts for
> printing.
> I want to extend DiagramPrinter to take existing DiagramEditPart if it
> exists but DiagramPrinter is internal. I am also afraid GMF runtime does
> this way ( create new editparts ) with specific reason.
> Any explanation for this will be appreciated.
>
> Li
>
Re: Why DiagramPrinter does not take existing DiagramEditPart instance? [message #162488 is a reply to message #162425] Fri, 23 November 2007 19:59 Go to previous message
Li Ding is currently offline Li DingFriend
Messages: 29
Registered: July 2009
Junior Member
Thanks Cherie. I should alway look the latest code :-)

Li
Previous Topic:Visbility of nodes and their children
Next Topic:Is it possible to map one domain model to different canvas?
Goto Forum:
  


Current Time: Tue Apr 23 15:36:19 GMT 2024

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

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

Back to the top