Skip to main content
Participant
May 27, 2010
Question

Adding a paragrph element as an undoable action

  • May 27, 2010
  • 2 replies
  • 577 views

HI there


I am working on creating a bullet function. It works like this:

  1. Get the current paragraph selection and use a formatting function - paragraphStartIndent to move that over to the left
  2. prepend a new paragraph element containing the bullet and use  baselineShift to move that down.

I can repeat that for all selected paragraphs. So now the question is how do I make the addChildAt undoable in  the same way everything else is via editmanager.

cheers richard

This topic has been closed for replies.

2 replies

Adobe Employee
June 1, 2010

You can use IEditManager.splitParagraph. If you wish, you can group it with other operations using beginCompositeOperation.

- robin

Adobe Employee
May 27, 2010

I'd call beginCompsiteOperation and then use operations to construct all of the paragraphs and their content.  To create the paragraphs use EditManager.splitParagraph.  Then call endCompositeOperation to bundle all the operations since beginCompositeOperation into a single undoable operation.

FWIW we're making lots of progress on lists here for 2.0.

Hope that helps,

Richard

pollymathAuthor
Participant
May 28, 2010

Richard

Thanks for that I will experiment with splitParagraph I saw that and thought it looked promissing yesterday but I ran out of time - I will do more this morning. I am intregued to know how lists will work in version 2.0 and when 2.0 might be coming. This is definatley a major functional requirement. Whilst I think my solution will work well and give me lots of control it is always nicer to have a solution that mirrors more convetional structures such as HTML. Are you going to implement new tags ie <ul> <ol> and <li> ?

Can I also respectfully make a plea from those of us who are working on the bleeding edge to improve your documentation. We are all developers here so we know that we would much prefer to work on code and develop new functionality but without the docs and examples working with TLF is a bit of a struggle.

We are using OSMF and of course Spark - these frameworks are also in the early stages and we have lost many hours on projects trying to trackdown package / namepsace changes. Please try to keep disruption to a minimum.

Cheers Richard