public class StructuredActivityLayoutEditPolicy extends LayoutEditPolicy {
protected Command createAddCommand(EditPart child) {
Activity activity = (Activity) child.getModel();
EditPartViewer viewer = getHost().getViewer();
AddCommand add = new AddCommand(activity.getDiagram().getTextEditor(), viewer);
add.setParent((StructuredActivity) getHost().getModel());
add.setChild(activity);
return add;
}