Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [Databinding] Caret position with undo/redo
[Databinding] Caret position with undo/redo [message #929179] Mon, 01 October 2012 09:26 Go to next message
Cedric Moonen is currently offline Cedric Moonen
Messages: 274
Registered: August 2009
Senior Member
Hello,

We are using Jface databinding to bind a text widget to a property in an EMF model. The IObservableValue corresponding to the EMF property is created using EMFEditProperties, which allows to have easy support for undo/redo operations.
Everything works fine except for a little annoying fact: when undoing text that has been inserted in the widget, the caret position always returns to the beginnging. This is very annoying, specially for mutli-line text widgets.

I have in fact two questions linked to that:
1) Is there a way for the widget to keep the current caret position after the model has been changed ?
2) Is there a way to modify to modify the "commit" behavior of the changes ? What I mean with that is that undo would work for a full word instead of a single character (a bit like a java editor). Of course, this would require some logic to be implemented to decide when changes have to be commited to the model.

Thanks,
C├ędric
Re: [Databinding] Caret position with undo/redo [message #953407 is a reply to message #929179] Mon, 22 October 2012 08:12 Go to previous message
Cedric Moonen is currently offline Cedric Moonen
Messages: 274
Registered: August 2009
Senior Member
Is there anybody that has the same requirement and found a potential solution ?
It seems a bit akward that this has not been mentionned before since this seems like a very common case (undo/redo with EMF and JFace).
Previous Topic:TreeViewer Databinding Problem
Next Topic:How to get an Object from a ComboViewer?
Goto Forum:
  


Current Time: Sun Sep 21 00:20:21 GMT 2014

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

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