How to reveal a just added editPart ? [message #186262] |
Mon, 04 July 2005 09:17  |
Eclipse User |
|
|
|
Originally posted by: steph_poubelle.yahoo.fr
Hye,
After adding an edit part, I want to select it, to set it the focus and
to reveal it. Select and focus works perfectly because it just set some
flags that are taken into account when there is a refresh.
I have tried to call reveal() when I receive an ADD_CHILD property
changed notification. But reveal() doesn't work because the editPart and
its associated figure are created, but the bounds of the figure are not
yet computed. After, it is too late because I don't know more that the
editPart has just been added.
It's a tricky problem and I can't see the solution. If anyone get it ...
Thanks.
Stephane
|
|
|
Re: How to reveal a just added editPart ? [message #186327 is a reply to message #186262] |
Tue, 05 July 2005 01:40  |
Eclipse User |
|
|
|
Hi Stephane
In the EDiagram example (see GEF's CVS), this problem is resolved
by caching the new object in a CreateRequest so that the CreationTool.performCreation
method can selectAddedObject().
This only works for node creation (not link creation or undo/redo) so in my revision
of EDiagram (soon to be available from the Eclipse GMT UMLX sub-project) I
invoke one of addSelectedObjectsWhenDone/Undone on my derived Commands from my
derived CreationTool, ConnectionCreationTool, UndoAction and DeleteAction
to build a list of objects to be selected.
Regards
Ed Willink
Stephane wrote:
> Hye,
>
> After adding an edit part, I want to select it, to set it the focus and
> to reveal it. Select and focus works perfectly because it just set some
> flags that are taken into account when there is a refresh.
> I have tried to call reveal() when I receive an ADD_CHILD property
> changed notification. But reveal() doesn't work because the editPart and
> its associated figure are created, but the bounds of the figure are not
> yet computed. After, it is too late because I don't know more that the
> editPart has just been added.
> It's a tricky problem and I can't see the solution. If anyone get it ...
>
> Thanks.
>
> Stephane
|
|
|
Powered by
FUDForum. Page generated in 0.03745 seconds