Author: dsakovich
Date: 2007-09-13 08:01:04 -0400 (Thu, 13 Sep 2007)
New Revision: 3604
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-847 Add RichFaces scrollableDataTable template
resources
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java
===================================================================
---
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java 2007-09-13
11:32:11 UTC (rev 3603)
+++
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java 2007-09-13
12:01:04 UTC (rev 3604)
@@ -110,6 +110,9 @@
/** style */
public static final String HTML_STYLE_ATTR = "style";
+
+ /** scope */
+ public static final String HTML_SCOPE_ATTR = "scope";
/** HTML_TABLE_ATR_ */
public static final String HTML_BORDER_ATTR = "border";
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java
===================================================================
---
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java 2007-09-13
11:32:11 UTC (rev 3603)
+++
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java 2007-09-13
12:01:04 UTC (rev 3604)
@@ -355,7 +355,7 @@
td.setAttribute(HtmlComponentUtil.HTML_TABLE_COLSPAN, String
.valueOf(columns));
}
- td.setAttribute("scope", "colgroup");
+ td.setAttribute(HtmlComponentUtil.HTML_SCOPE_ATTR,
HtmlComponentUtil.HTML_TAG_COLGROUP);
VpeChildrenInfo child = new VpeChildrenInfo(td);
child.addSourceChild(facetBody);
@@ -529,7 +529,29 @@
nsIDOMNode visualNode, Object data, String name) {
nsIDOMElement visualElement = (nsIDOMElement) visualNode
.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- visualElement.removeAttribute(name);
+ if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_WIDTH_ATTR)) {
+ String style = visualElement
+ .getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
+ visualElement.removeAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
+ style += "; " + HtmlComponentUtil.HTML_WIDTH_ATTR + " : "
+ + DEFAULT_WIDTH + ";";
+ visualElement
+ .setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
+
+ } else
+
+ if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_HEIGHT_ATTR)) {
+ String style = visualElement
+ .getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
+ visualElement.removeAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
+ style += "; " + HtmlComponentUtil.HTML_HEIGHT_ATTR + " : "
+ + DEFAULT_HEIGHT + ";";
+ visualElement
+ .setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
+
+ } else {
+ visualElement.removeAttribute(name);
+ }
}
@Override