Hi all,
I try to do something like swimlanes in a pool which can be resized. In order to reach this I added a ResizableShapeEditPolicy to the contained element. This makes it showing resize handles.
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableShapeEditPolicy());
In the EditPolicy of the containing compartment I did override the getCommand method with this:
if (request instanceof ChangeBoundsRequest){
ChangeBoundsRequest req = (ChangeBoundsRequest)request;
ContainedEditPart part = (ContainedEditPart)req.getEditParts().get(0);
Dimension newSize = model.getSize();
newSize.height = newSize.height + req.getSizeDelta().height;
newSize.height = newSize.width + req.getSizeDelta().width;
SetBoundsCommand sbc = new SetBoundsCommand(model.getEditingDomain(), "Resize Containee", new EObjectAdapter((View)part.getModel()), newSize);
return new ICommandProxy(sbc);
This executes but the contained editpart is not horizontally stretching and resized to a very small size. No matter how huge I resize it.
Thanks,
Ralph