summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/gitblit/wicket/panels/CheckboxOption.java5
-rw-r--r--src/main/java/com/gitblit/wicket/panels/ChoiceOption.java5
-rw-r--r--src/main/java/com/gitblit/wicket/panels/TextOption.java2
3 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/com/gitblit/wicket/panels/CheckboxOption.java b/src/main/java/com/gitblit/wicket/panels/CheckboxOption.java
index 086d8ef2..08eeaa24 100644
--- a/src/main/java/com/gitblit/wicket/panels/CheckboxOption.java
+++ b/src/main/java/com/gitblit/wicket/panels/CheckboxOption.java
@@ -18,6 +18,7 @@ package com.gitblit.wicket.panels;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.CheckBox;
import org.apache.wicket.model.IModel;
+import org.parboiled.common.StringUtils;
/**
* A re-usable checkbox option panel.
@@ -35,14 +36,14 @@ public class CheckboxOption extends BasePanel {
public CheckboxOption(String wicketId, String title, String description, IModel<Boolean> model) {
super(wicketId);
add(new Label("name", title));
- add(new Label("description", description));
+ add(new Label("description", description).setVisible(!StringUtils.isEmpty(description)));
add(new CheckBox("checkbox", model));
}
public CheckboxOption(String wicketId, String title, String description, CheckBox checkbox) {
super(wicketId);
add(new Label("name", title));
- add(new Label("description", description));
+ add(new Label("description", description).setVisible(!StringUtils.isEmpty(description)));
add(checkbox.setMarkupId("checkbox"));
}
diff --git a/src/main/java/com/gitblit/wicket/panels/ChoiceOption.java b/src/main/java/com/gitblit/wicket/panels/ChoiceOption.java
index cc084a7b..9c25b70a 100644
--- a/src/main/java/com/gitblit/wicket/panels/ChoiceOption.java
+++ b/src/main/java/com/gitblit/wicket/panels/ChoiceOption.java
@@ -20,6 +20,7 @@ import java.util.List;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.model.IModel;
+import org.parboiled.common.StringUtils;
/**
* A re-usable choice option panel.
@@ -38,14 +39,14 @@ public class ChoiceOption<T> extends BasePanel {
public ChoiceOption(String wicketId, String title, String description, IModel<T> model, List<T> choices) {
super(wicketId);
add(new Label("name", title));
- add(new Label("description", description));
+ add(new Label("description", description).setVisible(!StringUtils.isEmpty(description)));
add(new DropDownChoice<>("choice", model, choices).setEnabled(choices.size() > 0));
}
public ChoiceOption(String wicketId, String title, String description, DropDownChoice<?> choice) {
super(wicketId);
add(new Label("name", title));
- add(new Label("description", description));
+ add(new Label("description", description).setVisible(!StringUtils.isEmpty(description)));
add(choice.setMarkupId("choice").setEnabled(choice.getChoices().size() > 0));
}
}
diff --git a/src/main/java/com/gitblit/wicket/panels/TextOption.java b/src/main/java/com/gitblit/wicket/panels/TextOption.java
index dcd465fb..22370f3c 100644
--- a/src/main/java/com/gitblit/wicket/panels/TextOption.java
+++ b/src/main/java/com/gitblit/wicket/panels/TextOption.java
@@ -43,7 +43,7 @@ public class TextOption extends BasePanel {
public TextOption(String wicketId, String title, String description, String css, IModel<String> model) {
super(wicketId);
add(new Label("name", title));
- add(new Label("description", description));
+ add(new Label("description", description).setVisible(!StringUtils.isEmpty(description)));
TextField<String> tf = new TextField<String>("text", model);
if (!StringUtils.isEmpty(css)) {
WicketUtils.setCssClass(tf, css);