myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject [myfaces-tobago] 01/02: tobago-in: custom elements
Date Fri, 23 Aug 2019 18:45:46 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit b7ef002d1fc533676a4187e14b905a5b55655b35
Author: Udo Schnurpfeil <lofwyr@apache.org>
AuthorDate: Fri Aug 23 15:18:31 2019 +0200

    tobago-in: custom elements
    
    issue: TOBAGO-1633: TS refactoring
---
 .../myfaces/tobago/internal/renderkit/renderer/InRenderer.java    | 4 ++++
 .../internal/renderkit/renderer/LabelLayoutRendererBase.java      | 8 ++++++--
 .../org/apache/myfaces/tobago/renderkit/html/HtmlElements.java    | 1 +
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/InRenderer.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/InRenderer.java
index f0653e7..58b9c53 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/InRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/InRenderer.java
@@ -55,6 +55,10 @@ public class InRenderer extends MessageLayoutRendererBase {
 
   private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
+  public HtmlElements getComponentTag() {
+    return HtmlElements.TOBAGO_IN;
+  }
+
   @Override
   protected void encodeBeginField(final FacesContext facesContext, final UIComponent component)
       throws IOException {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LabelLayoutRendererBase.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LabelLayoutRendererBase.java
index 15d9178..f570e83 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LabelLayoutRendererBase.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LabelLayoutRendererBase.java
@@ -48,6 +48,10 @@ import java.util.List;
  */
 public abstract class LabelLayoutRendererBase extends DecodingInputRendererBase {
 
+  public HtmlElements getComponentTag() {
+    return HtmlElements.DIV;
+  }
+
   @Override
   public void encodeBegin(final FacesContext facesContext, final UIComponent component) throws
IOException {
 
@@ -125,7 +129,7 @@ public abstract class LabelLayoutRendererBase extends DecodingInputRendererBase
         flex = false;
     }
 
-    writer.startElement(HtmlElements.DIV);
+    writer.startElement(getComponentTag());
     if (labelLayout == LabelLayout.gridLeft || labelLayout == LabelLayout.gridRight
         || labelLayout == LabelLayout.gridTop || labelLayout == LabelLayout.gridBottom) {
       writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "label");
@@ -196,7 +200,7 @@ public abstract class LabelLayoutRendererBase extends DecodingInputRendererBase
         // nothing to do
     }
 
-    writer.endElement(HtmlElements.DIV);
+    writer.endElement(getComponentTag());
   }
 
   protected void encodeLabel(final FacesContext facesContext, final UIComponent component,
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.java
index fae900c..3ec4203 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlElements.java
@@ -133,6 +133,7 @@ public enum HtmlElements {
   VIDEO("video"),
   WBR("wbr", Qualifier.VOID),
 
+  TOBAGO_IN("tobago-in"),
   TOBAGO_STARS("tobago-stars"),
   TOBAGO_SUGGEST("tobago-suggest");
 


Mime
View raw message