You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/09/23 12:16:13 UTC

svn commit: r449213 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/renderkit/ core/src/main/java/org/apache/myfaces/tobago/renderkit/html/ tobago-sandbox/src/main/resources/org/apache/myfaces/tobago/renderkit/html/sandbox/stan...

Author: bommel
Date: Sat Sep 23 03:16:13 2006
New Revision: 449213

URL: http://svn.apache.org/viewvc?view=rev&rev=449213
Log:
separator tag

Added:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlAttributes.java
Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoResponseStateManager.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlConstants.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java
    myfaces/tobago/trunk/tobago-sandbox/src/main/resources/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/style/style.css

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoResponseStateManager.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoResponseStateManager.java?view=diff&rev=449213&r1=449212&r2=449213
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoResponseStateManager.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoResponseStateManager.java Sat Sep 23 03:16:13 2006
@@ -18,6 +18,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 
 import javax.faces.render.ResponseStateManager;
 import javax.faces.context.FacesContext;
@@ -65,12 +67,12 @@
 
     if (treeStruct != null) {
       if (treeStruct instanceof String) {
-        responseWriter.startElement("input", null);
-        responseWriter.writeAttribute("type", "hidden", null);
-        responseWriter.writeAttribute("name", TREE_PARAM, null);
-        responseWriter.writeAttribute("id", TREE_PARAM, null);
-        responseWriter.writeAttribute("value", treeStruct, null);
-        responseWriter.endElement("input");
+        responseWriter.startElement(HtmlConstants.INPUT, null);
+        responseWriter.writeAttribute(HtmlAttributes.TYPE, "hidden", null);
+        responseWriter.writeAttribute(HtmlAttributes.NAME, TREE_PARAM, null);
+        responseWriter.writeAttribute(HtmlAttributes.ID, TREE_PARAM, null);
+        responseWriter.writeAttribute(HtmlAttributes.VALUE, treeStruct, null);
+        responseWriter.endElement(HtmlConstants.INPUT);
       }
     } else {
       LOG.error("No tree structure to be saved in client response!");
@@ -78,23 +80,23 @@
 
     if (compStates != null) {
       if (compStates instanceof String) {
-        responseWriter.startElement("input", null);
-        responseWriter.writeAttribute("type", "hidden", null);
-        responseWriter.writeAttribute("name", STATE_PARAM, null);
-        responseWriter.writeAttribute("id", STATE_PARAM, null);
-        responseWriter.writeAttribute("value", compStates, null);
-        responseWriter.endElement("input");
+        responseWriter.startElement(HtmlConstants.INPUT, null);
+        responseWriter.writeAttribute(HtmlAttributes.TYPE, "hidden", null);
+        responseWriter.writeAttribute(HtmlAttributes.NAME, STATE_PARAM, null);
+        responseWriter.writeAttribute(HtmlAttributes.ID, STATE_PARAM, null);
+        responseWriter.writeAttribute(HtmlAttributes.VALUE, compStates, null);
+        responseWriter.endElement(HtmlConstants.INPUT);
       }
     } else {
       LOG.error("No component states to be saved in client response!");
     }
 
-    responseWriter.startElement("input", null);
-    responseWriter.writeAttribute("type", "hidden", null);
-    responseWriter.writeAttribute("name", VIEWID_PARAM, null);
-    responseWriter.writeAttribute("id", VIEWID_PARAM, null);
-    responseWriter.writeAttribute("value", facescontext.getViewRoot().getViewId(), null);
-    responseWriter.endElement("input");
+    responseWriter.startElement(HtmlConstants.INPUT, null);
+    responseWriter.writeAttribute(HtmlAttributes.TYPE, "hidden", null);
+    responseWriter.writeAttribute(HtmlAttributes.NAME, VIEWID_PARAM, null);
+    responseWriter.writeAttribute(HtmlAttributes.ID, VIEWID_PARAM, null);
+    responseWriter.writeAttribute(HtmlAttributes.VALUE, facescontext.getViewRoot().getViewId(), null);
+    responseWriter.endElement(HtmlConstants.INPUT);
   }
 
 }

Added: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlAttributes.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlAttributes.java?view=auto&rev=449213
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlAttributes.java (added)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlAttributes.java Sat Sep 23 03:16:13 2006
@@ -0,0 +1,73 @@
+package org.apache.myfaces.tobago.renderkit.html;
+
+/*
+ * Copyright 2002-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: Sep 23, 2006
+ * Time: 10:01:48 AM
+ */
+public interface HtmlAttributes {
+  String STYLE = "style";
+  String TYPE = "type";
+  String NAME = "name";
+  String ID = "id";
+  String VALUE = "value";
+  String FOR = "for";
+  String TITLE = "title";
+  String DISABLED = "disabled";
+  String ONCLICK = "onclick";
+  String SELECTED = "selected";
+  String HREF = "href";
+  String SRC = "src";
+  String ALT = "alt";
+  String WIDTH = "width";
+  String BORDER = "border";
+  String CHECKED = "checked";
+  String SUMMARY = "summary";
+  String HEIGHT = "height";
+  String READONLY = "readonly";
+  String ONCHANGE = "onchange";
+  String CELLPADDING = "cellpadding";
+  String CELLSPACING = "cellspacing";
+  String ALIGN = "align";
+  String VALIGN = "valign";
+  String ROWSPAN = "rowspan";
+  String COLSPAN = "colspan";
+  String ONMOUSEOVER = "onmouseover";
+  String ONMOUSEOUT = "onmouseout";
+  String AUTOCOMPLETE = "autocomplete";
+  String TARGET = "target";
+  String SIZE = "size";
+  String MULTIPLE = "multiple";
+  String ROWS = "rows";
+  String REL = "rel";
+  String MEDIA = "media";
+  String ONLOAD = "onload";
+  String SCROLL = "scroll";
+  String ACTION = "action";
+  String METHOD = "method";
+  String ENCTYPE = "enctype";
+  String ACCEPT_CHARSET = "accept-charset";
+  String ONFOCUS = "onfocus";
+  String ONBLUR = "onblur";
+  String ONKEYDOWN = "onkeydown";
+  String ONKEYPRESS = "onkeypress";
+  String ONKEYUP = "onkeyup";
+}
+

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlConstants.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlConstants.java?view=diff&rev=449213&r1=449212&r2=449213
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlConstants.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlConstants.java Sat Sep 23 03:16:13 2006
@@ -1,7 +1,7 @@
 package org.apache.myfaces.tobago.renderkit.html;
 
 /*
- * Copyright 2002-2005 The Apache Software Foundation.
+ * Copyright 2002-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -49,4 +49,5 @@
   String BODY = "body";
   String FORM = "form";
   String SCRIPT = "script";
+  String META = "meta";
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java?view=diff&rev=449213&r1=449212&r2=449213
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlRendererUtil.java Sat Sep 23 03:16:13 2006
@@ -269,11 +269,11 @@
     if (width) {
       layoutSpace = LayoutUtil.getLayoutWidth(component);
       layoutAttribute = ATTR_LAYOUT_WIDTH;
-      styleAttribute = "width";
+      styleAttribute = HtmlAttributes.WIDTH;
     } else {
       layoutSpace = LayoutUtil.getLayoutHeight(component);
       layoutAttribute = ATTR_LAYOUT_HEIGHT;
-      styleAttribute = "height";
+      styleAttribute = HtmlAttributes.HEIGHT;
     }
     int space = -1;
     if (layoutSpace != null) {
@@ -476,14 +476,14 @@
   }
 
   public static void startJavascript(ResponseWriter writer) throws IOException {
-    writer.startElement("script", null);
-    writer.writeAttribute("type", "text/javascript", null);
+    writer.startElement(HtmlConstants.SCRIPT, null);
+    writer.writeAttribute(HtmlAttributes.TYPE, "text/javascript", null);
     writer.writeText("\n<!--\n", null);
   }
 
   public static void endJavascript(ResponseWriter writer) throws IOException {
     writer.writeText("\n// -->\n", null);
-    writer.endElement("script");
+    writer.endElement(HtmlConstants.SCRIPT);
   }
 
   public static void writeScriptLoader(FacesContext facesContext, String script)

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=449213&r1=449212&r2=449213
==============================================================================
--- 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 Sat Sep 23 03:16:13 2006
@@ -26,12 +26,14 @@
   border-left: 0px;
   border-bottom: 0px;
   border-right: 0px;
+  border-top: 1px solid #333;
+  margin-top: 3px;
 }
 legend.tobago-separator-default {
   font: bold 12px arial, helvetica, sans-serif;
-  padding-left:5px;
-  padding-right:5px;
+  padding-left: 5px;
+  padding-right: 5px;
 }
 
 hr.tobago-separator-default {
- }
\ No newline at end of file
+}
\ No newline at end of file