File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How do I get an UndoableEdit to absorb another UE? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How do I get an UndoableEdit to absorb another UE?" Watch "How do I get an UndoableEdit to absorb another UE?" New topic
Author

How do I get an UndoableEdit to absorb another UE?

Matt Senecal
Ranch Hand

Joined: Dec 01, 2000
Posts: 255
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!


There's nothing more dangerous than a resourceful idiot. ---Dilbert
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I get an UndoableEdit to absorb another UE?