@Test public void subsectionDisplayTitleOnly() { FormSubsection testSubsection = new FormSubsection(this.title); Assert.assertEquals("", testSubsection.display(DisplayMode.Edit, this.fieldnames)); testSubsection.addElement(this.testFormField); Assert.assertEquals("<label class='section'>" + this.title + "</label><div class='subsection '>null</div>", testSubsection.display(DisplayMode.Edit, this.fieldnames)); }
@Override public String display(DisplayMode mode, String[] fieldNames) { String displayedElements = super.display(mode, fieldNames); if (StringUtils.isBlank(displayedElements)) { return ""; } return "<label class='section'>" + XMLUtils.escapeElementContent(this.title) + "</label><div class='subsection " + this.type + "'>" + displayedElements + "</div>"; }
FormSubsection extends FormGroup { @Override public String display(DisplayMode mode, String[] fieldNames) { String displayedElements = super.display(mode, fieldNames); if (StringUtils.isBlank(displayedElements)) { return ""; } return "<label class='section'>" + XMLUtils.escapeElementContent(this.title) + "</label><div class='subsection " + this.type + "'>" + displayedElements + "</div>"; } }
FormSubsection extends FormGroup { @Override public String display(DisplayMode mode, String[] fieldNames) { String displayedElements = super.display(mode, fieldNames); if (StringUtils.isBlank(displayedElements)) { return ""; } return "<label class='section'>" + XMLUtils.escapeElementContent(this.title) + "</label><div class='subsection " + this.type + "'>" + displayedElements + "</div>"; } FormSubsection(String title);   FormSubsection(String title, String type); }
FormSubsection extends FormGroup { @Override public String display(DisplayMode mode, String[] fieldNames) { String displayedElements = super.display(mode, fieldNames); if (StringUtils.isBlank(displayedElements)) { return ""; } return "<label class='section'>" + XMLUtils.escapeElementContent(this.title) + "</label><div class='subsection " + this.type + "'>" + displayedElements + "</div>"; } FormSubsection(String title);   FormSubsection(String title, String type); @Override String getTitle(); @Override String display(DisplayMode mode, String[] fieldNames); }
FormSubsection extends FormGroup { @Override public String display(DisplayMode mode, String[] fieldNames) { String displayedElements = super.display(mode, fieldNames); if (StringUtils.isBlank(displayedElements)) { return ""; } return "<label class='section'>" + XMLUtils.escapeElementContent(this.title) + "</label><div class='subsection " + this.type + "'>" + displayedElements + "</div>"; } FormSubsection(String title);   FormSubsection(String title, String type); @Override String getTitle(); @Override String display(DisplayMode mode, String[] fieldNames);  }