[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] How I can create connections programmatically between nodes, also created programmatically?

Hi,
I have the following problem. If I change the type of a function block 
(node), then I would like to insert further function blocks automatically 
and connect these new functions blocks with connecting lines between the 
function blocks.
The creation of funktions blocks is simple and works well.
I would like to connect the nodes with each other and use for it 
CreateConnectionViewAndElementRequest.

CreateConnectionViewAndElementRequest.ConnectionViewAndElementDescriptor 
descriptor = new 
CreateConnectionViewAndElementRequest.ConnectionViewAndElementDescriptor(new 
CreateElementRequestAdapter(new CreateElementRequest(type)),((IHintedType) 
type).getSemanticHint(), getDiagramPreferencesHint());
CreateConnectionViewAndElementRequest request = new 
CreateConnectionViewAndElementRequest(descriptor);
Command cmd = 
request.getCreateCommand(request,OutputEditPart,InputEditPart);
executeCommand(cmd);

Unfortunately, this doesn't work. Am I on the wrong way? Can anybody help 
me?
Thank you!
Steffen