I am using undoManager for Textfield. I have Popup menu associated with textfield. When I click undo from poppup menu single character from textfield is undone. How can I undo all characters that I have typed before undo.
I wanted my code to behave more like some well-known text editors, where when you type "abcd" and then hit undo, all four letters disappear from the screen. The requirements are more complex than that, if you look carefully, but this is what I came up with:This is in a class that extends UndoManager, by the way. There's some constants and instance variables you need in this class:and the ExpandableEdit class is like this:I chopped this out of working code, hopefully I haven't missed out too much and you can get started with this.