The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

How do I get an UndoableEdit to absorb another UE?

Posted by Matt Senecal on December 01, 2000 at 11:41 AM

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!




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us