Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Programmatically resizing an element
Programmatically resizing an element [message #228680] Thu, 04 January 2007 15:58
Eclipse UserFriend
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
Previous Topic:"Static" GEF Figures?
Next Topic:org.eclipse.gef.text.examples
Goto Forum:
  


Current Time: Sat Apr 27 00:06:53 GMT 2024

Powered by FUDForum. Page generated in 0.03444 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top