Author: sdzmitrovich
Date: 2008-10-15 09:16:40 -0400 (Wed, 15 Oct 2008)
New Revision: 10849
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml.xml
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/RichFacesColumnsTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2810
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 2008-10-15
10:25:57 UTC (rev 10848)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2008-10-15
13:16:40 UTC (rev 10849)
@@ -13,10 +13,12 @@
import java.util.List;
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.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -28,13 +30,13 @@
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
Element sourceElement = (Element)sourceNode;
- nsIDOMElement td = visualDocument.createElement("td");
+ nsIDOMElement td = visualDocument.createElement(HTML.TAG_TD);
if(isHeader(sourceElement)) {
- td.setAttribute("class", "dr-table-headercell
rich-table-headercell");
+ td.setAttribute(HTML.ATTR_CLASS, "dr-table-headercell
rich-table-headercell"); //$NON-NLS-1$
} else if(isFooter(sourceElement)) {
- td.setAttribute("class", "dr-table-footercell
rich-table-footercell");
+ td.setAttribute(HTML.ATTR_CLASS, "dr-table-footercell
rich-table-footercell"); //$NON-NLS-1$
} else {
- td.setAttribute("class", "dr-table-cell rich-table-cell");
+ td.setAttribute(HTML.ATTR_CLASS, "dr-table-cell rich-table-cell");
//$NON-NLS-1$
}
ComponentUtil.copyAttributes(sourceNode, td);
VpeCreationData creationData = new VpeCreationData(td);
@@ -51,11 +53,11 @@
}
private boolean isHeader(Element sourceElement) {
- return icludedInFacet(sourceElement, "header");
+ return icludedInFacet(sourceElement, RichFaces.NAME_FACET_HEADER);
}
private boolean isFooter(Element sourceElement) {
- return icludedInFacet(sourceElement, "footer");
+ return icludedInFacet(sourceElement, RichFaces.NAME_FACET_FOOTER);
}
private boolean icludedInFacet(Element sourceElement, String facetName) {
@@ -63,7 +65,7 @@
if(parent!=null) {
if(ComponentUtil.isFacet(parent, facetName)) {
return true;
- } else if (parent.getNodeName().endsWith(":columnGroup")) {
+ } else if (parent.getNodeName().endsWith(RichFaces.TAG_COLUMN_GROUP)) {
return ComponentUtil.isFacet(parent.getParentNode(), facetName);
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnsTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnsTemplate.java 2008-10-15
10:25:57 UTC (rev 10848)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnsTemplate.java 2008-10-15
13:16:40 UTC (rev 10849)
@@ -16,11 +16,11 @@
import java.util.List;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
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.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -36,7 +36,7 @@
public class RichFacesColumnsTemplate extends AbstractRichFacesTemplate {
/** The Constant DEFAULT_CLASSES. */
- private static final String DEFAULT_CLASSES = "dr-table-cell
rich-table-cell";
+ private static final String DEFAULT_CLASSES = "dr-table-cell
rich-table-cell"; //$NON-NLS-1$
/**
* Create.
@@ -54,7 +54,7 @@
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
final Element sourceElement = (Element) sourceNode;
- final nsIDOMElement td =
visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ final nsIDOMElement td = visualDocument.createElement(HTML.TAG_TD);
prepareData(sourceElement);
final VpeCreationData data = new VpeCreationData(td);
// Create mapping to Encode body
@@ -62,7 +62,7 @@
String clazz = DEFAULT_CLASSES;
if(ComponentUtil.isNotBlank(this.sourceStyleClass)){
- clazz = clazz+" "+this.sourceStyleClass;
+ clazz = clazz+Constants.WHITE_SPACE+this.sourceStyleClass;
}
if(ComponentUtil.isNotBlank(this.sourceWidth)){
td.setAttribute(RichFaces.ATTR_WIDTH, this.sourceWidth);
@@ -83,7 +83,7 @@
*/
private void prepareData(Element sourceElement) {
this.sourceStyleClass = ComponentUtil.getAttribute(sourceElement,
RichFaces.ATTR_STYLE_CLASS);
- this.sourceStyle = ComponentUtil.getAttribute(sourceElement, HTML.ATTR_STYLE);
+ this.sourceStyle = ComponentUtil.getAttribute(sourceElement,
RichFaces.ATTR_STYLE);
this.sourceWidth = ComponentUtil.getAttribute(sourceElement,
RichFaces.ATTR_WIDTH);
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java 2008-10-15
10:25:57 UTC (rev 10848)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java 2008-10-15
13:16:40 UTC (rev 10849)
@@ -15,9 +15,12 @@
import java.util.StringTokenizer;
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.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -36,68 +39,68 @@
initStyleClasses(sourceElement);
- nsIDOMElement table = visualDocument.createElement("table");
+ nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
ComponentUtil.copyAttributes(sourceNode, table);
VpeCreationData creationData = new VpeCreationData(table);
- ComponentUtil.setCSSLink(pageContext, "dataTable/dataTable.css",
"richFacesDataGrid");
- String tableClass = sourceElement.getAttribute("styleClass");
- table.setAttribute("class", "dr-table rich-table " +
(tableClass==null?"":tableClass));
+ ComponentUtil.setCSSLink(pageContext, "dataTable/dataTable.css",
"richFacesDataGrid"); //$NON-NLS-1$ //$NON-NLS-2$
+ String tableClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
+ table.setAttribute(HTML.ATTR_CLASS, "dr-table rich-table " +
(tableClass==null?Constants.EMPTY:tableClass)); //$NON-NLS-1$
// Encode colgroup definition.
int columnsLength = getColumnsCount(sourceElement);
- nsIDOMElement colgroup = visualDocument.createElement("colgroup");
- colgroup.setAttribute("span", String.valueOf(columnsLength));
+ nsIDOMElement colgroup = visualDocument.createElement(HTML.TAG_COLGROUP);
+ colgroup.setAttribute(HTML.ATTR_SPAN, String.valueOf(columnsLength));
table.appendChild(colgroup);
//Encode Caption
encodeCaption(creationData, sourceElement, visualDocument, table);
// Encode Header
- Element header = ComponentUtil.getFacet(sourceElement, "header");
+ Element header = ComponentUtil.getFacet(sourceElement, RichFaces.NAME_FACET_HEADER);
if(header!=null) {
- nsIDOMElement thead = visualDocument.createElement("thead");
+ nsIDOMElement thead = visualDocument.createElement(HTML.TAG_THEAD);
table.appendChild(thead);
- String headerClass = (String) sourceElement.getAttribute("headerClass");
+ String headerClass = (String)
sourceElement.getAttribute(RichFaces.ATTR_HEADER_CLASS);
encodeTableHeaderOrFooterFacet(creationData, thead, columnsLength, visualDocument,
header,
- "dr-table-header rich-table-header",
- "dr-table-header-continue rich-table-header-continue",
- "dr-table-headercell rich-table-headercell",
- headerClass, "td");
+ "dr-table-header rich-table-header", //$NON-NLS-1$
+ "dr-table-header-continue rich-table-header-continue", //$NON-NLS-1$
+ "dr-table-headercell rich-table-headercell", //$NON-NLS-1$
+ headerClass, HTML.TAG_TD);
}
// Encode Footer
- Element footer = ComponentUtil.getFacet(sourceElement, "footer");
+ Element footer = ComponentUtil.getFacet(sourceElement, RichFaces.NAME_FACET_FOOTER);
if (footer != null) {
- nsIDOMElement tfoot = visualDocument.createElement("tfoot");
+ nsIDOMElement tfoot = visualDocument.createElement(HTML.TAG_TFOOT);
table.appendChild(tfoot);
- String footerClass = (String) sourceElement.getAttribute("footerClass");
+ String footerClass = (String)
sourceElement.getAttribute(RichFaces.ATTR_FOOTER_CLASS);
encodeTableHeaderOrFooterFacet(creationData, tfoot, columnsLength, visualDocument,
footer,
- "dr-table-footer rich-table-footer",
- "dr-table-footer-continue rich-table-footer-continue",
- "dr-table-footercell rich-table-footercell",
- footerClass, "td");
+ "dr-table-footer rich-table-footer", //$NON-NLS-1$
+ "dr-table-footer-continue rich-table-footer-continue", //$NON-NLS-1$
+ "dr-table-footercell rich-table-footercell", //$NON-NLS-1$
+ footerClass, HTML.TAG_TD);
}
- nsIDOMElement tbody = visualDocument.createElement("tbody");
+ nsIDOMElement tbody = visualDocument.createElement(HTML.TAG_TBODY);
table.appendChild(tbody);
// Create mapping to Encode body
List<Node> children = ComponentUtil.getChildren(sourceElement);
- sourceElement.getAttribute("elements");
+ sourceElement.getAttribute(RichFaces.ATTR_ELEMENTS);
int elementsCount = getElementsCount(sourceElement, columnsLength);
if(columnsLength>0) {
int rowIndex = 0;
for(int elementIndex = 0; elementIndex<elementsCount; rowIndex++) {
- nsIDOMElement tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
tbody.appendChild(tr);
- tr.setAttribute("class", "dr-table-row rich-table-row " +
getRowClass(rowIndex));
+ tr.setAttribute(HTML.ATTR_CLASS, "dr-table-row rich-table-row " +
getRowClass(rowIndex)); //$NON-NLS-1$
for(int columnIndex = 0; columnIndex<columnsLength &&
elementIndex<elementsCount; columnIndex++) {
- nsIDOMElement td = visualDocument.createElement("td");
+ nsIDOMElement td = visualDocument.createElement(HTML.TAG_TD);
tr.appendChild(td);
- td.setAttribute("class", "dr-table-cell rich-table-cell " +
getColumnClass(columnIndex));
+ td.setAttribute(HTML.ATTR_CLASS, "dr-table-cell rich-table-cell " +
getColumnClass(columnIndex)); //$NON-NLS-1$
if(!children.isEmpty()) {
VpeChildrenInfo childInfo = new VpeChildrenInfo(td);
for (Node child : children) {
@@ -114,23 +117,23 @@
}
private void initStyleClasses(Element sourceElement) {
- String columnClassesString = sourceElement.getAttribute("columnClasses");
- String rowClassesString = sourceElement.getAttribute("rowClasses");
+ String columnClassesString =
sourceElement.getAttribute(RichFaces.ATTR_COLUMN_CLASSES);
+ String rowClassesString = sourceElement.getAttribute(RichFaces.ATTR_ROW_CLASSES);
columnClasses = parceClasses(columnClassesString);
rowClasses = parceClasses(rowClassesString);
}
private String[] parceClasses(String classes) {
if(classes==null) {
- return new String[]{""};
+ return new String[]{Constants.EMPTY};
}
ArrayList<String> list = new ArrayList<String>();
- StringTokenizer st = new StringTokenizer(classes, ",", false);
+ StringTokenizer st = new StringTokenizer(classes, Constants.COMMA, false);
while(st.hasMoreElements()) {
list.add((String)st.nextElement());
}
if(list.isEmpty()) {
- return new String[]{""};
+ return new String[]{Constants.EMPTY};
}
return (String[])list.toArray(new String[list.size()]);
}
@@ -147,7 +150,7 @@
int count = 0;
// check for exact value in component
try {
- int span = Integer.parseInt(sourceElement.getAttribute("columns"));
+ int span = Integer.parseInt(sourceElement.getAttribute(RichFaces.ATTR_COLUMNS));
count = span > 0 ? span : 0;
} catch (NumberFormatException e) {
// Ignore wrong formatted attribute
@@ -159,7 +162,7 @@
int elements = 0;
// check for exact value in component
try {
- int span = Integer.parseInt(sourceElement.getAttribute("elements"));
+ int span = Integer.parseInt(sourceElement.getAttribute(RichFaces.ATTR_ELEMENTS));
elements = span>0 ? span : columnCount * defaultRows;
} catch (NumberFormatException e) {
elements = columnCount * defaultRows;
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java 2008-10-15
10:25:57 UTC (rev 10848)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java 2008-10-15
13:16:40 UTC (rev 10849)
@@ -26,6 +26,7 @@
/** jsf tags which are used with richFaces. */
public static final String TAG_COLUMN = "column"; //$NON-NLS-1$
+ public static final String TAG_COLUMNS = "columns"; //$NON-NLS-1$
/** The Constant TAG_FACET. */
public static final String TAG_FACET = "facet"; //$NON-NLS-1$
public static final String TAG_COLUMN_GROUP = "columnGroup"; //$NON-NLS-1$
@@ -73,6 +74,7 @@
public static final String ATTR_CAPTION_CLASS = "captionClass"; //$NON-NLS-1$
public static final String ATTR_CAPTION_STYLE = "captionStyle"; //$NON-NLS-1$
public static final String ATTR_COLUMNS = "columns"; //$NON-NLS-1$
+ public static final String ATTR_ELEMENTS = "elements"; //$NON-NLS-1$
public static final String NAME_FACET_HEADER = "header"; //$NON-NLS-1$
public static final String NAME_FACET_FOOTER = "footer"; //$NON-NLS-1$
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml 2008-10-15
10:25:57 UTC (rev 10848)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml 2008-10-15
13:16:40 UTC (rev 10849)
@@ -7,7 +7,7 @@
<TBODY>
<TR CLASS="dr-table-row rich-table-row">
<TD CLASS="dr-table-cell rich-table-cell">
- <DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl rich-panel" >
<DIV CLASS="dr-pnl-h rich-panel-header"
STYLE="/background-image:
url\(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif\);/">
<SPAN> #{data.number}</SPAN>
@@ -18,7 +18,7 @@
</DIV>
</TD>
<TD CLASS="dr-table-cell rich-table-cell">
- <DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl rich-panel" >
<DIV CLASS="dr-pnl-h rich-panel-header"
STYLE="/background-image:
url\(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif\);/">
<SPAN> #{data.number}</SPAN>
@@ -31,23 +31,23 @@
</TR>
<TR CLASS="dr-table-row rich-table-row">
<TD CLASS="dr-table-cell rich-table-cell">
- <DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl rich-panel" >
<DIV CLASS="dr-pnl-h rich-panel-header"
STYLE="/background-image:
url\(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif\);/">
<SPAN> #{data.number}</SPAN>
</DIV>
- <DIV CLASS="dr-pnl-b rich-panel-body"
TITLE="rich:panel">
+ <DIV CLASS="dr-pnl-b rich-panel-body" >
<SPAN> #{data.field1}</SPAN>
</DIV>
</DIV>
</TD>
<TD CLASS="dr-table-cell rich-table-cell">
- <DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl rich-panel" >
<DIV CLASS="dr-pnl-h rich-panel-header"
STYLE="/background-image:
url\(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif\);/">
<SPAN> #{data.number}</SPAN>
</DIV>
- <DIV CLASS="dr-pnl-b rich-panel-body"
TITLE="rich:panel">
+ <DIV CLASS="dr-pnl-b rich-panel-body" >
<SPAN> #{data.field1}</SPAN>
</DIV>
</DIV>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml 2008-10-15
10:25:57 UTC (rev 10848)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml 2008-10-15
13:16:40 UTC (rev 10849)
@@ -9,9 +9,17 @@
<head>
</head>
<body>
- <!-- Data List -->
- <rich:dataList rows="5">
- <h:outputText value="testList" />
- </rich:dataList>
+<h1>dataList</h1>
+
+<rich:dataList var="data" value="#{bean.dtList}"
rows="4" id="dataList" >
+ <h:outputText value="field1:"></h:outputText>
+ <h:outputText value="#{data.field1} " />
+ <h:outputText value="field2:"></h:outputText>
+ <h:outputText value="#{data.field2} " />
+ <h:outputText value="field3:"></h:outputText>
+ <h:outputText value="#{data.field3}" />
+ <h:outputText value="number:"></h:outputText>
+ <h:outputText value="#{data.number}" />
+</rich:dataList>
</body>
</html>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml.xml 2008-10-15
13:16:40 UTC (rev 10849)
@@ -0,0 +1,17 @@
+<tests>
+ <test id="dataList">
+ <UL VAR="data" VALUE="#{bean.dtList}" ROWS="4"
ID="dataList"
+ CLASS="dr-list rich-datalist">
+ <LI CLASS="dr-list-item rich-list-item">
+ <SPAN> field1:</SPAN>
+ <SPAN > #{data.field1}</SPAN>
+ <SPAN> field2:</SPAN>
+ <SPAN> #{data.field2}</SPAN>
+ <SPAN> field3:</SPAN>
+ <SPAN> #{data.field3}</SPAN>
+ <SPAN> number:</SPAN>
+ <SPAN> #{data.number}</SPAN>
+ </LI>
+ </UL>
+ </test>
+</tests>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-15
10:25:57 UTC (rev 10848)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-15
13:16:40 UTC (rev 10849)
@@ -87,7 +87,7 @@
}
public void testDataList() throws Throwable {
- assertTrue("it is necessary to add a body of the test ",
false);//$NON-NLS-1$
+ performContentTest("components/dataList.xhtml");//$NON-NLS-1$
}
public void testDataOrderedList() throws Throwable {
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-10-15
10:25:57 UTC (rev 10848)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-10-15
13:16:40 UTC (rev 10849)
@@ -19,8 +19,10 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.VpeDebug;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Document;
@@ -77,6 +79,7 @@
TestUtil.waitForJobs();
+ TestUtil.delay(2000);
VpeController controller = getVpeController((JSPMultiPageEditor) editor);
// get xml test file
@@ -118,9 +121,9 @@
nsIDOMElement vpeElement = findElementById(controller, elementId);
assertNotNull(vpeElement);
- // DOMTreeDumper dumper = new DOMTreeDumper(
- // VpeDebug.VISUAL_DUMP_PRINT_HASH);
- // dumper.dumpToStream(System.out, vpeElement);
+ DOMTreeDumper dumper = new DOMTreeDumper(
+ VpeDebug.VISUAL_DUMP_PRINT_HASH);
+ dumper.dumpToStream(System.out, vpeElement);
// get test element by id - get <test id="..." > element and get his
// first child
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-10-15
10:25:57 UTC (rev 10848)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-10-15
13:16:40 UTC (rev 10849)
@@ -21,7 +21,6 @@
import org.jboss.tools.common.model.util.XMLUtil;
import org.jboss.tools.vpe.editor.util.Constants;
-import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMAttr;
import org.mozilla.interfaces.nsIDOMNamedNodeMap;
import org.mozilla.interfaces.nsIDOMNode;
@@ -122,17 +121,17 @@
throws ComparisonException {
if (!modelNode.getNodeName().equalsIgnoreCase(vpeNode.getNodeName())) {
- throw new ComparisonException("name of tag is \""
- + vpeNode.getNodeName() + "\"but must be \""
- + modelNode.getNodeName() + "\"");
+ throw new ComparisonException("name of tag is \"" //$NON-NLS-1$
+ + vpeNode.getNodeName() + "\"but must be \"" //$NON-NLS-1$
+ + modelNode.getNodeName() + "\""); //$NON-NLS-1$
}
if ((modelNode.getNodeValue() != null)
&& (!modelNode.getNodeValue().trim().equalsIgnoreCase(
vpeNode.getNodeValue().trim()))) {
- throw new ComparisonException("value of " + vpeNode.getNodeName()
- + " is \"" + vpeNode.getNodeValue().trim()
- + "\" but must be \"" + modelNode.getNodeValue().trim()
- + "\"");
+ throw new ComparisonException("value of " + vpeNode.getNodeName()
//$NON-NLS-1$
+ + " is \"" + vpeNode.getNodeValue().trim() //$NON-NLS-1$
+ + "\" but must be \"" + modelNode.getNodeValue().trim()
//$NON-NLS-1$
+ + "\""); //$NON-NLS-1$
}
// compare node's attributes
if (modelNode.getNodeType() == Node.ELEMENT_NODE) {
@@ -205,18 +204,22 @@
for (String illegalAttributeName : illegalAttributes) {
if (vpeAttributes.getNamedItem(illegalAttributeName.trim()) != null)
- throw new ComparisonException("illegal attribute :"
+ throw new ComparisonException("illegal attribute :" //$NON-NLS-1$
+ illegalAttributeName);
}
} else {
+
+ if (vpeAttributes.getNamedItem(
+ name) == null)
+ throw new ComparisonException("there is not : \"" + name
//$NON-NLS-1$
+ + "\" attribute"); //$NON-NLS-1$
+
nsIDOMAttr vpeAttr = (nsIDOMAttr) vpeAttributes.getNamedItem(
name).queryInterface(nsIDOMAttr.NS_IDOMATTR_IID);
- if (vpeAttr == null)
- throw new ComparisonException("there is not : \"" + name
- + "\" attribute");
+
// if (HTML.ATTR_STYLE.equalsIgnoreCase(name)) {
//
@@ -255,12 +258,10 @@
// }
//
// }
- else {
compareComplexStrings(modelAttr.getNodeValue().trim(),
vpeAttr.getNodeValue().trim());
- }
}
}
}
@@ -276,13 +277,13 @@
Matcher matcher = Pattern.compile(regex).matcher(vpeString);
if (!matcher.find()) {
- throw new ComparisonException("string is\"" + vpeString
- + "\" but pattern is \"" + regex + "\"");
+ throw new ComparisonException("string is\"" + vpeString //$NON-NLS-1$
+ + "\" but pattern is \"" + regex + "\"");
//$NON-NLS-1$ //$NON-NLS-2$
}
} else if (!modelString.equals(vpeString)) {
- throw new ComparisonException("string is\"" + vpeString
- + "\" but must be \"" + modelString + "\"");
+ throw new ComparisonException("string is\"" + vpeString //$NON-NLS-1$
+ + "\" but must be \"" + modelString + "\"");
//$NON-NLS-1$ //$NON-NLS-2$
}
}