You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by id...@apache.org on 2006/10/03 16:53:27 UTC
svn commit: r452521 - in /myfaces/tobago/trunk/tobago-sandbox/src/main:
java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SeparatorRenderer.java
resources/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/style/style.css
Author: idus
Date: Tue Oct 3 07:53:27 2006
New Revision: 452521
URL: http://svn.apache.org/viewvc?view=rev&rev=452521
Log:
use table to layout label for separator to have more control over styling; CSS styling for field sets is rather limited
Modified:
myfaces/tobago/trunk/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SeparatorRenderer.java
myfaces/tobago/trunk/tobago-sandbox/src/main/resources/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/style/style.css
Modified: myfaces/tobago/trunk/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SeparatorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SeparatorRenderer.java?view=diff&rev=452521&r1=452520&r2=452521
==============================================================================
--- myfaces/tobago/trunk/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SeparatorRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SeparatorRenderer.java Tue Oct 3 07:53:27 2006
@@ -16,17 +16,15 @@
* limitations under the License.
*/
+import org.apache.myfaces.tobago.TobagoConstants;
+import org.apache.myfaces.tobago.component.UILabel;
import org.apache.myfaces.tobago.renderkit.RendererBase;
+import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
-import org.apache.myfaces.tobago.component.UILabel;
-import org.apache.myfaces.tobago.component.ComponentUtil;
-import org.apache.myfaces.tobago.TobagoConstants;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import javax.faces.context.FacesContext;
import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
import java.io.IOException;
/**
@@ -35,7 +33,6 @@
* Date: Sep 19, 2006
*/
public class SeparatorRenderer extends RendererBase {
- private static final Log LOG = LogFactory.getLog(SeparatorRenderer.class);
public void encodeEndTobago(FacesContext facesContext,
UIComponent component) throws IOException {
@@ -44,6 +41,37 @@
writer.writeComponentClass();
writer.writeComponentAttribute("style", TobagoConstants.ATTR_STYLE);
if (component.getFacet("label") != null) {
+ writer.startElement(HtmlConstants.TABLE, component);
+ writer.writeComponentClass();
+
+ writer.writeAttribute(HtmlAttributes.WIDTH, "100%", false);
+ writer.writeAttribute(HtmlAttributes.CELLPADDING, "0", false);
+ writer.writeAttribute(HtmlAttributes.CELLSPACING, "0", false);
+ writer.startElement(HtmlConstants.TR, component);
+
+ writer.startElement(HtmlConstants.TD, component);
+ writer.writeAttribute(HtmlAttributes.CLASS, "tobago-separator-start-default", false);
+ writer.startElement(HtmlConstants.HR , component);
+ writer.writeComponentClass();
+ writer.endElement(HtmlConstants.HR);
+ writer.endElement(HtmlConstants.TD);
+
+ writer.startElement(HtmlConstants.TD, component);
+ writer.writeAttribute(HtmlAttributes.STYLE, "width: 1px", false);
+ writer.writeAttribute(HtmlAttributes.CLASS, "tobago-separator-label-default", false);
+ UILabel label = (UILabel) component.getFacet("label");
+ writer.writeText(label.getValue(), null);
+ writer.endElement(HtmlConstants.TD);
+
+ writer.startElement(HtmlConstants.TD, component);
+ writer.startElement(HtmlConstants.HR , component);
+ writer.writeComponentClass();
+ writer.endElement(HtmlConstants.HR);
+ writer.endElement(HtmlConstants.TD);
+
+ writer.endElement(HtmlConstants.TR);
+ writer.endElement(HtmlConstants.TABLE);
+ /* field set variant for Scarborough
writer.startElement(HtmlConstants.FIELDSET, component);
writer.writeComponentClass();
UILabel label = (UILabel) component.getFacet("label");
@@ -52,6 +80,7 @@
writer.writeText(label.getValue(), null);
writer.endElement(HtmlConstants.LEGEND);
writer.endElement(HtmlConstants.FIELDSET);
+ */
} else {
writer.startElement(HtmlConstants.HR , component);
writer.writeComponentClass();
Modified: myfaces/tobago/trunk/tobago-sandbox/src/main/resources/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-sandbox/src/main/resources/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/style/style.css?view=diff&rev=452521&r1=452520&r2=452521
==============================================================================
--- myfaces/tobago/trunk/tobago-sandbox/src/main/resources/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-sandbox/src/main/resources/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/style/style.css Tue Oct 3 07:53:27 2006
@@ -14,10 +14,8 @@
* limitations under the License.
*/
-
/* separator ------------------------------------------------------------------- */
-
div.tobago-separator-default {
overflow: hidden;
}
@@ -27,13 +25,21 @@
border-bottom: 0px;
border-right: 0px;
border-top: 1px solid #333;
- margin-top: 3px;
}
-legend.tobago-separator-default {
+
+legend.tobago-separator-default, .tobago-separator-label-default {
font: bold 12px arial, helvetica, sans-serif;
padding-left: 5px;
padding-right: 5px;
}
+.tobago-separator-start-default {
+ width: 20px;
+}
+
hr.tobago-separator-default {
-}
\ No newline at end of file
+ border-top: 1px solid #E2E2E2;
+ border-right: 1px solid #E2E2E2;
+ border-bottom: 1px solid #000000;
+ border-left: 1px solid #E2E2E2;
+}