Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Unifying Undo & Redo stacks in a Multipage editor
Unifying Undo & Redo stacks in a Multipage editor [message #139174] Tue, 22 June 2004 06:05 Go to next message
Eclipse UserFriend
Originally posted by: brianv.phreaker.net

Hi Guys,

I have 2 page mutipage editor - one text page and the other is a GEF page.
Changes in the text are reflected in my GEF editor and viceversa.

Undo and Redo work well as long as I don't switch pages; if I do - I have to
flush the undo stacks depending on the commands executed before switching.

What I want to do right now, is interleave the undo and redo stacks of both
the pages.

ie. Suppose I am in the source page, and I delete some text, then I switch
to the GEF page and move some part around. Now, while in the GEF page, if I
press undo - first the part move is undone. If I press undo again, then the
text deletion should be undone (and the GEF page is probably refreshed
inorder to synch with the new source). This should work the other way round
too - the source should editor also be able to undo GEF commands.

Two approaches that I have thought of so far -

1) Use a single command stack - Extend the EditDomin (for GEF) and
re-implement IUndoManager (Text editor) to use this stack. This does not
look too bad for GEF , but seems like a lot of rework required in
implementing IUndoManager and plugging it in.

2) Second approach is to place a hook somewhere that is aware of the
commands being pushed on the stacks. It will probably maintain it's own list
of where the commands originated from (the source editor or the GEF editor).
When you undo or redo, this will delegate the action to the appropriate
stack.

Both the above don't seem like fun things to do ... any better ideas or
suggestions on the above techniques ?

Thanks,
Brian.
Re: Unifying Undo & Redo stacks in a Multipage editor [message #139381 is a reply to message #139174] Tue, 22 June 2004 15:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

A single command stack is definitely the starting point. The rest is
dependant on the capabilities of your model. IBM's Page Designer has both
GEF and source view, and does exactly what you describe. I think that all
commands operate on the source's document.

"Brian Fernandes" <brianv@phreaker.net> wrote in message
news:cb8ib5$kdh$1@eclipse.org...
> Hi Guys,
>
> I have 2 page mutipage editor - one text page and the other is a GEF page.
> Changes in the text are reflected in my GEF editor and viceversa.
>
> Undo and Redo work well as long as I don't switch pages; if I do - I have
to
> flush the undo stacks depending on the commands executed before switching.
>
> What I want to do right now, is interleave the undo and redo stacks of
both
> the pages.
>
> ie. Suppose I am in the source page, and I delete some text, then I switch
> to the GEF page and move some part around. Now, while in the GEF page, if
I
> press undo - first the part move is undone. If I press undo again, then
the
> text deletion should be undone (and the GEF page is probably refreshed
> inorder to synch with the new source). This should work the other way
round
> too - the source should editor also be able to undo GEF commands.
>
> Two approaches that I have thought of so far -
>
> 1) Use a single command stack - Extend the EditDomin (for GEF) and
> re-implement IUndoManager (Text editor) to use this stack. This does not
> look too bad for GEF , but seems like a lot of rework required in
> implementing IUndoManager and plugging it in.
>
> 2) Second approach is to place a hook somewhere that is aware of the
> commands being pushed on the stacks. It will probably maintain it's own
list
> of where the commands originated from (the source editor or the GEF
editor).
> When you undo or redo, this will delegate the action to the appropriate
> stack.
>
> Both the above don't seem like fun things to do ... any better ideas or
> suggestions on the above techniques ?
>
> Thanks,
> Brian.
>
>
Re: Unifying Undo & Redo stacks in a Multipage editor [message #139547 is a reply to message #139381] Tue, 22 June 2004 21:35 Go to previous message
Eclipse UserFriend
Originally posted by: brianv.phreaker.net

> A single command stack is definitely the starting point. The rest is
> dependant on the capabilities of your model. IBM's Page Designer has both
> GEF and source view, and does exactly what you describe. I think that all
> commands operate on the source's document.

Great - thanks for the heads up. Page Designer seems to be a part of
Websphere... is the source to that available ? Websphere is a commercial
product, so I guess not.

I'll investiage this approach and post queries here.

Thanks,
Brian.
Previous Topic:SWT_AWT not on Windows
Next Topic:repopulate palette
Goto Forum:
  


Current Time: Sat Sep 21 05:23:18 GMT 2024

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

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

Back to the top