use of org.talend.designer.business.diagram.custom.commands.CreateAssignmentCommand in project tdi-studio-se by Talend.
the class BusinessItemDragDropEditPolicy method getDropObjectsCommand.
/*
* (non-Javadoc)
*
* @see
* org.eclipse.gmf.runtime.diagram.ui.editpolicies.DiagramDragDropEditPolicy#getDropObjectsCommand(org.eclipse.gmf
* .runtime.diagram.ui.requests.DropObjectsRequest)
*/
@Override
public Command getDropObjectsCommand(DropObjectsRequest dropObjectsRequest) {
BusinessItem businessItem = new ElementHelper().getElement(getHost());
if (businessItem != null) {
CreateAssignmentCommand createAssignmentCommand = new CreateAssignmentCommand(((IGraphicalEditPart) getHost()).getEditingDomain());
createAssignmentCommand.setBusinessItem(businessItem);
createAssignmentCommand.setItems(dropObjectsRequest.getObjects());
return new ICommandProxy(createAssignmentCommand);
}
return UnexecutableCommand.INSTANCE;
}
Aggregations