|
Re: Create node by double clicking [message #226563 is a reply to message #226329] |
Fri, 17 April 2009 11:19 |
Jose Salazar Messages: 34 Registered: July 2009 |
Member |
|
|
Hello,
If the link points to an existing node, the link is created, however, if
the link points to the node created, the link is not created. This is an
extract of my code:
...
CompoundCommand cc = new CompoundCommand();
CreateViewRequest featureRequest =
CreateViewRequestFactory.getCreateShapeRequest(XXXElementTyp es.Feature_2001,
XXXDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
Command createFeatureCmd = ((EditPart)
projectEditPart).getCommand(featureRequest);
IAdaptable featureViewAdapter = (IAdaptable)
((List)featureRequest.getNewObject()).get(0);
cc.add(createFeatureCmd);
ICommand createSubTopicsCmd = new
DeferredCreateConnectionViewAndElementCommand(new
CreateConnectionViewAndElementRequest(
XXXElementTypes.RelationSelected_4003,((IHintedType)
XXXElementTypes.RelationSelected_4003).getSemanticHint(),
XXXDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT), new
EObjectAdapter((EObject) fatherElement.getModel()),featureViewAdapter,
fatherElement.getViewer());
cc.add(new ICommandProxy(createSubTopicsCmd));
...
I don't know what could be the problem. In an IObjectActionDelegate works
but not on an AbstractTransactionalCommand.
Where is the problem? Is this the right way to do what I want?
Any help is aprecciated.
Thanks in advance.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03404 seconds