Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » DeleteCommand and order of elements
DeleteCommand and order of elements [message #544875] Mon, 05 July 2010 19:17
Eclipse UserFriend
Originally posted by:


I use the ComponentEditPolicy and implement createDeleteCommand()
returning a delete Command for a single object. Marking several objects
and deleting works fine but undo() mixes up the order of my models. It
is not possible to store the position to insert them properly.

I thought of a GEF bug - undo() wouldn't iterate reversely through the
list but it's not this.

The problem is that in DeleteAction a CompoundCommand is created but
every time - after on delete gets executed (caused by ... ->
handleSelectionChanged()->DeleteAction.refresh()) - it is refilled and
the order of my elements is mixed up.

So my question: what is the proper way to implement a DeleteCommand that
maintains order on undo?
Is there any way to avoid the creation of multiple DeleteCommands
embedded in a CompoundCommand? I would prefer to have one command for a
selection that deletes the list of children at once. Like this it would
be easy to maintain the order.

Thanks a lot
Previous Topic:Graph too small
Next Topic:TabbedPane
Goto Forum:

Current Time: Thu Apr 19 13:20:58 GMT 2018

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

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