public class WOConditionalTagDelegate extends TagDelegate {
private boolean _cssAdded;
@Override
public void renderNode(IWodElement wodElement, FuzzyXMLElement xmlElement, RenderContext renderContext, StringBuffer htmlBuffer, StringBuffer cssBuffer, Stack<WodParserCache> caches, Stack<FuzzyXMLNode> nodes) {
IWodBinding conditionBinding = wodElement.getBindingNamed("condition");
String conditionName;
if (conditionBinding != null) {
conditionName = conditionBinding.getValue();
} else {
conditionName = "WOConditional";
}
IWodBinding negateBinding = wodElement.getBindingNamed("negate");
if (negateBinding != null && ("true".equalsIgnoreCase(negateBinding.getValue()) || "yes".equalsIgnoreCase(negateBinding.getValue()))) {
conditionName = "!" + conditionName;
}
htmlBuffer.append("<span class = \"wodclipse_block wodclipse_WOConditional\"><span class = \"wodclipse_tag wodclipse_open_tag\">[if " + conditionName + "]</span>");
xmlElement.toXMLString(renderContext, htmlBuffer);
htmlBuffer.append("<span class = \"wodclipse_tag wodclipse_close_tag\">[/if " + conditionName + "]</span></span>");