// Generate the paragraph box ..
if (reactivateSuspendedInlines(fc) == false)
{
// todo: check for possibly suspended inlines and reactivate them
final StyleResolver styleResolver = layoutProcess.getStyleResolver();
final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);
final LayoutContext paragraphContext =
styleResolver.createAnonymousContext(id, context);
fc.addElement(MODEL_INLINE_INSIDE, FLAG_AUTOGENERATED | TYPE_PARAGRAPH, paragraphContext);
contentGenerator.startedRootInline(paragraphContext);
}
// now add the element ..
final CSSValue displayModel = context.getValue(BoxStyleKeys.DISPLAY_MODEL);
if (DisplayModel.TABLE.equals(displayModel))
{
fc.addElement(MODEL_TABLE, TYPE_INLINE, context);
contentGenerator.startedTable(context);
}
else if (DisplayModel.INLINE_INSIDE.equals(displayModel))
{
fc.addElement(MODEL_INLINE_INSIDE, TYPE_INLINE, context);
contentGenerator.startedInline(context);
}
else
{
fc.addElement(MODEL_BLOCK_INSIDE, TYPE_BLOCK, context);
contentGenerator.startedBlock(context);
}
return;
}
// Todo: need to check for run-in and compact as well..
// Everything else is considered a block-level element and treated as such..
final CSSValue displayModel = context.getValue(BoxStyleKeys.DISPLAY_MODEL);
if (DisplayModel.TABLE.equals(displayModel))
{
fc.addElement(MODEL_TABLE, TYPE_TABLE, context);
contentGenerator.startedTable(context);
}
else if (DisplayModel.INLINE_INSIDE.equals(displayModel))
{
// A block level element that declares that all its direct childs should
// be treated as inline-level elements. We create a paragraph box for that
// one.
fc.addElement(MODEL_INLINE_INSIDE, TYPE_BLOCK, context);
contentGenerator.startedBlock(context);
final StyleResolver styleResolver = layoutProcess.getStyleResolver();
final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);
final LayoutContext paragraphContext =
styleResolver.createAnonymousContext(id, context);
fc.addElement(MODEL_INLINE_INSIDE,
FLAG_AUTOGENERATED | TYPE_PARAGRAPH, paragraphContext);
contentGenerator.startedRootInline(paragraphContext);
}
else