Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » ICreateConnection.create(): returning null Connection allowed?
ICreateConnection.create(): returning null Connection allowed? [message #881861] Tue, 05 June 2012 11:51 Go to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 840
Registered: July 2009
Senior Member
The ICreateConnection.create() method has to return a Connection. This connection is not used anywhere in the graphiti internals. Is it safe to return null or do I have to always return a valid Connection because of future extensions of graphiti?

Background: I have two Shapes A and B. If the user creates a Connection between A and B, then the AddConnectionFeature is called. In the AddConnectionFeature I create an "intermediate node N" visualized by a Shape. Then, A is connected to N and N is connected to B by two Connections (FreeFormConnections)...
That all seems to work, but I am not sure of future changes of graphiti as I would have to return a Connection that is composed of two Connections. Currently, I would just return null as that doesn't seem to matter...
Re: ICreateConnection.create(): returning null Connection allowed? [message #882262 is a reply to message #881861] Wed, 06 June 2012 06:27 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1886
Registered: July 2009
Location: Walldorf, Germany
Senior Member
It's no problem returning null there. There are no concrete plans to change
the behavior of Graphiti here. The idea behind the return value was to maybe
lateron add some performance improvements in the editor refresh, but they
will be implemented in a compatible way, if they come.

Previous Topic:[DND] Drop business object from external TableViewer
Next Topic:Problem Marker deleted at diagram opening
Goto Forum:

Current Time: Sun Apr 22 16:33:05 GMT 2018

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

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