Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I get an UndoableEdit to absorb another UE?

 
Matt Senecal
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've implemented Swing's default Undo/redo functions in a text editor (using UndoManager, UndoableEditListener, etc.) but find that the default impementation can only undo one character at a time. I see that UndoableEdit has a method .addEdit() that allows it to absorb another UE, creating a "bigger" UE. Unfortunately, I can't seem to get it to work. When I call .addEdit(), it returns false, indicating that the UE can't absorb anything. Can anyone tell me how to get this to work?
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic