myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r891274 - in /myfaces/tobago/trunk: example/demo/src/main/webapp/ example/test/src/main/webapp/tc/separator/ theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/ theme/scarborough/src/...
Date Wed, 16 Dec 2009 15:22:38 GMT
Author: lofwyr
Date: Wed Dec 16 15:22:38 2009
New Revision: 891274

URL: http://svn.apache.org/viewvc?rev=891274&view=rev
Log:
TOBAGO-779: separator
- dynamic height dependent of if there is a label, or not.
- fix broken position in case of no label.

Modified:
    myfaces/tobago/trunk/example/demo/src/main/webapp/footer.xhtml
    myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-with-label-facet.xhtml
    myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-with-label.xhtml
    myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-without-label.xhtml
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
    myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
    myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java

Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/footer.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/webapp/footer.xhtml?rev=891274&r1=891273&r2=891274&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/footer.xhtml (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/footer.xhtml Wed Dec 16 15:22:38 2009
@@ -26,7 +26,7 @@
 
   <tc:panel>
     <f:facet name="layout">
-      <tc:gridLayout columns="fixed;fixed;fixed;fixed;fixed;*" rows="15px;fixed"/>
+      <tc:gridLayout columns="fixed;fixed;fixed;fixed;fixed;*" rows="fixed;fixed"/>
     </f:facet>
 
     <tc:cell spanX="6">

Modified: myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-with-label-facet.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-with-label-facet.xhtml?rev=891274&r1=891273&r2=891274&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-with-label-facet.xhtml
(original)
+++ myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-with-label-facet.xhtml
Wed Dec 16 15:22:38 2009
@@ -7,15 +7,15 @@
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:f="http://java.sun.com/jsf/core">
 
-  <tc:page>
+  <tc:page id="page">
     <tc:gridLayoutConstraint width="600px" height="300px"/>
     <f:facet name="layout">
       <tc:gridLayout rows="auto;*"/>
     </f:facet>
 
-    <tc:separator>
+    <tc:separator id="sep-0">
       <f:facet name="label">
-        <tc:label value="Label (Ög) is deprecated" id="sep-0"/>
+        <tc:label value="Label (Ög) is deprecated"/>
       </f:facet>
     </tc:separator>
     <tc:panel/>

Modified: myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-with-label.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-with-label.xhtml?rev=891274&r1=891273&r2=891274&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-with-label.xhtml
(original)
+++ myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-with-label.xhtml
Wed Dec 16 15:22:38 2009
@@ -7,7 +7,7 @@
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:f="http://java.sun.com/jsf/core">
 
-  <tc:page>
+  <tc:page id="page">
     <tc:gridLayoutConstraint width="600px" height="300px"/>
     <f:facet name="layout">
       <tc:gridLayout rows="auto;*"/>

Modified: myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-without-label.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-without-label.xhtml?rev=891274&r1=891273&r2=891274&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-without-label.xhtml
(original)
+++ myfaces/tobago/trunk/example/test/src/main/webapp/tc/separator/separator-without-label.xhtml
Wed Dec 16 15:22:38 2009
@@ -7,7 +7,7 @@
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:f="http://java.sun.com/jsf/core">
 
-  <tc:page>
+  <tc:page id="page">
     <tc:gridLayoutConstraint width="600px" height="300px"/>
     <f:facet name="layout">
       <tc:gridLayout rows="auto;*"/>
@@ -17,7 +17,7 @@
     <tc:panel/>
 
     <tc:script file="script/test-utils.js"/>
-    <tc:script onload="checkLayout('page:sep-0', 0, 0, 600, 14);"/>
+    <tc:script onload="checkLayout('page:sep-0', 0, 0, 600, 1);"/>
 
   </tc:page>
 </f:view>

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties?rev=891274&r1=891273&r2=891274&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
Wed Dec 16 15:22:38 2009
@@ -126,7 +126,8 @@
 
 SelectOneRadio.height=20
 
-Separator.preferredHeight=14
+Separator.height=14
+Separator.withoutLabelHeight=2
 
 Sheet.ascendingMarkerWidth=10
 Sheet.headerHeight=20

Modified: myfaces/tobago/trunk/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/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css?rev=891274&r1=891273&r2=891274&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
Wed Dec 16 15:22:38 2009
@@ -828,6 +828,7 @@
 
 hr.tobago-separator-default {
   border: 1px inset #000000;
+  margin: 0;
 }
 
 .tobago-separator-start-default {

Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties?rev=891274&r1=891273&r2=891274&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
(original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
Wed Dec 16 15:22:38 2009
@@ -76,7 +76,8 @@
 
 SelectManyListbox.minimumHeight=60
 
-Separator.preferredHeight=14
+Separator.height=14
+Separator.withoutLabelHeight=1
 
 Sheet.ascendingMarkerWidth=15
 Sheet.headerHeight=20

Modified: myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java?rev=891274&r1=891273&r2=891274&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java
Wed Dec 16 15:22:38 2009
@@ -21,6 +21,8 @@
 import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.component.UILabel;
 import org.apache.myfaces.tobago.component.UISeparator;
+import org.apache.myfaces.tobago.config.Configurable;
+import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.renderkit.HtmlUtils;
 import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
 import org.apache.myfaces.tobago.renderkit.css.Style;
@@ -43,12 +45,7 @@
     UISeparator separator = (UISeparator) component;
     TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
 
-    String label = separator.getLabel();
-    if (label == null && separator.getFacet(Facets.LABEL) != null) {
-      // deprecated
-      Deprecation.LOG.warn("label facet in tc:separator is deprecated, use label attribute
instead, please.");
-      label = String.valueOf(((UILabel) separator.getFacet(Facets.LABEL)).getValue());
-    }
+    String label = getLabel(separator);
 
     if (label != null) {
       if (VariableResolverUtil.resolveClientProperties(facesContext).getUserAgent().isMsie())
{
@@ -56,6 +53,7 @@
       }
 
       writer.startElement(HtmlConstants.TABLE, component);
+      writer.writeIdAttribute(separator.getClientId(facesContext));
       writer.writeClassAttribute();
       Style style = new Style(facesContext, separator);
       writer.writeStyleAttribute(style);
@@ -95,10 +93,31 @@
       writer.endElement(HtmlConstants.TABLE);
     } else {
       writer.startElement(HtmlConstants.HR , component);
+      writer.writeIdAttribute(separator.getClientId(facesContext));
       writer.writeClassAttribute();
       Style style = new Style(facesContext, separator);
       writer.writeStyleAttribute(style);
       writer.endElement(HtmlConstants.HR);
     }
   }
+
+  private String getLabel(UISeparator separator) {
+    String label = separator.getLabel();
+    if (label == null && separator.getFacet(Facets.LABEL) != null) {
+      // deprecated
+      Deprecation.LOG.warn("label facet in tc:separator is deprecated, use label attribute
instead, please.");
+      label = String.valueOf(((UILabel) separator.getFacet(Facets.LABEL)).getValue());
+    }
+    return label;
+  }
+
+  @Override
+  public Measure getHeight(FacesContext facesContext, Configurable component) {
+    String label = getLabel((UISeparator) component);
+    if (label == null) {
+      return getResourceManager().getThemeMeasure(facesContext, component, "withoutLabelHeight");
+    } else {
+      return super.getHeight(facesContext, component);
+    }
+  }
 }



Mime
View raw message