myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r226773 - in /myfaces/tomahawk/trunk: conf/ src/java/org/apache/myfaces/custom/column/ src/java/org/apache/myfaces/renderkit/html/ext/ tld/
Date Mon, 01 Aug 2005 11:26:59 GMT
Author: mbr
Date: Mon Aug  1 04:26:52 2005
New Revision: 226773

URL: http://svn.apache.org/viewcvs?rev=226773&view=rev
Log:
MYFACES-379

new x:column component allows to define common html attributes 
and events for each header, footer and cell

Added:
    myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/column/
    myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/column/HtmlColumn.java
    myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/column/HtmlColumnTag.java
Modified:
    myfaces/tomahawk/trunk/conf/faces-config.xml
    myfaces/tomahawk/trunk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlTableRenderer.java
    myfaces/tomahawk/trunk/tld/myfaces_ext.tld

Modified: myfaces/tomahawk/trunk/conf/faces-config.xml
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/conf/faces-config.xml?rev=226773&r1=226772&r2=226773&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/conf/faces-config.xml (original)
+++ myfaces/tomahawk/trunk/conf/faces-config.xml Mon Aug  1 04:26:52 2005
@@ -334,6 +334,11 @@
 		<component-class>org.apache.myfaces.custom.crosstable.UIColumns</component-class>
 	</component>
 
+  <component>
+    <component-type>org.apache.myfaces.HtmlColumn</component-type>
+    <component-class>org.apache.myfaces.custom.column.HtmlColumn</component-class>
+  </component>
+
     <!-- additional "by type" converters -->
 
     <converter>

Added: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/column/HtmlColumn.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/column/HtmlColumn.java?rev=226773&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/column/HtmlColumn.java (added)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/column/HtmlColumn.java Mon Aug
 1 04:26:52 2005
@@ -0,0 +1,690 @@
+/*
+ * Copyright 2005 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.
+ */
+package org.apache.myfaces.custom.column;
+
+import javax.faces.component.UIColumn;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+import org.apache.myfaces.renderkit.html.HTML;
+
+/**
+ * @author Mathias Broekelmann (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class HtmlColumn extends UIColumn
+{
+    //HTML universal attributes for header
+    private String _headerdir;
+    private String _headerlang;
+    private String _headerstyle;
+    private String _headerstyleClass;
+    private String _headertitle;
+
+    //HTML event handler attributes for header
+    private String _headeronclick;
+    private String _headerondblclick;
+    private String _headeronkeydown;
+    private String _headeronkeypress;
+    private String _headeronkeyup;
+    private String _headeronmousedown;
+    private String _headeronmousemove;
+    private String _headeronmouseout;
+    private String _headeronmouseover;
+    private String _headeronmouseup;
+
+    //HTML universal attributes for footer
+    private String _footerdir;
+    private String _footerlang;
+    private String _footerstyle;
+    private String _footerstyleClass;
+    private String _footertitle;
+
+    //HTML event handler attributes for footer
+    private String _footeronclick;
+    private String _footerondblclick;
+    private String _footeronkeydown;
+    private String _footeronkeypress;
+    private String _footeronkeyup;
+    private String _footeronmousedown;
+    private String _footeronmousemove;
+    private String _footeronmouseout;
+    private String _footeronmouseover;
+    private String _footeronmouseup;
+
+    //HTML universal attributes for row
+    private String _dir;
+    private String _lang;
+    private String _style;
+    private String _styleClass;
+    private String _title;
+
+    //HTML event handler attributes for 
+    private String _onclick;
+    private String _ondblclick;
+    private String _onkeydown;
+    private String _onkeypress;
+    private String _onkeyup;
+    private String _onmousedown;
+    private String _onmousemove;
+    private String _onmouseout;
+    private String _onmouseover;
+    private String _onmouseup;
+    
+    public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlColumn";
+
+    /**
+     * @param localValue
+     * @param valueBindingName
+     * @return
+     */
+    private Object getLocalOrValueBindingValue(Object localValue,
+                    String valueBindingName)
+    {
+        if (localValue != null)
+            return localValue;
+        ValueBinding vb = getValueBinding(valueBindingName);
+        return vb != null ? vb.getValue(getFacesContext()) : null;
+    }
+
+    public String getFooterdir()
+    {
+        return (String) getLocalOrValueBindingValue(_footerdir, "footerdir");
+    }
+
+    public void setFooterdir(String footerdir)
+    {
+        _footerdir = footerdir;
+    }
+
+    public String getFooterlang()
+    {
+        return (String) getLocalOrValueBindingValue(_footerlang, "footerlang");
+    }
+
+    public void setFooterlang(String footerlang)
+    {
+        _footerlang = footerlang;
+    }
+
+    public String getFooteronclick()
+    {
+        return (String) getLocalOrValueBindingValue(_footeronclick,
+                        "footeronclick");
+    }
+
+    public void setFooteronclick(String footeronclick)
+    {
+        _footeronclick = footeronclick;
+    }
+
+    public String getFooterondblclick()
+    {
+        return (String) getLocalOrValueBindingValue(_footerondblclick,
+                        "footerondblclick");
+    }
+
+    public void setFooterondblclick(String footerondblclick)
+    {
+        _footerondblclick = footerondblclick;
+    }
+
+    public String getFooteronkeydown()
+    {
+        return (String) getLocalOrValueBindingValue(_footeronkeydown,
+                        "footeronkeydown");
+    }
+
+    public void setFooteronkeydown(String footeronkeydown)
+    {
+        _footeronkeydown = footeronkeydown;
+    }
+
+    public String getFooteronkeypress()
+    {
+        return (String) getLocalOrValueBindingValue(_footeronkeypress,
+                        "footeronkeypress");
+    }
+
+    public void setFooteronkeypress(String footeronkeypress)
+    {
+        _footeronkeypress = footeronkeypress;
+    }
+
+    public String getFooteronkeyup()
+    {
+        return (String) getLocalOrValueBindingValue(_footeronkeyup,
+                        "footeronkeyup");
+    }
+
+    public void setFooteronkeyup(String footeronkeyup)
+    {
+        _footeronkeyup = footeronkeyup;
+    }
+
+    public String getFooteronmousedown()
+    {
+        return (String) getLocalOrValueBindingValue(_footeronmousedown,
+                        "footeronmousedown");
+    }
+
+    public void setFooteronmousedown(String footeronmousedown)
+    {
+        _footeronmousedown = footeronmousedown;
+    }
+
+    public String getFooteronmousemove()
+    {
+        return (String) getLocalOrValueBindingValue(_footeronmousemove,
+                        "footeronmousemove");
+    }
+
+    public void setFooteronmousemove(String footeronmousemove)
+    {
+        _footeronmousemove = footeronmousemove;
+    }
+
+    public String getFooteronmouseout()
+    {
+        return (String) getLocalOrValueBindingValue(_footeronmouseout,
+                        "footeronmouseout");
+    }
+
+    public void setFooteronmouseout(String footeronmouseout)
+    {
+        _footeronmouseout = footeronmouseout;
+    }
+
+    public String getFooteronmouseover()
+    {
+        return (String) getLocalOrValueBindingValue(_footeronmouseover,
+                        "footeronmouseover");
+    }
+
+    public void setFooteronmouseover(String footeronmouseover)
+    {
+        _footeronmouseover = footeronmouseover;
+    }
+
+    public String getFooteronmouseup()
+    {
+        return (String) getLocalOrValueBindingValue(_footeronmouseup,
+                        "footeronmouseup");
+    }
+
+    public void setFooteronmouseup(String footeronmouseup)
+    {
+        _footeronmouseup = footeronmouseup;
+    }
+
+    public String getFooterstyle()
+    {
+        return (String) getLocalOrValueBindingValue(_footerstyle, "footerstyle");
+    }
+
+    public void setFooterstyle(String footerstyle)
+    {
+        _footerstyle = footerstyle;
+    }
+
+    public String getFooterstyleClass()
+    {
+        return (String) getLocalOrValueBindingValue(_footerstyleClass,
+                        "footerstyleClass");
+    }
+
+    public void setFooterstyleClass(String footerstyleClass)
+    {
+        _footerstyleClass = footerstyleClass;
+    }
+
+    public String getFootertitle()
+    {
+        return (String) getLocalOrValueBindingValue(_footertitle, "footertitle");
+    }
+
+    public void setFootertitle(String footertitle)
+    {
+        _footertitle = footertitle;
+    }
+
+    public String getHeaderdir()
+    {
+        return (String) getLocalOrValueBindingValue(_headerdir, "headerdir");
+    }
+
+    public void setHeaderdir(String headerdir)
+    {
+        _headerdir = headerdir;
+    }
+
+    public String getHeaderlang()
+    {
+        return (String) getLocalOrValueBindingValue(_headerlang, "headerlang");
+    }
+
+    public void setHeaderlang(String headerlang)
+    {
+        _headerlang = headerlang;
+    }
+
+    public String getHeaderonclick()
+    {
+        return (String) getLocalOrValueBindingValue(_headeronclick,
+                        "headeronclick");
+    }
+
+    public void setHeaderonclick(String headeronclick)
+    {
+        _headeronclick = headeronclick;
+    }
+
+    public String getHeaderondblclick()
+    {
+        return (String) getLocalOrValueBindingValue(_headerondblclick,
+                        "headerondblclick");
+    }
+
+    public void setHeaderondblclick(String headerondblclick)
+    {
+        _headerondblclick = headerondblclick;
+    }
+
+    public String getHeaderonkeydown()
+    {
+        return (String) getLocalOrValueBindingValue(_headeronkeydown,
+                        "headeronkeydown");
+    }
+
+    public void setHeaderonkeydown(String headeronkeydown)
+    {
+        _headeronkeydown = headeronkeydown;
+    }
+
+    public String getHeaderonkeypress()
+    {
+        return (String) getLocalOrValueBindingValue(_headeronkeypress,
+                        "headeronkeypress");
+    }
+
+    public void setHeaderonkeypress(String headeronkeypress)
+    {
+        _headeronkeypress = headeronkeypress;
+    }
+
+    public String getHeaderonkeyup()
+    {
+        return (String) getLocalOrValueBindingValue(_headeronkeyup,
+                        "headeronkeyup");
+    }
+
+    public void setHeaderonkeyup(String headeronkeyup)
+    {
+        _headeronkeyup = headeronkeyup;
+    }
+
+    public String getHeaderonmousedown()
+    {
+        return (String) getLocalOrValueBindingValue(_headeronmousedown,
+                        "headeronmousedown");
+    }
+
+    public void setHeaderonmousedown(String headeronmousedown)
+    {
+        _headeronmousedown = headeronmousedown;
+    }
+
+    public String getHeaderonmousemove()
+    {
+        return (String) getLocalOrValueBindingValue(_headeronmousemove,
+                        "headeronmousemove");
+    }
+
+    public void setHeaderonmousemove(String headeronmousemove)
+    {
+        _headeronmousemove = headeronmousemove;
+    }
+
+    public String getHeaderonmouseout()
+    {
+        return (String) getLocalOrValueBindingValue(_headeronmouseout,
+                        "headeronmouseout");
+    }
+
+    public void setHeaderonmouseout(String headeronmouseout)
+    {
+        _headeronmouseout = headeronmouseout;
+    }
+
+    public String getHeaderonmouseover()
+    {
+        return (String) getLocalOrValueBindingValue(_headeronmouseover,
+                        "headeronmouseover");
+    }
+
+    public void setHeaderonmouseover(String headeronmouseover)
+    {
+        _headeronmouseover = headeronmouseover;
+    }
+
+    public String getHeaderonmouseup()
+    {
+        return (String) getLocalOrValueBindingValue(_headeronmouseup,
+                        "headeronmouseup");
+    }
+
+    public void setHeaderonmouseup(String headeronmouseup)
+    {
+        _headeronmouseup = headeronmouseup;
+    }
+
+    public String getHeaderstyle()
+    {
+        return (String) getLocalOrValueBindingValue(_headerstyle, "headerstyle");
+    }
+
+    public void setHeaderstyle(String headerstyle)
+    {
+        _headerstyle = headerstyle;
+    }
+
+    public String getHeaderstyleClass()
+    {
+        return (String) getLocalOrValueBindingValue(_headerstyleClass,
+                        "headerstyleClass");
+    }
+
+    public void setHeaderstyleClass(String headerstyleClass)
+    {
+        _headerstyleClass = headerstyleClass;
+    }
+
+    public String getHeadertitle()
+    {
+        return (String) getLocalOrValueBindingValue(_headertitle, "headertitle");
+    }
+
+    public void setHeadertitle(String headertitle)
+    {
+        _headertitle = headertitle;
+    }
+
+    public String getDir()
+    {
+        return (String) getLocalOrValueBindingValue(_dir, "dir");
+    }
+
+    public void setDir(String dir)
+    {
+        _dir = dir;
+    }
+
+    public String getLang()
+    {
+        return (String) getLocalOrValueBindingValue(_lang, "lang");
+    }
+
+    public void setLang(String lang)
+    {
+        _lang = lang;
+    }
+
+    public String getOnclick()
+    {
+        return (String) getLocalOrValueBindingValue(_onclick, "onclick");
+    }
+
+    public void setOnclick(String onclick)
+    {
+        _onclick = onclick;
+    }
+
+    public String getOndblclick()
+    {
+        return (String) getLocalOrValueBindingValue(_ondblclick, "ondblclick");
+    }
+
+    public void setOndblclick(String ondblclick)
+    {
+        _ondblclick = ondblclick;
+    }
+
+    public String getOnkeydown()
+    {
+        return (String) getLocalOrValueBindingValue(_onkeydown, "onkeydown");
+    }
+
+    public void setOnkeydown(String onkeydown)
+    {
+        _onkeydown = onkeydown;
+    }
+
+    public String getOnkeypress()
+    {
+        return (String) getLocalOrValueBindingValue(_onkeypress, "onkeypress");
+    }
+
+    public void setOnkeypress(String onkeypress)
+    {
+        _onkeypress = onkeypress;
+    }
+
+    public String getOnkeyup()
+    {
+        return (String) getLocalOrValueBindingValue(_onkeyup, "onkeyup");
+    }
+
+    public void setOnkeyup(String onkeyup)
+    {
+        _onkeyup = onkeyup;
+    }
+
+    public String getOnmousedown()
+    {
+        return (String) getLocalOrValueBindingValue(_onmousedown, "onmousedown");
+    }
+
+    public void setOnmousedown(String onmousedown)
+    {
+        _onmousedown = onmousedown;
+    }
+
+    public String getOnmousemove()
+    {
+        return (String) getLocalOrValueBindingValue(_onmousemove, "onmousemove");
+    }
+
+    public void setOnmousemove(String onmousemove)
+    {
+        _onmousemove = onmousemove;
+    }
+
+    public String getOnmouseout()
+    {
+        return (String) getLocalOrValueBindingValue(_onmouseout, "onmouseout");
+    }
+
+    public void setOnmouseout(String onmouseout)
+    {
+        _onmouseout = onmouseout;
+    }
+
+    public String getOnmouseover()
+    {
+        return (String) getLocalOrValueBindingValue(_onmouseover, "onmouseover");
+    }
+
+    public void setOnmouseover(String onmouseover)
+    {
+        _onmouseover = onmouseover;
+    }
+
+    public String getOnmouseup()
+    {
+        return (String) getLocalOrValueBindingValue(_onmouseup, "onmouseup");
+    }
+
+    public void setOnmouseup(String onmouseup)
+    {
+        _onmouseup = onmouseup;
+    }
+
+    public String getStyle()
+    {
+        return (String) getLocalOrValueBindingValue(_style, "style");
+    }
+
+    public void setStyle(String style)
+    {
+        _style = style;
+    }
+
+    public String getStyleClass()
+    {
+        return (String) getLocalOrValueBindingValue(_styleClass, "styleClass");
+    }
+
+    public void setStyleClass(String styleClass)
+    {
+        _styleClass = styleClass;
+    }
+
+    public String getTitle()
+    {
+        return (String) getLocalOrValueBindingValue(_title, "title");
+    }
+
+    public void setTitle(String title)
+    {
+        _title = title;
+    }
+
+    /**
+     * @see javax.faces.component.UIComponentBase#saveState(javax.faces.context.FacesContext)
+     */
+    public Object saveState(FacesContext context)
+    {
+        Object[] values = new Object[46];
+        values[0] = super.saveState(context);
+
+        values[1] = _headerdir;
+        values[2] = _headerlang;
+        values[3] = _headerstyle;
+        values[4] = _headerstyleClass;
+        values[5] = _headertitle;
+        values[6] = _headeronclick;
+        values[7] = _headerondblclick;
+        values[8] = _headeronkeydown;
+        values[9] = _headeronkeypress;
+        values[10] = _headeronkeyup;
+        values[11] = _headeronmousedown;
+        values[12] = _headeronmousemove;
+        values[13] = _headeronmouseout;
+        values[14] = _headeronmouseover;
+        values[15] = _headeronmouseup;
+
+        values[16] = _footerdir;
+        values[17] = _footerlang;
+        values[18] = _footerstyle;
+        values[19] = _footerstyleClass;
+        values[20] = _footertitle;
+        values[21] = _footeronclick;
+        values[22] = _footerondblclick;
+        values[23] = _footeronkeydown;
+        values[24] = _footeronkeypress;
+        values[25] = _footeronkeyup;
+        values[26] = _footeronmousedown;
+        values[27] = _footeronmousemove;
+        values[28] = _footeronmouseout;
+        values[29] = _footeronmouseover;
+        values[30] = _footeronmouseup;
+
+        values[31] = _dir;
+        values[32] = _lang;
+        values[33] = _style;
+        values[34] = _styleClass;
+        values[35] = _title;
+        values[36] = _onclick;
+        values[37] = _ondblclick;
+        values[38] = _onkeydown;
+        values[39] = _onkeypress;
+        values[40] = _onkeyup;
+        values[41] = _onmousedown;
+        values[42] = _onmousemove;
+        values[43] = _onmouseout;
+        values[44] = _onmouseover;
+        values[45] = _onmouseup;
+
+        return values;
+    }
+
+    /**
+     * @see javax.faces.component.UIComponentBase#restoreState(javax.faces.context.FacesContext,
java.lang.Object)
+     */
+    public void restoreState(FacesContext context, Object state)
+    {
+        Object[] values = (Object[]) state;
+        super.restoreState(context, values[0]);
+
+        _headerdir = (String) values[1];
+        _headerlang = (String) values[2];
+        _headerstyle = (String) values[3];
+        _headerstyleClass = (String) values[4];
+        _headertitle = (String) values[5];
+        _headeronclick = (String) values[6];
+        _headerondblclick = (String) values[7];
+        _headeronkeydown = (String) values[8];
+        _headeronkeypress = (String) values[9];
+        _headeronkeyup = (String) values[10];
+        _headeronmousedown = (String) values[11];
+        _headeronmousemove = (String) values[12];
+        _headeronmouseout = (String) values[13];
+        _headeronmouseover = (String) values[14];
+        _headeronmouseup = (String) values[15];
+
+        _footerdir = (String) values[16];
+        _footerlang = (String) values[17];
+        _footerstyle = (String) values[18];
+        _footerstyleClass = (String) values[19];
+        _footertitle = (String) values[20];
+        _footeronclick = (String) values[21];
+        _footerondblclick = (String) values[22];
+        _footeronkeydown = (String) values[23];
+        _footeronkeypress = (String) values[24];
+        _footeronkeyup = (String) values[25];
+        _footeronmousedown = (String) values[26];
+        _footeronmousemove = (String) values[27];
+        _footeronmouseout = (String) values[28];
+        _footeronmouseover = (String) values[29];
+        _footeronmouseup = (String) values[30];
+
+        _dir = (String) values[31];
+        _lang = (String) values[32];
+        _style = (String) values[33];
+        _styleClass = (String) values[34];
+        _title = (String) values[35];
+        _onclick = (String) values[36];
+        _ondblclick = (String) values[37];
+        _onkeydown = (String) values[38];
+        _onkeypress = (String) values[39];
+        _onkeyup = (String) values[40];
+        _onmousedown = (String) values[41];
+        _onmousemove = (String) values[42];
+        _onmouseout = (String) values[43];
+        _onmouseover = (String) values[44];
+        _onmouseup = (String) values[45];
+    }
+}

Added: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/column/HtmlColumnTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/column/HtmlColumnTag.java?rev=226773&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/column/HtmlColumnTag.java (added)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/column/HtmlColumnTag.java Mon
Aug  1 04:26:52 2005
@@ -0,0 +1,290 @@
+/*
+ * Copyright 2005 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.
+ */
+package org.apache.myfaces.custom.column;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * @author Mathias Broekelmann (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class HtmlColumnTag extends org.apache.myfaces.taglib.html.HtmlColumnTag
+{
+    //HTML universal attributes for header
+    private String _headerdir;
+    private String _headerlang;
+    private String _headerstyle;
+    private String _headerstyleClass;
+    private String _headertitle;
+
+    //HTML event handler attributes for header
+    private String _headeronclick;
+    private String _headerondblclick;
+    private String _headeronkeydown;
+    private String _headeronkeypress;
+    private String _headeronkeyup;
+    private String _headeronmousedown;
+    private String _headeronmousemove;
+    private String _headeronmouseout;
+    private String _headeronmouseover;
+    private String _headeronmouseup;
+
+    //HTML universal attributes for footer
+    private String _footerdir;
+    private String _footerlang;
+    private String _footerstyle;
+    private String _footerstyleClass;
+    private String _footertitle;
+
+    //HTML event handler attributes for footer
+    private String _footeronclick;
+    private String _footerondblclick;
+    private String _footeronkeydown;
+    private String _footeronkeypress;
+    private String _footeronkeyup;
+    private String _footeronmousedown;
+    private String _footeronmousemove;
+    private String _footeronmouseout;
+    private String _footeronmouseover;
+    private String _footeronmouseup;
+
+    public String getComponentType()
+    {
+        return HtmlColumn.COMPONENT_TYPE;
+    }
+
+    public void release()
+    {
+        super.release();
+        _headerdir = null;
+        _headerlang = null;
+        _headerstyle = null;
+        _headerstyleClass = null;
+        _headertitle = null;
+        _headeronclick = null;
+        _headerondblclick = null;
+        _headeronkeydown = null;
+        _headeronkeypress = null;
+        _headeronkeyup = null;
+        _headeronmousedown = null;
+        _headeronmousemove = null;
+        _headeronmouseout = null;
+        _headeronmouseover = null;
+        _headeronmouseup = null;
+
+        _footerdir = null;
+        _footerlang = null;
+        _footerstyle = null;
+        _footerstyleClass = null;
+        _footertitle = null;
+        _footeronclick = null;
+        _footerondblclick = null;
+        _footeronkeydown = null;
+        _footeronkeypress = null;
+        _footeronkeyup = null;
+        _footeronmousedown = null;
+        _footeronmousemove = null;
+        _footeronmouseout = null;
+        _footeronmouseover = null;
+        _footeronmouseup = null;
+    }
+
+    protected void setProperties(UIComponent component)
+    {
+        super.setProperties(component);
+        setStringProperty(component, "headerdir", _headerdir);
+        setStringProperty(component, "headerlang", _headerlang);
+        setStringProperty(component, "headerstyle", _headerstyle);
+        setStringProperty(component, "headertitle", _headertitle);
+        setStringProperty(component, "headerstyleClass", _headerstyleClass);
+        setStringProperty(component, "headeronclick", _headeronclick);
+        setStringProperty(component, "headerondblclick", _headerondblclick);
+        setStringProperty(component, "headeronmousedown", _headeronmousedown);
+        setStringProperty(component, "headeronmouseup", _headeronmouseup);
+        setStringProperty(component, "headeronmouseover", _headeronmouseover);
+        setStringProperty(component, "headeronmousemove", _headeronmousemove);
+        setStringProperty(component, "headeronmouseout", _headeronmouseout);
+        setStringProperty(component, "headeronkeypress", _headeronkeypress);
+        setStringProperty(component, "headeronkeydown", _headeronkeydown);
+        setStringProperty(component, "headeronkeyup", _headeronkeyup);
+
+        setStringProperty(component, "footerdir", _footerdir);
+        setStringProperty(component, "footerlang", _footerlang);
+        setStringProperty(component, "footerstyle", _footerstyle);
+        setStringProperty(component, "footertitle", _footertitle);
+        setStringProperty(component, "footerstyleClass", _footerstyleClass);
+        setStringProperty(component, "footeronclick", _footeronclick);
+        setStringProperty(component, "footerondblclick", _footerondblclick);
+        setStringProperty(component, "footeronmousedown", _footeronmousedown);
+        setStringProperty(component, "footeronmouseup", _footeronmouseup);
+        setStringProperty(component, "footeronmouseover", _footeronmouseover);
+        setStringProperty(component, "footeronmousemove", _footeronmousemove);
+        setStringProperty(component, "footeronmouseout", _footeronmouseout);
+        setStringProperty(component, "footeronkeypress", _footeronkeypress);
+        setStringProperty(component, "footeronkeydown", _footeronkeydown);
+        setStringProperty(component, "footeronkeyup", _footeronkeyup);
+    }
+
+    public void setFooterdir(String footerdir)
+    {
+        _footerdir = footerdir;
+    }
+
+    public void setFooterlang(String footerlang)
+    {
+        _footerlang = footerlang;
+    }
+
+    public void setFooteronclick(String footeronclick)
+    {
+        _footeronclick = footeronclick;
+    }
+
+    public void setFooterondblclick(String footerondblclick)
+    {
+        _footerondblclick = footerondblclick;
+    }
+
+    public void setFooteronkeydown(String footeronkeydown)
+    {
+        _footeronkeydown = footeronkeydown;
+    }
+
+    public void setFooteronkeypress(String footeronkeypress)
+    {
+        _footeronkeypress = footeronkeypress;
+    }
+
+    public void setFooteronkeyup(String footeronkeyup)
+    {
+        _footeronkeyup = footeronkeyup;
+    }
+
+    public void setFooteronmousedown(String footeronmousedown)
+    {
+        _footeronmousedown = footeronmousedown;
+    }
+
+    public void setFooteronmousemove(String footeronmousemove)
+    {
+        _footeronmousemove = footeronmousemove;
+    }
+
+    public void setFooteronmouseout(String footeronmouseout)
+    {
+        _footeronmouseout = footeronmouseout;
+    }
+
+    public void setFooteronmouseover(String footeronmouseover)
+    {
+        _footeronmouseover = footeronmouseover;
+    }
+
+    public void setFooteronmouseup(String footeronmouseup)
+    {
+        _footeronmouseup = footeronmouseup;
+    }
+
+    public void setFooterstyle(String footerstyle)
+    {
+        _footerstyle = footerstyle;
+    }
+
+    public void setFooterstyleclass(String footerstyleclass)
+    {
+        _footerstyleClass = footerstyleclass;
+    }
+
+    public void setFootertitle(String footertitle)
+    {
+        _footertitle = footertitle;
+    }
+
+    public void setHeaderdir(String headerdir)
+    {
+        _headerdir = headerdir;
+    }
+
+    public void setHeaderlang(String headerlang)
+    {
+        _headerlang = headerlang;
+    }
+
+    public void setHeaderonclick(String headeronclick)
+    {
+        _headeronclick = headeronclick;
+    }
+
+    public void setHeaderondblclick(String headerondblclick)
+    {
+        _headerondblclick = headerondblclick;
+    }
+
+    public void setHeaderonkeydown(String headeronkeydown)
+    {
+        _headeronkeydown = headeronkeydown;
+    }
+
+    public void setHeaderonkeypress(String headeronkeypress)
+    {
+        _headeronkeypress = headeronkeypress;
+    }
+
+    public void setHeaderonkeyup(String headeronkeyup)
+    {
+        _headeronkeyup = headeronkeyup;
+    }
+
+    public void setHeaderonmousedown(String headeronmousedown)
+    {
+        _headeronmousedown = headeronmousedown;
+    }
+
+    public void setHeaderonmousemove(String headeronmousemove)
+    {
+        _headeronmousemove = headeronmousemove;
+    }
+
+    public void setHeaderonmouseout(String headeronmouseout)
+    {
+        _headeronmouseout = headeronmouseout;
+    }
+
+    public void setHeaderonmouseover(String headeronmouseover)
+    {
+        _headeronmouseover = headeronmouseover;
+    }
+
+    public void setHeaderonmouseup(String headeronmouseup)
+    {
+        _headeronmouseup = headeronmouseup;
+    }
+
+    public void setHeaderstyle(String headerstyle)
+    {
+        _headerstyle = headerstyle;
+    }
+
+    public void setHeaderstyleclass(String headerstyleclass)
+    {
+        _headerstyleClass = headerstyleclass;
+    }
+
+    public void setHeadertitle(String headertitle)
+    {
+        _headertitle = headertitle;
+    }
+}

Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlTableRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlTableRenderer.java?rev=226773&r1=226772&r2=226773&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlTableRenderer.java
(original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlTableRenderer.java
Mon Aug  1 04:26:52 2005
@@ -5,26 +5,28 @@
  * @version $Revision$ $Date$
  */
 
-import org.apache.myfaces.renderkit.html.HtmlTableRendererBase;
-import javax.faces.context.ResponseWriter;
 import java.io.IOException;
-import javax.faces.context.FacesContext;
+
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIData;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
 import org.apache.myfaces.component.html.ext.HtmlDataTable;
+import org.apache.myfaces.custom.column.HtmlColumn;
 import org.apache.myfaces.custom.crosstable.UIColumns;
+import org.apache.myfaces.renderkit.RendererUtils;
 import org.apache.myfaces.renderkit.html.HTML;
+import org.apache.myfaces.renderkit.html.HtmlRendererUtils;
+import org.apache.myfaces.renderkit.html.HtmlTableRendererBase;
 
-public class HtmlTableRenderer
-        extends HtmlTableRendererBase
+public class HtmlTableRenderer extends HtmlTableRendererBase
 {
     //private static final Log log = LogFactory.getLog(HtmlTableRenderer.class);
 
-    protected void renderRowStart(
-            FacesContext facesContext,
-            ResponseWriter writer,
-            UIData uiData,
-            String rowStyleClass) throws IOException
+    protected void renderRowStart(FacesContext facesContext,
+                    ResponseWriter writer, UIData uiData, String rowStyleClass)
+                    throws IOException
     {
         super.renderRowStart(facesContext, writer, uiData, rowStyleClass);
 
@@ -43,44 +45,82 @@
         renderRowAttribute(writer, HTML.ONMOUSEUP_ATTR, table.getRowOnMouseUp());
     }
 
-    protected void renderRowAttribute(ResponseWriter writer, String htmlAttribute, Object
value) throws IOException
+    protected void renderRowAttribute(ResponseWriter writer,
+                    String htmlAttribute, Object value) throws IOException
     {
-      if(value != null)
-      {
-        writer.writeAttribute(htmlAttribute, value, null);
-      }
+        if (value != null)
+        {
+            writer.writeAttribute(htmlAttribute, value, null);
+        }
     }
 
     /**
      * handles uicolumns component
      * @see org.apache.myfaces.renderkit.html.HtmlTableRendererBase#encodeColumnChild(javax.faces.context.FacesContext,
javax.faces.context.ResponseWriter, javax.faces.component.UIData, javax.faces.component.UIComponent,
java.lang.String)
      */
-    protected void encodeColumnChild(FacesContext facesContext, ResponseWriter writer,
-                    UIData uiData, UIComponent component, String columnStyle) throws IOException
+    protected void encodeColumnChild(FacesContext facesContext,
+                    ResponseWriter writer, UIData uiData,
+                    UIComponent component, String columnStyle)
+                    throws IOException
     {
-        super.encodeColumnChild(facesContext, writer, uiData, component, columnStyle);
+        super.encodeColumnChild(facesContext, writer, uiData, component,
+                        columnStyle);
         if (component instanceof UIColumns)
         {
             UIColumns columns = (UIColumns) component;
             for (int k = 0, colSize = columns.getRowCount(); k < colSize; k++)
             {
                 columns.setRowIndex(k);
-                renderColumnBody(facesContext, writer, uiData, component, columnStyle);
+                renderColumnBody(facesContext, writer, uiData, component,
+                                columnStyle);
             }
             columns.setRowIndex(-1);
         }
     }
 
     /**
+     * @see org.apache.myfaces.renderkit.html.HtmlTableRendererBase#renderColumnBody(javax.faces.context.FacesContext,
javax.faces.context.ResponseWriter, javax.faces.component.UIData, javax.faces.component.UIComponent,
java.lang.String)
+     */
+    protected void renderColumnBody(FacesContext facesContext,
+                    ResponseWriter writer, UIData uiData,
+                    UIComponent component, String columnStyleClass)
+                    throws IOException
+    {
+        if (component instanceof HtmlColumn)
+        {
+            writer.startElement(HTML.TD_ELEM, uiData);
+            String styleClass = ((HtmlColumn) component).getStyleClass();
+            if (styleClass == null)
+            {
+                styleClass = columnStyleClass;
+            }
+            if (styleClass != null)
+            {
+                writer.writeAttribute(HTML.CLASS_ATTR, styleClass, null);
+            }
+            renderHtmlColumnAttributes(writer, component, null);
+
+            RendererUtils.renderChild(facesContext, component);
+            writer.endElement(HTML.TD_ELEM);
+        }
+        else
+        {
+            super.renderColumnBody(facesContext, writer, uiData, component,
+                            columnStyleClass);
+        }
+    }
+
+    /**
      * handles uicolumns component
      * @see org.apache.myfaces.renderkit.html.HtmlTableRendererBase#renderColumnChildHeaderOrFooterRow(javax.faces.context.FacesContext,
javax.faces.context.ResponseWriter, javax.faces.component.UIComponent, java.lang.String, boolean)
      */
-    protected void renderColumnChildHeaderOrFooterRow(FacesContext facesContext,
-                    ResponseWriter writer, UIComponent uiComponent, String styleClass,
-                    boolean header) throws IOException
+    protected void renderColumnChildHeaderOrFooterRow(
+                    FacesContext facesContext, ResponseWriter writer,
+                    UIComponent uiComponent, String styleClass, boolean header)
+                    throws IOException
     {
-        super.renderColumnChildHeaderOrFooterRow(facesContext, writer, uiComponent, styleClass,
-                        header);
+        super.renderColumnChildHeaderOrFooterRow(facesContext, writer,
+                        uiComponent, styleClass, header);
         if (uiComponent instanceof UIColumns)
         {
             UIColumns columns = (UIColumns) uiComponent;
@@ -89,17 +129,120 @@
                 columns.setRowIndex(i);
                 if (header)
                 {
-                    renderColumnHeaderCell(facesContext, writer, columns, columns.getHeader(),
-                                    styleClass, 0);
+                    renderColumnHeaderCell(facesContext, writer, columns,
+                                    columns.getHeader(), styleClass, 0);
                 }
                 else
                 {
-                    renderColumnFooterCell(facesContext, writer, columns, columns.getFooter(),
-                                    styleClass, 0);
+                    renderColumnFooterCell(facesContext, writer, columns,
+                                    columns.getFooter(), styleClass, 0);
                 }
             }
             columns.setRowIndex(-1);
         }
+    }
+
+    /**
+     * @see org.apache.myfaces.renderkit.html.HtmlTableRendererBase#renderColumnHeaderCell(javax.faces.context.FacesContext,
javax.faces.context.ResponseWriter, javax.faces.component.UIComponent, javax.faces.component.UIComponent,
java.lang.String, int)
+     */
+    protected void renderColumnHeaderCell(FacesContext facesContext,
+                    ResponseWriter writer, UIComponent uiComponent,
+                    UIComponent facet, String headerStyleClass, int colspan)
+                    throws IOException
+    {
+        if (uiComponent instanceof HtmlColumn)
+        {
+            writer.startElement(HTML.TH_ELEM, uiComponent);
+            if (colspan > 1)
+            {
+                writer.writeAttribute(HTML.COLSPAN_ATTR, new Integer(colspan),
+                                null);
+            }
+            String styleClass = ((HtmlColumn) uiComponent)
+                            .getHeaderstyleClass();
+            if (styleClass == null)
+            {
+                styleClass = headerStyleClass;
+            }
+            if (styleClass != null)
+            {
+                writer.writeAttribute(HTML.CLASS_ATTR, styleClass, null);
+            }
+            renderHtmlColumnAttributes(writer, uiComponent, "header");
+            if (facet != null)
+            {
+                RendererUtils.renderChild(facesContext, facet);
+            }
+            writer.endElement(HTML.TH_ELEM);
+        }
+        else
+        {
+            super.renderColumnHeaderCell(facesContext, writer, uiComponent,
+                            facet, headerStyleClass, colspan);
+        }
+    }
+
+    /**
+     * @see org.apache.myfaces.renderkit.html.HtmlTableRendererBase#renderColumnFooterCell(javax.faces.context.FacesContext,
javax.faces.context.ResponseWriter, javax.faces.component.UIComponent, javax.faces.component.UIComponent,
java.lang.String, int)
+     */
+    protected void renderColumnFooterCell(FacesContext facesContext,
+                    ResponseWriter writer, UIComponent uiComponent,
+                    UIComponent facet, String footerStyleClass, int colspan)
+                    throws IOException
+    {
+        if (uiComponent instanceof HtmlColumn)
+        {
+            writer.startElement(HTML.TD_ELEM, uiComponent);
+            if (colspan > 1)
+            {
+                writer.writeAttribute(HTML.COLSPAN_ATTR, new Integer(colspan),
+                                null);
+            }
+            String styleClass = ((HtmlColumn) uiComponent)
+                            .getFooterstyleClass();
+            if (styleClass == null)
+            {
+                styleClass = footerStyleClass;
+            }
+            if (styleClass != null)
+            {
+                writer.writeAttribute(HTML.CLASS_ATTR, styleClass, null);
+            }
+            renderHtmlColumnAttributes(writer, uiComponent, "footer");
+            if (facet != null)
+            {
+                RendererUtils.renderChild(facesContext, facet);
+            }
+            writer.endElement(HTML.TD_ELEM);
+        }
+        else
+        {
+            super.renderColumnFooterCell(facesContext, writer, uiComponent,
+                            facet, footerStyleClass, colspan);
+        }
+    }
+
+    /**
+     * @param writer
+     * @param uiComponent
+     * @param prefix header, footer or null
+     * @throws IOException 
+     */
+    protected void renderHtmlColumnAttributes(ResponseWriter writer,
+                    UIComponent uiComponent, String prefix) throws IOException
+    {
+        String[] attrs = HTML.COMMON_PASSTROUGH_ATTRIBUTES_WITHOUT_STYLE;
+        for (int i = 0, size = attrs.length; i < size; i++)
+        {
+            String attributeName = attrs[i];
+            String compAttrName = prefix != null ? prefix + attributeName : attributeName;
+            HtmlRendererUtils.renderHTMLAttribute(writer, uiComponent,
+                            compAttrName, attributeName);
+        }
+        String compAttrName = prefix != null ? prefix + HTML.STYLE_ATTR : HTML.STYLE_ATTR;
+        HtmlRendererUtils.renderHTMLAttribute(writer, uiComponent,
+                        compAttrName, HTML.STYLE_ATTR);
+
     }
 
     /**

Modified: myfaces/tomahawk/trunk/tld/myfaces_ext.tld
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/tld/myfaces_ext.tld?rev=226773&r1=226772&r2=226773&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/tld/myfaces_ext.tld (original)
+++ myfaces/tomahawk/trunk/tld/myfaces_ext.tld Mon Aug  1 04:26:52 2005
@@ -2489,4 +2489,50 @@
         </attribute>        
      </tag>
 
+
+  <!-- column -->
+    <tag>
+        <name>column</name>
+        <tag-class>org.apache.myfaces.custom.column.HtmlColumnTag</tag-class>
+        <body-content>JSP</body-content>
+        &ui_component_attributes;
+        &ui_column_attributes;
+        &html_universal_attributes;
+        &html_event_handler_attributes;
+        
+        <!-- header attributes -->
+        <attribute><name>headerdir</name>     <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headerlang</name>    <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headerstyle</name>   <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headertitle</name>   <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headerstyleClass</name><required>false</required><rtexprvalue>false</rtexprvalue><description>Corresponds
to the HTML class attribute.</description></attribute>
+        <attribute><name>headeronclick</name>    <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headerondblclick</name> <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headeronmousedown</name><required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headeronmouseup</name>  <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headeronmouseover</name><required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headeronmousemove</name><required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headeronmouseout</name> <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headeronkeypress</name> <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headeronkeydown</name>  <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>headeronkeyup</name>    <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+
+        <!-- footer attributes -->
+        <attribute><name>footerdir</name>     <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footerlang</name>    <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footerstyle</name>   <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footertitle</name>   <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footerstyleClass</name><required>false</required><rtexprvalue>false</rtexprvalue><description>Corresponds
to the HTML class attribute.</description></attribute>
+        <attribute><name>footeronclick</name>    <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footerondblclick</name> <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footeronmousedown</name><required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footeronmouseup</name>  <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footeronmouseover</name><required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footeronmousemove</name><required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footeronmouseout</name> <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footeronkeypress</name> <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footeronkeydown</name>  <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+        <attribute><name>footeronkeyup</name>    <required>false</required>
 <rtexprvalue>false</rtexprvalue></attribute>
+     </tag>
+
 </taglib>



Mime
View raw message