import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.form.CheckBox;\r
import org.apache.wicket.model.IModel;\r
+import org.parboiled.common.StringUtils;\r
\r
/**\r
* A re-usable checkbox option panel.\r
public CheckboxOption(String wicketId, String title, String description, IModel<Boolean> model) {\r
super(wicketId);\r
add(new Label("name", title));\r
- add(new Label("description", description));\r
+ add(new Label("description", description).setVisible(!StringUtils.isEmpty(description)));\r
add(new CheckBox("checkbox", model));\r
}\r
\r
public CheckboxOption(String wicketId, String title, String description, CheckBox checkbox) {\r
super(wicketId);\r
add(new Label("name", title));\r
- add(new Label("description", description));\r
+ add(new Label("description", description).setVisible(!StringUtils.isEmpty(description)));\r
add(checkbox.setMarkupId("checkbox"));\r
}\r
\r
import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.form.DropDownChoice;\r
import org.apache.wicket.model.IModel;\r
+import org.parboiled.common.StringUtils;\r
\r
/**\r
* A re-usable choice option panel.\r
public ChoiceOption(String wicketId, String title, String description, IModel<T> model, List<T> choices) {\r
super(wicketId);\r
add(new Label("name", title));\r
- add(new Label("description", description));\r
+ add(new Label("description", description).setVisible(!StringUtils.isEmpty(description)));\r
add(new DropDownChoice<>("choice", model, choices).setEnabled(choices.size() > 0));\r
}\r
\r
public ChoiceOption(String wicketId, String title, String description, DropDownChoice<?> choice) {\r
super(wicketId);\r
add(new Label("name", title));\r
- add(new Label("description", description));\r
+ add(new Label("description", description).setVisible(!StringUtils.isEmpty(description)));\r
add(choice.setMarkupId("choice").setEnabled(choice.getChoices().size() > 0));\r
}\r
}\r
public TextOption(String wicketId, String title, String description, String css, IModel<String> model) {\r
super(wicketId);\r
add(new Label("name", title));\r
- add(new Label("description", description));\r
+ add(new Label("description", description).setVisible(!StringUtils.isEmpty(description)));\r
TextField<String> tf = new TextField<String>("text", model);\r
if (!StringUtils.isEmpty(css)) {\r
WicketUtils.setCssClass(tf, css);\r