Source:
public Command getCommand(Request request) { if (understandsRequest(request)) { if (request instanceof CreateViewRequest) { CreateViewRequest createViewRequest = (CreateViewRequest) request; for (ViewDescriptor vd : createViewRequest.getViewDescriptors()) { IElementType elementType = vd.getElementAdapter().getAdapter(IElementType.class); if (elementType != null) { Command cmd = getCustomCreateCommand(request, null, elementType, vd.getSemanticHint()); if (cmd != null) { return cmd; } } } } else if (request instanceof CreateUnspecifiedTypeRequest) { CreateUnspecifiedTypeRequest unspecReq = (CreateUnspecifiedTypeRequest) request; for (Object elementTypeObj : unspecReq.getElementTypes()) { IElementType elementType = (IElementType) elementTypeObj; if (elementType instanceof IHintedType) { CreateRequest createRequest = unspecReq.getRequestForType(elementType); Command cmd = getCustomCreateCommand(request, createRequest, elementType, ((IHintedType) elementType).getSemanticHint()); if (cmd != null) { return cmd; } } } } else if (request instanceof ChangeBoundsRequest) { ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest) request; Point mouseLocation = changeBoundsRequest.getLocation(); DropObjectsRequest dropRequest = new DropObjectsRequest(); dropRequest.setLocation(mouseLocation); List<View> list = new ArrayList<View>(); for (Object epObj : changeBoundsRequest.getEditParts()) { if (epObj instanceof RegionEditPart) { EditPart ep = (EditPart) epObj; View regionToDrag = (View) ep.getModel(); list.add(regionToDrag); } } dropRequest.setObjects(list); return getHost().getCommand(dropRequest); } return super.getCommand(request); } return null; }

Target:
public Command getCommand(Request request) { if (understandsRequest(request)) { if (request instanceof CreateViewRequest) { CreateViewRequest createViewRequest = (CreateViewRequest) request; for (ViewDescriptor vd : createViewRequest.getViewDescriptors()) { IElementType elementType = vd.getElementAdapter().getAdapter(IElementType.class); if (elementType != null) { Command cmd = getCustomCreateCommand(request, null, elementType, vd.getSemanticHint()); if (cmd != null) { return cmd; } } } } else if (request instanceof CreateUnspecifiedTypeRequest) { CreateUnspecifiedTypeRequest unspecReq = (CreateUnspecifiedTypeRequest) request; for (Object elementTypeObj : unspecReq.getElementTypes()) { if (elementTypeObj instanceof IHintedType) { IHintedType hintedType = (IHintedType) elementTypeObj; CreateRequest createRequest = unspecReq.getRequestForType(hintedType); Command cmd = getCustomCreateCommand(request, createRequest, hintedType, hintedType.getSemanticHint()); if (cmd != null) { return cmd; } } } } else if (request instanceof ChangeBoundsRequest) { ChangeBoundsRequest changeBoundsRequest = (ChangeBoundsRequest) request; Point mouseLocation = changeBoundsRequest.getLocation(); DropObjectsRequest dropRequest = new DropObjectsRequest(); dropRequest.setLocation(mouseLocation); List<View> list = new ArrayList<View>(); for (Object epObj : changeBoundsRequest.getEditParts()) { if (epObj instanceof RegionEditPart) { EditPart ep = (EditPart) epObj; View regionToDrag = (View) ep.getModel(); list.add(regionToDrag); } } dropRequest.setObjects(list); return getHost().getCommand(dropRequest); } return super.getCommand(request); } return null; }