myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hno...@apache.org
Subject [myfaces-tobago] branch master updated: TOBAGO-1829 Put description for markups into the tag library documentation * add static strings to markups * add markup description to tag declarations * add markup annotation for tag declarations * TaglibGenerator can handle markup description
Date Fri, 24 Nov 2017 17:19:07 GMT
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 43a465c  TOBAGO-1829 Put description for markups into the tag library documentation
* add static strings to markups * add markup description to tag declarations * add markup
annotation for tag declarations * TaglibGenerator can handle markup description
43a465c is described below

commit 43a465c2d86f6c9192ef119b076c9760e27c80e0
Author: Henning Noeth <hnoeth@apache.org>
AuthorDate: Fri Nov 24 18:18:59 2017 +0100

    TOBAGO-1829 Put description for markups into the tag library documentation
    * add static strings to markups
    * add markup description to tag declarations
    * add markup annotation for tag declarations
    * TaglibGenerator can handle markup description
---
 .../org/apache/myfaces/tobago/context/Markup.java  | 83 ++++++++++++++++++++++
 .../taglib/component/BarTagDeclaration.java        | 41 +++++++++--
 .../taglib/component/ButtonTagDeclaration.java     | 39 ++++++++++
 .../taglib/component/InTagDeclaration.java         | 21 ++++--
 .../taglib/component/PopupTagDeclaration.java      | 14 +++-
 .../taglib/component/SheetTagDeclaration.java      | 25 ++++++-
 .../myfaces/tobago/context/MarkupUnitTest.java     | 78 ++++++++++++++------
 .../myfaces/tobago/apt/annotation/Markup.java      | 33 +++++++++
 .../tobago/apt/annotation/UIComponentTag.java      |  4 +-
 .../tobago/apt/processor/TaglibGenerator.java      | 15 ++++
 10 files changed, 311 insertions(+), 42 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
