Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Rationale for ForwardUndoCompoundCommand
Rationale for ForwardUndoCompoundCommand [message #192349] Thu, 18 August 2005 05:46 Go to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7681
Registered: July 2009
Senior Member
Hi

ForwardUndoCompoundCommand changes the default CompoundCommand behaviour of
forward do/redo, reverse undo to provide forward undo.

Surely forward undo can only be correct when all commands are stateless and
just toggle behaviour? In practice many commands assign values and are stateful
- caching a state for undo.

What is/was the rationale for this class, which is used for the EDiagram properties?

Regards

Ed Willink
Re: Rationale for ForwardUndoCompoundCommand [message #192411 is a reply to message #192349] Thu, 18 August 2005 17:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Go to the construtor and search for references. You will see that it is used
for undoing the applying of nested property changes by the property sheet.

"Ed Willink" <ed@willink.me.uk> wrote in message
news:de17aq$5id$1@news.eclipse.org...
> Hi
>
> ForwardUndoCompoundCommand changes the default CompoundCommand behaviour
> of
> forward do/redo, reverse undo to provide forward undo.
>
> Surely forward undo can only be correct when all commands are stateless
> and
> just toggle behaviour? In practice many commands assign values and are
> stateful
> - caching a state for undo.
>
> What is/was the rationale for this class, which is used for the EDiagram
> properties?
>
> Regards
>
> Ed Willink
>
Re: Rationale for ForwardUndoCompoundCommand [message #192448 is a reply to message #192411] Thu, 18 August 2005 19:28 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7681
Registered: July 2009
Senior Member
Randy Hudson wrote:
> Go to the construtor and search for references. You will see that it is used
> for undoing the applying of nested property changes by the property sheet.

Yes I saw that comment, but it didn't help me beyond making me realise that
the author was clearly very determined to do things 'backwards'.

Given nested property changes, it still seems appropriate to undo in reverse order.

I change A, then A.B, then A.B.C, so I unchange A.B.C, then A.B, then A so
that in each case the unchange has a start corresponding to its earlier finish.

Regards

Ed Willink
Re: Rationale for ForwardUndoCompoundCommand [message #192500 is a reply to message #192448] Thu, 18 August 2005 22:27 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

That's not what the property sheet does. For example, it first sets a
point's X property on the point, then it sets the point on the property
source. When undoing, you need to undo the X change first, then undo the
"location" change second. It has to do with property sources returning
immutable or by-value objects, or, the value with sub-properties is not
observable so it would impossible to see the X value changing.


>
> Regards
>
> Ed Willink
Previous Topic:Rationale for non-modelChildren links in EDiagram
Next Topic:AWT in Draw2D
Goto Forum:
  


Current Time: Thu Jan 16 23:18:28 GMT 2025

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

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

Back to the top