Author: yradtsevich
Date: 2008-10-23 13:50:00 -0400 (Thu, 23 Oct 2008)
New Revision: 11114
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnGroupTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java
Log:
Bug fix:
https://jira.jboss.org/jira/browse/JBIDE-2884 .
- Attributes "styleClass", "columnClasses", "rowClasses"
work now.
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnGroupTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnGroupTemplate.java 2008-10-23
17:04:02 UTC (rev 11113)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnGroupTemplate.java 2008-10-23
17:50:00 UTC (rev 11114)
@@ -7,40 +7,98 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
public class RichFacesColumnGroupTemplate extends RichFacesSubTableTemplate {
public static RichFacesColumnGroupTemplate DEFAULT_INSTANCE = new
RichFacesColumnGroupTemplate();
+ private static String styleClass;
public RichFacesColumnGroupTemplate() {
super();
}
+
+ /** @see RichFacesSubTableTemplate#encode(VpePageContext, VpeCreationData, Element,
nsIDOMDocument, nsIDOMElement) */
+ @Override
+ public VpeCreationData encode(VpePageContext pageContext,
+ VpeCreationData creationData, Element sourceElement,
+ nsIDOMDocument visualDocument, nsIDOMElement parentVisualNode) {
+ styleClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
+
+ return super.encode(pageContext, creationData, sourceElement, visualDocument,
+ parentVisualNode);
+ }
+
+
+ @Override
protected String getHeaderClass() {
return "dr-table-header rich-table-header";
}
+ @Override
protected String getHeaderContinueClass() {
return "dr-table-header-continue rich-table-header-continue";
}
+ @Override
protected String getFooterClass() {
return "dr-table-footer rich-table-footer";
}
+ @Override
protected String getFooterContinueClass() {
return "dr-table-footer-continue rich-table-footer-continue";
}
- protected String getCellClass() {
- return "dr-table-cell rich-table-cell";
- }
-
+ @Override
protected String getHeaderBackgoundImgStyle() {
return ComponentUtil.getHeaderBackgoundImgStyle();
}
-}
\ No newline at end of file
+
+ /** @see RichFacesSubTableTemplate#encodeFooter(VpePageContext, VpeCreationData,
Element, nsIDOMDocument, nsIDOMElement)*/
+ @Override
+ protected void encodeFooter(final VpePageContext pageContext,
+ final VpeCreationData creationData, final Element sourceElement,
+ final nsIDOMDocument visualDocument, final nsIDOMElement parentVisualNode) {
+ // do nothing, because the tag do not support footers
+ }
+
+ /** @see RichFacesSubTableTemplate#encodeHeader(VpePageContext, VpeCreationData,
Element, nsIDOMDocument, nsIDOMElement) */
+ @Override
+ protected void encodeHeader(final VpePageContext pageContext,
+ final VpeCreationData creationData, final Element sourceElement,
+ final nsIDOMDocument visualDocument, final nsIDOMElement parentVisualNode) {
+ // do nothing, because the tag do not support headers
+ }
+
+ /** @see RichFacesSubTableTemplate#encodeHeaderOrFooter(VpePageContext, VpeCreationData,
Element, nsIDOMDocument, nsIDOMElement, String, String, String) */
+ @Override
+ protected void encodeHeaderOrFooter(final VpePageContext pageContext,
+ final VpeCreationData creationData, final Element sourceElement,
+ final nsIDOMDocument visualDocument, final nsIDOMElement parentVisualNode,
+ final String facetName, final String trClass, final String tdClass) {
+ // do nothing, because the tag do not support headers and footers
+ }
+
+ /** @see RichFacesSubTableTemplate#getRowClass(int) */
+ @Override
+ protected String getRowClass(int row) {
+ String rowClass = super.getRowClass(row);
+ if (styleClass != null) {
+ rowClass += ' ' + styleClass;
+ }
+ return rowClass;
+ }
+
+}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2008-10-23
17:04:02 UTC (rev 11113)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2008-10-23
17:50:00 UTC (rev 11114)
@@ -366,7 +366,9 @@
List<Node> children = ComponentUtil.getChildren(sourceElement);
if (children != null) {
for (Node child : children) {
- if (child.getNodeName().endsWith(RichFaces.TAG_SUB_TABLE)) {
+ if (child.getNodeName().endsWith(RichFaces.TAG_COLUMN_GROUP)) {
+ RichFacesColumnGroupTemplate.DEFAULT_INSTANCE.validate(pageContext, child,
visualDocument, data);
+ } else if (child.getNodeName().endsWith(RichFaces.TAG_SUB_TABLE)) {
RichFacesSubTableTemplate.DEFAULT_INSTANCE.validate(pageContext, child,
visualDocument, data);
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java 2008-10-23
17:04:02 UTC (rev 11113)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java 2008-10-23
17:50:00 UTC (rev 11114)
@@ -242,7 +242,7 @@
return "dr-subtable-footer-continue rich-subtable-footer-continue";
}
- private String getRowClass(final int row) {
+ protected String getRowClass(final int row) {
StringBuffer rowClass = new StringBuffer(DEAFAULT_CELL_CLASS);
if (rowClasses != null) {