index 946a259..fe48993 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
@@ -83,10 +83,15 @@ public final class Markup implements Serializable, Iterable<String>
{
   public static final Markup INFO = valueOf("info");
   public static final Markup INLINE = valueOf("inline");
   public static final Markup JUSTIFY = valueOf("justify");
+  /**
+   * @deprecated since 4.0.0, please use {@link #DARK}
+   */
+  @Deprecated
   public static final Markup INVERSE = valueOf("inverse");
   public static final Markup LARGE = valueOf("large");
   public static final Markup LEFT = valueOf("left");
   public static final Markup LIGHT = valueOf("light");
+  public static final Markup LOCAL_MENU = valueOf("localMenu");
   public static final Markup MARKED = valueOf("marked");
   public static final Markup MEDIUM = valueOf("medium");
   public static final Markup MODAL = valueOf("modal");
@@ -129,6 +134,84 @@ public final class Markup implements Serializable, Iterable<String>
{
   public static final Markup WARN = valueOf("warn");
   public static final Markup WARNING = valueOf("warning");
 
+  public static final String STRING_ASCENDING = "ascending";
+  public static final String STRING_BIG = "big";
+  public static final String STRING_BORDERED = "bordered";
+  public static final String STRING_CENTER = "center";
+  public static final String STRING_CLICKABLE = "clickable";
+  public static final String STRING_DANGER = "danger";
+  public static final String STRING_DARK = "dark";
+  public static final String STRING_DEFAULT = "default";
+  public static final String STRING_DELETED = "deleted";
+  public static final String STRING_DESCENDING = "descending";
+  public static final String STRING_DISABLED = "disabled";
+  public static final String STRING_ERROR = "error";
+  public static final String STRING_EVEN = "even";
+  public static final String STRING_EXPANDED = "expanded";
+  public static final String STRING_EXTRA_LARGE = "extraLarge";
+  public static final String STRING_FILLER = "filler";
+  public static final String STRING_FATAL = "fatal";
+  /**
+   * @deprecated Can be selected via CSS3.
+   */
+  @Deprecated
+  public static final String STRING_FIRST = "first";
+  public static final String STRING_FOLDER = "folder";
+  public static final String STRING_HOVER = "hover";
+  public static final String STRING_INFO = "info";
+  public static final String STRING_INLINE = "inline";
+  public static final String STRING_JUSTIFY = "justify";
+  /**
+   * @deprecated since 4.0.0, please use {@link #DARK}
+   */
+  @Deprecated
+  public static final String STRING_INVERSE = "inverse";
+  public static final String STRING_LARGE = "large";
+  public static final String STRING_LEFT = "left";
+  public static final String STRING_LIGHT = "light";
+  public static final String STRING_LOCAL_MENU = "localMenu";
+  public static final String STRING_MARKED = "marked";
+  public static final String STRING_MEDIUM = "medium";
+  public static final String STRING_MODAL = "modal";
+  public static final String STRING_NONE = "none";
+  public static final String STRING_NUMBER = "number";
+  public static final String STRING_ODD = "odd";
+  public static final String STRING_PORTLET = "portlet";
+  public static final String STRING_PRIMARY = "primary";
+  public static final String STRING_READONLY = "readonly";
+  public static final String STRING_REQUIRED = "required";
+  public static final String STRING_RESIZABLE = "resizable";
+  public static final String STRING_RIGHT = "right";
+  public static final String STRING_SECONDARY = "secondary";
+  public static final String STRING_SECONDS = "seconds";
+  public static final String STRING_SELECTED = "selected";
+  /**
+   * @deprecated since 3.0.4
+   */
+  @Deprecated
+  public static final String STRING_SHEET_SELECT_ALL = "sheetSelectAll";
+  /**
+   * @deprecated since 3.0.4
+   */
+  @Deprecated
+  public static final String STRING_SHEET_DESELECT_ALL = "sheetDeselectAll";
+  /**
+   * @deprecated since 3.0.4
+   */
+  @Deprecated
+  public static final String STRING_SHEET_TOGGLE_ALL = "sheetToggleAll";
+  public static final String STRING_SMALL = "small";
+  public static final String STRING_SORTABLE = "sortable";
+  public static final String STRING_SPREAD = "spread";
+  public static final String STRING_STRIPED = "striped";
+  public static final String STRING_STRONG = "strong";
+  public static final String STRING_SUCCESS = "success";
+  public static final String STRING_TOGGLER_LEFT = "togglerLeft";
+  public static final String STRING_TOP = "top";
+  public static final String STRING_VERTICALLY = "vertically";
+  public static final String STRING_WARN = "warn";
+  public static final String STRING_WARNING = "warning";
+
   /* Just one of "values" and "value" must be null */
 
   private final String[] values;
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BarTagDeclaration.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BarTagDeclaration.java
index b59c209..baadac7 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BarTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/BarTagDeclaration.java
@@ -20,6 +20,7 @@
 package org.apache.myfaces.tobago.internal.taglib.component;
 
 import org.apache.myfaces.tobago.apt.annotation.Facet;
+import org.apache.myfaces.tobago.apt.annotation.Markup;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
 import org.apache.myfaces.tobago.component.Facets;
@@ -43,13 +44,39 @@ import javax.faces.component.UIPanel;
         // As long as no behavior event names are defined, ClientBehaviorHolder must be implemented
for Majorra.
         "javax.faces.component.behavior.ClientBehaviorHolder"
     },
-facets = {
-    @Facet(
-        name = Facets.BRAND,
-        description = "Contains an element which will get a 'navbar-brand' style, e.g. use
<tc:link> "),
-    @Facet(
-        name = Facets.AFTER,
-        description = "Content will be rendered usually at the right end of the bar.")})
+    facets = {
+        @Facet(
+            name = Facets.BRAND,
+            description = "Contains an element which will get a 'navbar-brand' style, e.g.
use <tc:link> "),
+        @Facet(
+            name = Facets.AFTER,
+            description = "Content will be rendered usually at the right end of the bar.")},
+    markups = {
+        @Markup(
+            name = "dark",
+            description = "Theming for dark backgrounds"
+        ),
+        @Markup(
+            name = "light",
+            description = "Theming for light backgrounds"
+        ),
+        @Markup(
+            name = "small",
+            description = "Bar collapse at a small size."
+        ),
+        @Markup(
+            name = "medium",
+            description = "Bar collapse at a medium size."
+        ),
+        @Markup(
+            name = "large",
+            description = "Bar collapse at a large size."
+        ),
+        @Markup(
+            name = "extraLarge",
+            description = "Bar collapse at a extra large size."
+        )
+    })
 public interface BarTagDeclaration
     extends HasIdBindingAndRendered, HasTip, IsVisual {
 }
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.java
index bbc2d7c..8d63726 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ButtonTagDeclaration.java
@@ -22,6 +22,7 @@ package org.apache.myfaces.tobago.internal.taglib.component;
 import org.apache.myfaces.tobago.apt.annotation.Behavior;
 import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription;
 import org.apache.myfaces.tobago.apt.annotation.Facet;
+import org.apache.myfaces.tobago.apt.annotation.Markup;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
 import org.apache.myfaces.tobago.component.ClientBehaviors;
@@ -82,6 +83,44 @@ import javax.faces.component.UICommand;
             name = ClientBehaviors.FOCUS),
         @Behavior(
             name = ClientBehaviors.BLUR)
