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 15:17
Eclipse User
Originally posted by: micha.on.the.road.web.de

Hi,

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
Michael
Previous Topic:Graph too small
Next Topic:TabbedPane
Goto Forum:
  


Current Time: Fri Aug 29 08:21:00 EDT 2014

Powered by FUDForum. Page generated in 0.01731 seconds