Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » automatic ports creation after loading one of the diagrams( )
automatic ports creation after loading one of the diagrams [message #1067895] Thu, 11 July 2013 07:32 Go to next message
abdallah Q is currently offline abdallah QFriend
Messages: 14
Registered: May 2013
Junior Member
hey all,

am working with ports right now and what am trying to do is to load ports from the upper level diagrams and add them inside the selected elements after selecting the type at the property using the refresh() function, the problem is the following:

- i tried to add the port to the diagram its self and its working but adding it to the element container ship is not working and i don't know why :/

here is a code that can help you to understand the idea:
-this code works :
AddContext context = new AddContext();
context.setTargetContainer((ContainerShape) getdiagram());<-----------------
context.setNewObject(ob);
getFeatureProvider().addIfPossible( new AddContext(context, fp));

but this one does not :
PictogramElement pe = getSelectedPictogramElement();
.
.....
.
AddContext context = new AddContext();
context.setTargetContainer((ContainerShape) pe);<-----------
context.setNewObject(ob);
getFeatureProvider().addIfPossible( new AddContext(context, fp));

any idea about what is wrong?

[Updated on: Thu, 11 July 2013 08:34]

Report message to a moderator

Re: automatic ports creation after loading one of the diagrams [message #1067951 is a reply to message #1067895] Thu, 11 July 2013 11:58 Go to previous messageGo to next message
abdallah Q is currently offline abdallah QFriend
Messages: 14
Registered: May 2013
Junior Member
i found whats wrong Smile i'm posting this so others can fix it when they face the same problem , all what i had to do is to change the target container condition from diagram to my element data type at the canCreate() function. thats it!

Re: automatic ports creation after loading on of the diagrams [message #1070168 is a reply to message #1067895] Wed, 17 July 2013 11:30 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1640
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Abdallah,

not sure if I understood your issue...

I assume you have 2 diagram types, one showing some kind of overview the
other a detail. An element of the overview is also part of the details
diagram (visualized as "ports" there).

To automatically add the ports, you should have an update feature in place
in your details diagram that adds the ports as they are defined in the
overview.

Not sure if that helps...

Michael
Previous Topic:Graphiti Editor in a E4 rcp application
Next Topic:Graphiti
Goto Forum:
  


Current Time: Thu Dec 18 13:38:43 GMT 2014

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

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