Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Undo/Redo Proposal

Some further comments:

In my earlier comments, I suggested that each editor have its own undo 
history.
I'm not sure I believe this anymore.  While I believe that a single global 
history is not the right answer, it's not clear that an editor should have 
its own history.

If undo/redo should be model-centric, then it makes more sense for the 
document to have its own undo history, not the editor.
We currently allow the same file (document) to be open in multiple editors 
(i.e. in a different page or window). 
Changes applied in one are visible in the other.  It therefore feels that 
actions done in one should be undoable in the other.

Unfortunately, the workbench itself has no general notion of a document or 
buffer.  The current document sharing is defined by JFace Text (and is 
supported at the Eclipse UI level).
This lack of a general document model poses a problem in other areas too. 
For example, we were considering having a limited number of editor tabs, 
but still having the open documents available via another dialog, much 
like Emacs does.  We can't currently do this in general, just for text.

At first I thought it might make sense to allow a part to create its own 
history.  In this case, the text editor would create a new history for the 
document, if it didn't already have one.
But we haven't solved the problem of multiple histories yet, even in the 
restricted case of one global history plus one history per editor.
So I wouldn't recommend this approach currently <g>.

For now, we could provide the undo service to parts, and manage a separate 
history per editor.
This is what people will want if they do their own nontextual editors, 
unless they also have their own shared document model.

If we later come up with a generic shared document model, then we can 
provide an undo service to the document.
We could do this now for text documents.  We just need to ensure that the 
document's undo service doesn't conflict with the editor's.
This could require asking the undo service to activate itself, rather than 
assuming it's always active.
In the case of text editors, the editor's undo service would not be 
activated, but the document's service would be.

Nick


Back to the top