@Override
public boolean doStartTag(FormEntrySession session, PrintWriter out, Node parent, Node node) {
String sectionTag = getAttribute(node, "sectionTag", "div");
String headerTag = getAttribute(node, "headerTag", "span");
String sectionStyleClass = getAttribute(node, "sectionStyle", "section");
String headerStyleClass = getAttribute(node, "headerStyle", "sectionHeader");
String sectionId = getAttribute(node, "id", null);
String headerLabel = getAttribute(node, "headerLabel", null);
if (headerLabel == null) {
String headerCode = getAttribute(node, "headerCode", null);
if (headerCode != null) {
Translator trans = session.getContext().getTranslator();
headerLabel = trans.translate(Context.getLocale().toString(), headerCode);
}
}
out.print("<" + sectionTag + " class=\""+sectionStyleClass + "\"");
if (sectionId != null) {
out.print(" id=\"" + sectionId + "\"");
}
out.print(">");
if (headerLabel != null) {
out.print("<" + headerTag + " class=\""+headerStyleClass+"\">"+headerLabel+"</" + headerTag + ">");
}
session.getContext().beginSection();
session.getContext().getActiveSection().setName(headerLabel);
return true;
}