Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to reveal a just added editPart ?
How to reveal a just added editPart ? [message #186262] Mon, 04 July 2005 13:17 Go to next message
Eclipse UserFriend
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 05:40 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7658
Registered: July 2009
Senior Member
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
Previous Topic:TextFlow + scrollbars
Next Topic:key mapping SWT
Goto Forum:
  


Current Time: Tue May 14 00:23:25 GMT 2024

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

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

Back to the top