• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UndoManager Help

 
Anand Loni
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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.

Hoping for reply...
 
Paul Clapham
Sheriff
Posts: 21152
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Anand Loni
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

Thanks a lot...
The code is working fine....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic