Skip to main content
June 24, 2009
Question

Problems with UndoManager

  • June 24, 2009
  • 1 reply
  • 973 views

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 has been closed for replies.

1 reply

June 28, 2009

Any ideas?

Adobe Employee
June 28, 2009

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

June 28, 2009

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