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 07:51 Go to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 729
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 02:27 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1577
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.

Michael
Previous Topic:[DND] Drop business object from external TableViewer
Next Topic:Adding icons to the palette
Goto Forum:
  


Current Time: Thu Jul 31 03:27:39 EDT 2014

Powered by FUDForum. Page generated in 0.01528 seconds