Author: mareshkau
Date: 2007-11-02 15:58:46 -0400 (Fri, 02 Nov 2007)
New Revision: 4675
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1213, rich:dataTable was adjusted(was added
support of h:column, not only rich:column, and was added possability to show text, from
it's node)
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2007-11-02
19:53:15 UTC (rev 4674)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2007-11-02
19:58:46 UTC (rev 4675)
@@ -48,7 +48,7 @@
NodeList children = sourceElement.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node node = children.item(i);
- if (node instanceof Element && "f:facet".equals(node.getNodeName()))
{
+ if (node instanceof Element && node.getNodeName()!=null &&
node.getNodeName().indexOf(":facet")>0) {
Element element = (Element) node;
String name = element.getAttribute("name");
if (facetName.equals(name)) {
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2007-11-02
19:53:15 UTC (rev 4674)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2007-11-02
19:58:46 UTC (rev 4675)
@@ -41,7 +41,7 @@
// Create mapping to Encode body
VpeChildrenInfo tdInfo = new VpeChildrenInfo(td);
- List<Node> children = ComponentUtil.getChildren(sourceElement);
+ List<Node> children = ComponentUtil.getChildren(sourceElement,true);
for (Node child : children) {
tdInfo.addSourceChild(child);
}
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 2007-11-02
19:53:15 UTC (rev 4674)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2007-11-02
19:58:46 UTC (rev 4675)
@@ -62,7 +62,7 @@
encodeCaption(creationData, sourceElement, visualDocument, table);
// Encode Header
- Element header = ComponentUtil.getFacet(sourceElement, "header");
+ Node header = ComponentUtil.getFacet((Element)sourceElement, "header",true);
ArrayList<Element> columnsHeaders = getColumnsWithFacet(columns,
"header");
if(header!=null || !columnsHeaders.isEmpty()) {
nsIDOMElement thead = visualDocument.createElement("thead");
@@ -141,7 +141,8 @@
tbody.appendChild(tr);
creationData.addChildrenInfo(trInfo);
}
- trInfo.addSourceChild(child);
+ trInfo.addSourceChild(child);
+
} else if(child.getNodeName().endsWith(":columnGroup")) {
RichFacesColumnGroupTemplate.DEFAULT_INSTANCE.encode(creationData, (Element)child,
visualDocument, tbody);
tr = null;
@@ -198,7 +199,7 @@
if(colspan!=null && colspan.length()>0) {
td.setAttribute("colspan", colspan);
}
- Element facetBody = ComponentUtil.getFacet(column, facetName);
+ Node facetBody = ComponentUtil.getFacet(column, facetName,true);
VpeChildrenInfo child = new VpeChildrenInfo(td);
child.addSourceChild(facetBody);
@@ -206,13 +207,13 @@
}
}
- protected void encodeTableHeaderOrFooterFacet(VpeCreationData creationData,
nsIDOMElement parentTheadOrTfood, int columns, nsIDOMDocument visualDocument, Element
facetBody, String skinFirstRowClass, String skinRowClass, String skinCellClass, String
facetBodyClass, String element) {
+ protected void encodeTableHeaderOrFooterFacet(VpeCreationData creationData,
nsIDOMElement parentTheadOrTfood, int columns, nsIDOMDocument visualDocument, Node
facetBody, String skinFirstRowClass, String skinRowClass, String skinCellClass, String
facetBodyClass, String element) {
boolean isColumnGroup = facetBody.getNodeName().endsWith(":columnGroup");
boolean isSubTable = facetBody.getNodeName().endsWith(":subTable");
if(isColumnGroup) {
- RichFacesColumnGroupTemplate.DEFAULT_INSTANCE.encode(creationData, facetBody,
visualDocument, parentTheadOrTfood);
+ RichFacesColumnGroupTemplate.DEFAULT_INSTANCE.encode(creationData, (Element)facetBody,
visualDocument, parentTheadOrTfood);
} else if(isSubTable) {
- RichFacesSubTableTemplate.DEFAULT_INSTANCE.encode(creationData, facetBody,
visualDocument, parentTheadOrTfood);
+ RichFacesSubTableTemplate.DEFAULT_INSTANCE.encode(creationData, (Element)facetBody,
visualDocument, parentTheadOrTfood);
} else {
nsIDOMElement tr = visualDocument.createElement("tr");
parentTheadOrTfood.appendChild(tr);
@@ -243,7 +244,7 @@
}
}
- public static ArrayList<Element> getColumns(Element parentSourceElement) {
+ public static ArrayList<Element> getColumns(Node parentSourceElement) {
ArrayList<Element> columns = new ArrayList<Element>();
NodeList children = parentSourceElement.getChildNodes();
for(int i=0; i<children.getLength(); i++) {
@@ -258,7 +259,7 @@
public static ArrayList<Element> getColumnsWithFacet(ArrayList<Element>
columns, String facetName) {
ArrayList<Element> columnsWithFacet = new ArrayList<Element>();
for (Element column : columns) {
- Element body = ComponentUtil.getFacet(column, facetName);
+ Node body = ComponentUtil.getFacet(column, facetName,true);
if(body!=null) {
columnsWithFacet.add(column);
}