Programmatically resizing an element [message #228680] |
Thu, 04 January 2007 15:58 |
Eclipse User |
|
|
|
Originally posted by: wolffischer.gmx.de
Hi there,
i want to programmatically resize an editpart out of another editpart.
So, what i do, is creating a ChangeBoundsRequest:
ChangeBoundsRequest cbr = new ChangeBoundsRequest();
cbr.setEditParts(this.getParent());
cbr.setLocation(new Point(0, 0));
cbr.setSizeDelta(new Dimension(200, 200));
cbr.setType(REQ_RESIZE_CHILDREN);
Afterwards, i call
Command resize = this.getParent().getParent().getCommand(cbr);
Here i try to get the command out of the grandparents editpart, but the
only thing i get, is null. There is a
protected Command createChangeConstraintCommand(ChangeBoundsRequest request,
EditPart child, Object constraint)
method in the grandparents editpolicies, so that shouldnt be the problem.
In the end i wanted to execute the command on the CommandStack:
CommandStack cs = getViewer().getEditDomain().getCommandStack();
cs.execute(resize);
Can someone help me? I currently have no idea, why i receive a null from
my parent. Or is there any other way of firing a request for changing
the size of another element?
Thanks for help!
Wolf
|
|
|
Powered by
FUDForum. Page generated in 0.03444 seconds