+    },
+    markups = {
+        @Markup(
+            name = "primary",
+            description = "Set button color to primary color of the theme."
+        ),
+        @Markup(
+            name = "secondary",
+            description = "Set button color to secondary color of the theme."
+        ),
+        @Markup(
+            name = "success",
+            description = "Set button color to success color of the theme."
+        ),
+        @Markup(
+            name = "danger",
+            description = "Set button color to danger color of the theme."
+        ),
+        @Markup(
+            name = "warning",
+            description = "Set button color to warning color of the theme."
+        ),
+        @Markup(
+            name = "info",
+            description = "Set button color to info color of the theme."
+        ),
+        @Markup(
+            name = "light",
+            description = "Set button color to light color of the theme."
+        ),
+        @Markup(
+            name = "dark",
+            description = "Set button color to dark color of the theme."
+        ),
+        @Markup(
+            name = "none",
+            description = "Colorless button."
+        )
     })
 public interface ButtonTagDeclaration
     extends HasIdBindingAndRendered, HasAction, HasActionListener, IsImmediateCommand, HasConfirmation,
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/InTagDeclaration.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/InTagDeclaration.java
index 782d4ba..d53c522 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/InTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/InTagDeclaration.java
@@ -22,6 +22,7 @@ package org.apache.myfaces.tobago.internal.taglib.component;
 import org.apache.myfaces.tobago.apt.annotation.Behavior;
 import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription;
 import org.apache.myfaces.tobago.apt.annotation.Facet;
+import org.apache.myfaces.tobago.apt.annotation.Markup;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
 import org.apache.myfaces.tobago.component.ClientBehaviors;
@@ -66,13 +67,13 @@ import javax.faces.component.UIInput;
         "org.apache.myfaces.tobago.Suggest"
     },
     facets = {
-    @Facet(name = Facets.BEFORE,
-        description =
-            "This facet can contain a part for input groups."),
-    @Facet(name = Facets.AFTER,
-        description =
-            "This facet can contain a part for input groups.")
-        },
+        @Facet(name = Facets.BEFORE,
+            description =
+                "This facet can contain a part for input groups."),
+        @Facet(name = Facets.AFTER,
+            description =
+                "This facet can contain a part for input groups.")
+    },
     behaviors = {
         @Behavior(
             name = ClientBehaviors.CHANGE,
@@ -85,6 +86,12 @@ import javax.faces.component.UIInput;
             name = ClientBehaviors.FOCUS),
         @Behavior(
             name = ClientBehaviors.BLUR)
+    },
+    markups = {
+        @Markup(name = "localMenu",
+            description = "If a suggest menu is available, it will be rendered on the component,
" +
+                "not in the '.tobago-page-menuStore'."
+        )
     })
 public interface InTagDeclaration
     extends HasIdBindingAndRendered, HasConverter, IsReadonly, IsDisabled, IsRequired, HasTip,
IsPassword,
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PopupTagDeclaration.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PopupTagDeclaration.java
index f501cbc..35fd1ad 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PopupTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/PopupTagDeclaration.java
@@ -19,6 +19,7 @@
 
 package org.apache.myfaces.tobago.internal.taglib.component;
 
+import org.apache.myfaces.tobago.apt.annotation.Markup;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
@@ -43,8 +44,17 @@ import org.apache.myfaces.tobago.model.CollapseMode;
         // As long as no behavior event names are defined, ClientBehaviorHolder must be implemented
for Majorra.
         "javax.faces.component.behavior.ClientBehaviorHolder"
     },
