How to programmatically resize a structured edit part [message #86120] |
Mon, 18 December 2006 03:37  |
Eclipse User |
|
|
|
Hi all,
depending on some decorations, I want to resize a "structured" edit part - a
UML class with a name label, compartments for properties and methods - by
some code.
To make the class node wider, I tried to call setSize() on nodeFigure and
classFigure level but without effect. Calling setSize() on the label figure
enlarges that one, but I don't manage to trigger a refresh of the parent
figure by calling invalidate() / invalidateTree().
I tried both working on the figures from within the decorator and from a
newly created edit policy.
I already recognized a significant number of resize-related threads here,
but none of them deals with programmatic resize.
Thanks for your help,
Martin
|
|
|
|
|
Re: How to programmatically resize a structured edit part [message #86180 is a reply to message #86165] |
Mon, 18 December 2006 11:03  |
Eclipse User |
|
|
|
Hello Martin,
> I recognized that getLayoutConstraint() returns null for my classname
> edit part. However, it returns a contraint when called on the
> surrounding class edit part.
That's correct - you can change a size of surrounding node only (Class Node).
> But setting values on that object (e.g. setSize()) results in an error
> saying that I am not allowed to change the resource from outside a
> write transaction.
You can create new AbstractEMFOperation() instance using proper EditingDomain
as a parameter (accessor method is available in GraphicalEditPart), put working
code into implementation of doExecute() method and execute this operation.
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.04486 seconds