Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » view.getContainer not setted : consequence of using phatom nodes ??
view.getContainer not setted : consequence of using phatom nodes ?? [message #198365] Tue, 22 July 2008 13:17
Eclipse UserFriend
Originally posted by:


I have used phatom nodes in my project as following:
- I have a NodeA that contains NodeB that contains NodeC
- I created a diagram where A contains B via a compartment
- When I double clik on B I open a sub-editor.
- I wanted in my sub-editor a figure B_bis that represents B the root
element of my sub diagram. In B_bis there is a compartment where I drag
and drop Cs.
- I did this by :
1) defining a phantom node B_bis in the gmfmap that is supposed to
welcome C elements
2) I make the B_bis refrence the B element in the main editor via
the "referenced child" property.
3) I did some hand code modification in the sub-editor plug-in to
display the B_bis element:
- I changed the BCanonicalEditPolicy to call
getSemanticChildren() instead of getB_1000SemanticChildren()
- I make getSemanticChidlren add the B_bis to the list of
children before calling getB_1000SemanticChildren() in the B visualID case
- I changed the BVisualIDRegistry to make it return
B_bisvisualID in the the BvisualID case.

Nota: This is how they did in uml2 tools to display a visual element to
store package imports

The problems I have is that when I try to drag Cs they are added to the
semantic model but not the graphical one.
I tried to debug and and discovered that in
getBCsCompartment_VIDSematincChildren() it returns an empty list because
the containerView is not setted.
I commented the test and everything works fine but I think it will cause
me some problems in the future.

Does someone have an explanation ? And/Or a solution get rid of this in
better way than just commenting the code ?

Thanks in advance.
Previous Topic:Adding items to right-click menu
Next Topic:how to restore .gmf files
Goto Forum:

Current Time: Tue May 18 11:05:30 GMT 2021

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

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

Back to the top