* @throws AreaTreeException For errors during layout.
*/
protected int addNonTextItemToLine(final LineArea lineArea,
final FoLineNonText nonText, final FoContext foContext)
throws AreaTreeException {
EagerLineBreaker lb = this.layout.getLineBreaker();
if (lb == null) {
final AreaTree areaTree = lineArea.getAreaTree();
final TextServer textServer = areaTree.getTextServer();
final FontConsumer fontConsumer = areaTree.getFontConsumer();
lb = textServer.provideEagerLineBreaker(null,
this.layout, fontConsumer);
}
int status = 0;
final FoLineNonText contextAware = nonText.getContextWrapper(
foContext);
try {
status = lb.processLineContent(contextAware, -1, -1, lineArea);
} catch (final TextException e) {
final Fo generatedBy = lineArea.traitGeneratedBy();
throw new AreaTreeException("Error in non-text layout:\n"
+ generatedBy.getContextMessage());
}