| | |
| | |
|
| | | public class WicketUtils {
|
| | |
|
| | | public static Component setCssClass(Component container, String value) {
|
| | | public static void setCssClass(Component container, String value) {
|
| | | container.add(new SimpleAttributeModifier("class", value));
|
| | | return container;
|
| | | }
|
| | |
|
| | | public static Component setCssStyle(Component container, String value) {
|
| | | public static void setCssStyle(Component container, String value) {
|
| | | container.add(new SimpleAttributeModifier("style", value));
|
| | | return container;
|
| | | }
|
| | |
|
| | | public static Component setCssBackground(Component container, String value) {
|
| | | public static void setCssBackground(Component container, String value) {
|
| | | String background = MessageFormat.format("background-color:{0};",
|
| | | StringUtils.getColor(value));
|
| | | container.add(new SimpleAttributeModifier("style", background));
|
| | | return container;
|
| | | }
|
| | |
|
| | | public static Component setHtmlTooltip(Component container, String value) {
|
| | | public static void setHtmlTooltip(Component container, String value) {
|
| | | container.add(new SimpleAttributeModifier("title", value));
|
| | | return container;
|
| | | }
|
| | |
|
| | | public static Component setInputPlaceholder(Component container, String value) {
|
| | | public static void setInputPlaceholder(Component container, String value) {
|
| | | container.add(new SimpleAttributeModifier("placeholder", value));
|
| | | return container;
|
| | | }
|
| | |
|
| | | public static Component setChangeTypeCssClass(Component container, ChangeType type) {
|
| | | public static void setChangeTypeCssClass(Component container, ChangeType type) {
|
| | | switch (type) {
|
| | | case ADD:
|
| | | setCssClass(container, "addition");
|
| | |
| | | setCssClass(container, "modification");
|
| | | break;
|
| | | }
|
| | | return container;
|
| | | }
|
| | |
|
| | | public static Component setTicketCssClass(Component container, String state) {
|
| | | public static void setTicketCssClass(Component container, String state) {
|
| | | String css = null;
|
| | | if (state.equals("open")) {
|
| | | css = "label label-important";
|
| | |
| | | if (css != null) {
|
| | | setCssClass(container, css);
|
| | | }
|
| | | return container;
|
| | | }
|
| | |
|
| | | public static Component setAlternatingBackground(Component c, int i) {
|
| | | public static void setAlternatingBackground(Component c, int i) {
|
| | | String clazz = i % 2 == 0 ? "light" : "dark";
|
| | | setCssClass(c, clazz);
|
| | | return c;
|
| | | }
|
| | |
|
| | | public static Label createAuthorLabel(String wicketId, String author) {
|