Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Editor undo all changes when not saving
Editor undo all changes when not saving [message #690293] Wed, 29 June 2011 06:22 Go to next message
Eclipse UserFriend
Hi,

I've implemented databinding in my editor and it gets marked dirty when a change is made. But I want to revert (undo all) changes when the editor is closed AND not saved. How do I achieve this?

Example:

- Editor of a person is open
- Change name 'Ryan' into 'Rya' (dirty state is set)
- Close editor without saving
- Name of person should be 'Ryan' and not 'Rya'


Another (less prio) question I have is regarding the dirty state. Is it possible to remove the dirty state when all changes are gone?

Example:

- Editor of a person is open
- Change name 'Ryan' into 'Rya' (dirty state is set)
- Change name 'Rya' into 'Ryan' (dirty state should be gone, but isn't)

[Updated on: Wed, 29 June 2011 07:50] by Moderator

Re: Editor revert all changes when not saving [message #690519 is a reply to message #690293] Wed, 29 June 2011 12:04 Go to previous message
Eclipse UserFriend
Ricky,

Comments below.

On 29/06/2011 3:22 AM, Ricky de Klerck wrote:
> Hi,
>
> I've implemented databinding on my editor and it gets marked dirty
> when a change is made. But I want to revert (undo all) changes when
> the editor is closed AND not saved. How do I achieve this?
What is holding onto the state after the editor is closed?
>
> Example:
>
> - Editor of a person is open
> - Change name 'Ryan' into 'Rya' (dirty state is set)
> - Close editor without saving
Do you really mean an editor?
> - Name of person should be 'Ryan' and not 'Rya'
>
>
> Another (less prio) question I have is regarding the dirty state. Is
> it possible to remove the dirty state when all changes are gone?
Yes.
>
> Example:
>
> - Editor of a person is open
> - Change name 'Ryan' into 'Rya' (dirty state is set)
> - Change name 'Rya' into 'Ryan' (dirty state should be gone, but isn't)
No, I'd expect your editor to implement undo and there would be two
commands you'd need to be able to undo.

Have you implemented undo? If so, you might want to invoke it up to the
point where the editor isn't dirty when you close the editor without
saving...
Previous Topic:Plug-in fragment to overwrite a view
Next Topic:Web Start and Bundle-Classpath
Goto Forum:
  


Current Time: Sun Aug 31 11:37:31 EDT 2025

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

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

Back to the top