Skip to main content
Jun 24, 2009 4:55 PM UTC
Question

Problems with UndoManager

Dear sirs,


The undo manager, by default, saves the action to be later undone later? In my application is not work perfectly. I write the text,    
change something (formatting or positioning), and when I call the undo, this not is undone perfectly.

The images attached, shows my actions sorted .

1 - Initial text

2 - Text Edited

3 - Undo max


NOTE: Was not exceeded the limit of 25 actions.

The source code was also be attached.

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

Jun 28, 2009 12:58 PM UTC

Any ideas?

Translate
Adobe Employee
Jun 28, 2009 8:35 PM UTC

The UndoManager is only able to undo changes made with the EditManager. The EditManager groups changes into FlowOperations, where each operation is able to undo itself. This is not possible with changes made directly to the FlowElements, as done in your example. If you change your example to call EditManager.applyLeafElement, then your changes will be undoable. Note that any direct changes you make to the TextFlow will nullify the undo; in order for undo to work, you have to make all your changes with the EditManager.

- robin

Translate
Jun 28, 2009 10:26 PM UTC

Sorry, did not understand right. The solution would use applyFormatToElement instead of applyLeafFormat? I dont know other way to apply formatting in textflow.

Thanks for your help!

- Marcos

Translate