-    rendererType = RendererTypes.POPUP
-)
+    rendererType = RendererTypes.POPUP,
+    markups = {
+        @Markup(
+            name = "large",
+            description = "Large popup"
+        ),
+        @Markup(
+            name = "small",
+            description = "Small popup"
+        )
+    })
 public interface PopupTagDeclaration
     extends HasIdBindingAndRendered, IsVisual, HasTip {
 
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SheetTagDeclaration.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SheetTagDeclaration.java
index da396e6..9a15470 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SheetTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SheetTagDeclaration.java
@@ -23,6 +23,7 @@ import org.apache.myfaces.tobago.apt.annotation.Behavior;
 import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription;
 import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
 import org.apache.myfaces.tobago.apt.annotation.Facet;
+import org.apache.myfaces.tobago.apt.annotation.Markup;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
@@ -64,6 +65,28 @@ import javax.faces.component.UIData;
         @Behavior(
             name = ClientBehaviors.RELOAD, // XXX replace by click
             isDefault = true)
+    },
+    markups = {
+        @Markup(
+            name = "bordered",
+            description = "Add borders to the table cells."
+        ),
+        @Markup(
+            name = "dark",
+            description = "Set dark background."
+        ),
+        @Markup(
+            name = "hover",
+            description = "Background of row changed on hovering."
+        ),
+        @Markup(
+            name = "small",
+            description = "Small margins for table cells."
+        ),
+        @Markup(
+            name = "striped",
+            description = "Zebra-striping for table rows."
+        ),
     })
 public interface SheetTagDeclaration
     extends HasIdBindingAndRendered, IsVisual, IsShowRoot, IsShowRootJunction, HasVar {
@@ -238,7 +261,6 @@ public interface SheetTagDeclaration
 
   /**
    * Flag indicating if paging arrows are shown near direct links
-   *
    * @since 2.0.0
    */
   @TagAttribute
@@ -247,7 +269,6 @@ public interface SheetTagDeclaration
 
   /**
    * Flag indicating if paging arrows are shown near page range
-   *
    * @since 2.0.0
    */
   @TagAttribute
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java
b/tobago-core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java
index 38eb42c..1fbc819 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/context/MarkupUnitTest.java
@@ -22,61 +22,62 @@ package org.apache.myfaces.tobago.context;
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 
 public class MarkupUnitTest {
-  
-  private static final String[] AB = new String[] {"a", "b"};
+
+  private static final String[] AB = new String[]{"a", "b"};
 
   @Test
   public void testString() {
     Assert.assertNull(Markup.valueOf((String) null));
-    
-    Assert.assertArrayEquals(new String[] {"accent"}, toArray(Markup.valueOf("accent").iterator()));
-    
+
+    Assert.assertArrayEquals(new String[]{"accent"}, toArray(Markup.valueOf("accent").iterator()));
+
     Assert.assertArrayEquals(AB, toArray(Markup.valueOf("a,b").iterator()));
-    
+
     Assert.assertArrayEquals(AB, toArray(Markup.valueOf("a, b").iterator()));
 
     Assert.assertArrayEquals(AB, toArray(Markup.valueOf(", \ta , ,\n b ,").iterator()));
   }
-  
+
   @Test
   public void testStringArray() {
     Assert.assertNull(Markup.valueOf((String[]) null));
-    
-    Assert.assertNull(Markup.valueOf(new String[] {}));
-    
-    Assert.assertArrayEquals(AB, toArray(Markup.valueOf(new String[] {"a", "b"}).iterator()));
-    
-    Assert.assertArrayEquals(AB, toArray(Markup.valueOf(new String[] {" a ", " b "}).iterator()));
+
+    Assert.assertNull(Markup.valueOf(new String[]{}));
+
+    Assert.assertArrayEquals(AB, toArray(Markup.valueOf(new String[]{"a", "b"}).iterator()));
+
+    Assert.assertArrayEquals(AB, toArray(Markup.valueOf(new String[]{" a ", " b "}).iterator()));
   }
-  
+
   @Test
   public void testObject() {
     Assert.assertNull(Markup.valueOf((Object) null));
 
     Assert.assertArrayEquals(AB, toArray(Markup.valueOf((Object) ", \ta , ,\n b ,").iterator()));
 
-    Assert.assertArrayEquals(AB, toArray(Markup.valueOf((Object) new String[] {"a", "b"}).iterator()));
-    
+    Assert.assertArrayEquals(AB, toArray(Markup.valueOf((Object) new String[]{"a", "b"}).iterator()));
+
     Assert.assertArrayEquals(AB,
-        toArray(Markup.valueOf((Object) new String[] {" a ", " b "}).iterator()));
-    
+        toArray(Markup.valueOf((Object) new String[]{" a ", " b "}).iterator()));
+
     Assert.assertArrayEquals(AB, toArray(Markup.valueOf(new StringBuilder("a, b")).iterator()));
-    
+
     Assert.assertArrayEquals(AB, toArray(Markup.valueOf(AB).iterator()));
-    
+
     Assert.assertArrayEquals(AB, toArray(Markup.valueOf(Arrays.asList(AB)).iterator()));
   }
-  
+
   @Test
   public void testMarkup() {
     Assert.assertNull(Markup.valueOf((Markup) null));
-    
+
     final Markup accent = Markup.valueOf("accent");
     Assert.assertSame(accent, Markup.valueOf(accent));
   }
@@ -161,9 +162,40 @@ public class MarkupUnitTest {
   public static Object[] toArray(final Iterator<?> iterator) {
     final List<Object> list = new ArrayList<Object>(10);
     while (iterator.hasNext()) {
-        list.add(iterator.next());
+      list.add(iterator.next());
     }
     return list.toArray();
   }
 
+  @Test
+  public void testNames() throws IllegalAccessException {
+    List<Field> markups = new ArrayList<>();
+    List<Field> strings = new ArrayList<>();
+
+    for (Field field : Markup.class.getFields()) {
+      if (field.getName().startsWith("STRING")) {
+        strings.add(field);
+      } else if (!field.getName().equals("NULL")) {
+        markups.add(field);
+      }
+    }
+
+    Assert.assertEquals("Is for every markup a string constant defined?", markups.size(),
strings.size());
+
+    for (Field markupField : markups) {
+      Markup markup = (Markup) markupField.get(null);
+
+      boolean pendantFound = false;
+      for (Field stringField : strings) {
+        if (stringField.getName().equals("STRING_" + markupField.getName())) {
+          String string = (String) stringField.get(null);
+
+          Assert.assertEquals(markup.toString(), string);
+          pendantFound = true;
+        }
+      }
+
+      Assert.assertTrue("Could be a string pendant found for " + markup + "?", pendantFound);
+    }
+  }
 }
diff --git a/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Markup.java
b/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Markup.java
new file mode 100644
index 0000000..e150a2f
--- /dev/null
+++ b/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/Markup.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.apt.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(value = RetentionPolicy.SOURCE)
+@Target(value = ElementType.TYPE)
+public @interface Markup {
+  String name();
+
+  String description() default "";
+}
diff --git a/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/UIComponentTag.java
b/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/UIComponentTag.java
index d7a0aa0..310bb6c 100644
--- a/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/UIComponentTag.java
+++ b/tobago-tool/tobago-tool-annotation/src/main/java/org/apache/myfaces/tobago/apt/annotation/UIComponentTag.java
@@ -51,6 +51,8 @@ public @interface UIComponentTag {
 
   Behavior[] behaviors() default {};
 
+  Markup[] markups() default {};
+
   boolean generate() default true;
 
   boolean isComponentAlreadyDefined() default false;
@@ -59,7 +61,7 @@ public @interface UIComponentTag {
    * Array of supported component-types that explicitly enumerates the
    * set of allowed component children for this component. Other possible values are: ALL...
    */
-  String[] allowedChildComponenents() default { "ALL" };
+  String[] allowedChildComponenents() default {"ALL"};
 
   /**
    * Specifies the category of a component palette.
diff --git a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java
b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java
index 4dd8ff4..b9de598 100644
--- a/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java
+++ b/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java
@@ -23,6 +23,7 @@ import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.myfaces.tobago.apt.AnnotationUtils;
 import org.apache.myfaces.tobago.apt.annotation.Facet;
+import org.apache.myfaces.tobago.apt.annotation.Markup;
 import org.apache.myfaces.tobago.apt.annotation.Preliminary;
 import org.apache.myfaces.tobago.apt.annotation.SimpleTag;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
@@ -365,6 +366,20 @@ public class TaglibGenerator extends AbstractGenerator {
       }
       description.append("</dl>");
     }
+    final Markup[] markups = componentTag.markups();
+    if (markups.length > 0) {
+      description.append("<p><b>Supported markups:</b></p>");
+      description.append("<dl>");
+      for (final Markup markup : markups) {
+        description.append("<dt><b>");
+        description.append(markup.name());
+        description.append("</b></dt>");
+        description.append("<dd>");
+        description.append(markup.description());
+        description.append("</dd>");
+      }
+      description.append("</dl>");
+    }
     return description.toString();
   }
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@myfaces.apache.org" <commits@myfaces.apache.org>'].

Mime
View raw message