Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Programatically open diagram of referenced model element
Programatically open diagram of referenced model element [message #493776] Tue, 27 October 2009 23:14 Go to next message
Dénes Harmath is currently offline Dénes HarmathFriend
Messages: 157
Registered: July 2009
Senior Member
Hi all,

I want to open a diagram of a model element (say B) defined by an EReference of another model element (say A), which is appearing on the diagram. How can I do this?
I thought of two ways:

1. Assigning an Open Diagram Behaviour to the A edit part, and override its getOpenCommand() and OpenDiagramCommand#getDiagramDomainElement() methods to return the appropriate model element. But I don't know how to override the former: the diagram link style is queried from the A edit part's view. How do I get the correct diagram link style of the B edit part's view?
2. Assigning a Custom Behaviour to the A edit part with key of OpenRequest, and programatically open the diagram with the related B model element as diagram root. How can this be done?

Thanks in advance,
thSoft
Re: Programatically open diagram of referenced model element [message #495136 is a reply to message #493776] Tue, 03 November 2009 21:24 Go to previous messageGo to next message
Alex Shatalin is currently offline Alex ShatalinFriend
Messages: 141
Registered: July 2009
Senior Member
Hello Dennis,

> How do I get the correct diagram link style of the B edit part's view?
((View) diagramFacet.eContainer()).getElement() will return underlying instance
of A element, so you can cast it to A and call .getB()

-----------------
Alex Shatalin
Re: Programatically open diagram of referenced model element [message #501932 is a reply to message #495136] Fri, 04 December 2009 14:11 Go to previous message
Dénes Harmath is currently offline Dénes HarmathFriend
Messages: 157
Registered: July 2009
Senior Member
Thank you. Meanwhile, I solve this use case with shortcuts, so I started another thread about it: http://www.eclipse.org/forums/index.php?t=msg&th=158929& amp;start=0&S=ca863d98385a4968c21d373b77b82493
Previous Topic:Open diagram of shortcut
Next Topic:Specific graphical definition
Goto Forum:
  


Current Time: Fri Apr 26 02:28:47 GMT 2024

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

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

Back to the top