public RnwWeave getActiveRnwWeave()
{
if (docDisplay_.getFileType().canKnitToHTML())
return rnwWeaveRegistry_.findTypeIgnoreCase("knitr");
RnwWeaveDirective rnwWeaveDirective = detectRnwWeaveDirective(
TexMagicComment.parseComments(docDisplay_.getCode()));
if (rnwWeaveDirective != null)
return rnwWeaveDirective.getRnwWeave();
else
return rnwWeaveRegistry_.findTypeIgnoreCase(
prefs_.defaultSweaveEngine().getValue());
}