Skip to main content
Known Participant
March 3, 2009
Question

Empty Paragraph

  • March 3, 2009
  • 5 replies
  • 825 views
I'm creating a new TextFlow, calling textFlow.flowComposer.updateAllContainers(), and it creates an empty paragraph and span. That means when I start adding ParagraphElements to the flow, there is an empty line at the top. After creating a textFlow and adding a paragraph, I expected the paragraph to be first. Is there a better way around this than setting a flag?
This topic has been closed for replies.

5 replies

Adobe Employee
March 5, 2009
For consistency we've defined a "normalized" TextFlow. A composed TextFlow is normalized. A normalized TextFlow has at least one ParagraphElement with at least one SpanElement.
Known Participant
March 5, 2009
I don't get why the TextFlow has to guarantee at least one paragraph. That seems specific to the EditManager. I think what I'm trying is a pretty basic use of the framework, and what happens does not make sense.

I think the whole framework is confused as to what class should do what. For example, when I was trying to create my own export filter, I was sure every package except 'events' was the one I was looking for. Sorry... maybe it will make more sense when it's out of labs and there are some examples.
Adobe Employee
March 4, 2009
Nevertheless its going to make an empty paragraph. The flow doesn't know what type of interactionManager is or will be attached - at each compose a normalize process happens that guarantees at least one paragraph.
Known Participant
March 4, 2009
I'm using SelectionManager, so the user won't be typing. I'm calling updateAllContainers because I'm using Flex, and I have a small component that resizes the TextFlow to fit it's container.
Adobe Employee
March 4, 2009
It creates the empty paragraph so the user has a place to type.

If after creating the TextFlow you are immediately adding your own paragraphs there is no need to call updateAllContainers.