|[Databinding] Caret position with undo/redo [message #929179]
||Mon, 01 October 2012 05:26
| Cedric Moonen
Registered: August 2009
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.
Powered by FUDForum
. Page generated in 0.01851 seconds