section.addAttribute("class", "invisible");
return section.html();
}
public static String generateHtml(String state, String titleText, String bodyText) {
HtmlTag outerBlock = new HtmlTag("div");
outerBlock.addAttribute("class", "collapsible" + state);
outerBlock.add(new RawHtml("<ul>" +
"<li><a href='#' class='expandall'>Expand</a></li>" +
"<li><a href='#' class='collapseall'>Collapse</a></li>" +
"</ul>"));
HtmlTag title = new HtmlTag("p", titleText);
title.addAttribute("class", "title");
outerBlock.add(title);
HtmlTag body = new HtmlTag("div", bodyText);
outerBlock.add(body);
return outerBlock.html();
}