Skip to main content
Known Participant
Mar 3, 2009 7:41 PM UTC
Question

Empty Paragraph

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 is closed to new replies. Start a new post to keep the conversation going.

5 replies

Inspiring
Mar 5, 2009 5:19 PM UTC
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.
Translate
Known Participant
Mar 5, 2009 7:49 AM UTC
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.
Translate
Inspiring
Mar 4, 2009 5:27 PM UTC
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.
Translate
Known Participant
Mar 4, 2009 7:15 AM UTC
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.
Translate
Inspiring
Mar 4, 2009 6:24 AM UTC
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.
Translate