You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2011/09/12 18:10:11 UTC

svn commit: r1169811 - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/context/ tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ tobago-theme/tobago-the...

Author: lofwyr
Date: Mon Sep 12 16:10:11 2011
New Revision: 1169811

URL: http://svn.apache.org/viewvc?rev=1169811&view=rev
Log:
TOBAGO-955: Attribute inline="true" doesn't work anymore in <tc:selectOneRadio>

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java?rev=1169811&r1=1169810&r2=1169811&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/Markup.java Mon Sep 12 16:10:11 2011
@@ -60,6 +60,7 @@ public final class Markup implements Ser
   public static final Markup FIRST = valueOf("first");
   public static final Markup FOLDER = valueOf("folder");
   public static final Markup INFO = valueOf("info");
+  public static final Markup INLINE = valueOf("inline");
   public static final Markup LEFT = valueOf("left");
   public static final Markup MARKED = valueOf("marked");
   public static final Markup MODAL = valueOf("modal");

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java?rev=1169811&r1=1169810&r2=1169811&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java Mon Sep 12 16:10:11 2011
@@ -19,6 +19,7 @@ package org.apache.myfaces.tobago.render
 
 import org.apache.myfaces.tobago.component.UISelectOneRadio;
 import org.apache.myfaces.tobago.config.Configurable;
+import org.apache.myfaces.tobago.context.Markup;
 import org.apache.myfaces.tobago.context.TobagoFacesContext;
 import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.renderkit.SelectOneRendererBase;
@@ -30,8 +31,6 @@ import org.apache.myfaces.tobago.renderk
 import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import javax.faces.component.NamingContainer;
 import javax.faces.component.UIComponent;
@@ -44,29 +43,24 @@ import java.util.List;
 
 public class SelectOneRadioRenderer extends SelectOneRendererBase {
 
-  private static final Logger LOG = LoggerFactory.getLogger(SelectOneRadioRenderer.class);
-
   public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
-    super.prepareRender(facesContext, component);
+    UISelectOneRadio select = (UISelectOneRadio) component;
+    super.prepareRender(facesContext, select);
     if (facesContext instanceof TobagoFacesContext) {
       ((TobagoFacesContext) facesContext).getOnloadScripts().add("Tobago.selectOneRadioInit('"
-          + component.getClientId(facesContext) + "')");
+          + select.getClientId(facesContext) + "')");
+    }
+    if (select.isInline()) {
+      select.setCurrentMarkup(Markup.INLINE.add(select.getCurrentMarkup()));
     }
   }
 
   public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
-    if (!(component instanceof UISelectOneRadio)) {
-      LOG.error("Wrong type: Need " + UISelectOneRadio.class.getName()
-          + ", but was " + component.getClass().getName());
-      return;
-    }
-
     UISelectOneRadio select = (UISelectOneRadio) component;
     TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
 
     String id = select.getClientId(facesContext);
     List<SelectItem> items = RenderUtils.getItemsToRender(select);
-    boolean inline = select.isInline();
     String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, select);
     boolean disabled = select.isDisabled();
     boolean readonly = select.isReadonly();

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css?rev=1169811&r1=1169810&r2=1169811&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css Mon Sep 12 16:10:11 2011
@@ -726,7 +726,8 @@ li.tobago-menu-markup-selected {
   color: #778899;
 }
 
-.tobago-selectOneRadio-inline, .tobago-selectOneRadio-inline li  {
+/* todo after removing IE6 support please use ">" */
+.tobago-selectOneRadio-markup-inline li  {
   display: inline;
 }
 

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml?rev=1169811&r1=1169810&r2=1169811&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/tobago-config.xml Mon Sep 12 16:10:11 2011
@@ -215,6 +215,7 @@
             <markup>warn</markup>
             <markup>info</markup>
             <markup>selected</markup>
+            <markup>inline</markup>
           </supported-markup>
         </renderer>
         <renderer>