Author: yradtsevich
Date: 2010-11-09 08:06:17 -0500 (Tue, 09 Nov 2010)
New Revision: 26360
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml.xml
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/VpeSpringUtil.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFMediaOutput.java
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/RichFacesDataDefinitionListTemplate.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/RichFacesDataTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java
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/templates/vpe-templates-richfaces.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java
Log:
https://jira.jboss.org/browse/JBIDE-7449: Vpe templates for rich iteration.
- created rich:list template
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFMediaOutput.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFMediaOutput.java 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFMediaOutput.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -58,7 +58,7 @@
mainTag.setAttribute(uriAttribute, "file:///" +
getAbsoluteResourcePath(IMG_PATH).replace('\\', '/')); //$NON-NLS-1$
- VisualDomUtil.copyAttributes(sourceElement, SAME_ATTRIBUTES_LIST, mainTag);
+ VisualDomUtil.copyAttributes(sourceElement, mainTag, SAME_ATTRIBUTES_LIST);
if (sourceElement.hasAttribute(Ajax4JSF.ATTR_STYLE_CLASS)) {
String styleClass = sourceElement.getAttribute(Ajax4JSF.ATTR_STYLE_CLASS);
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 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -974,7 +974,7 @@
*/
public static Node getFacetBody(VpePageContext pageContext,
Element sourceElement, String facetName) {
- Element facet = SourceDomUtil.getFacetByName(sourceElement, facetName);
+ Element facet = SourceDomUtil.getFacetByName(pageContext, sourceElement, facetName);
Map<String, List<Node>> facetChildren = VisualDomUtil
.findFacetElements(facet, pageContext);
return getFacetBody(facetChildren);
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 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -52,10 +52,10 @@
td.setAttribute(HTML.ATTR_CLASS, columnClass);
final VpeCreationData creationData = new VpeCreationData(td);
- Element headerFacet = SourceDomUtil.getFacetByName(sourceElement,
- RichFaces.NAME_FACET_HEADER);
- Element footerFacet = SourceDomUtil.getFacetByName(sourceElement,
- RichFaces.NAME_FACET_FOOTER);
+ Element headerFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_HEADER);
+ Element footerFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_FOOTER);
Map<String, List<Node>> headerFacetChildren = VisualDomUtil
.findFacetElements(headerFacet, pageContext);
Map<String, List<Node>> footerFacetChildren = VisualDomUtil
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -75,8 +75,8 @@
ComponentUtil.correctAttribute((Element)sourceNode, listElement,
RichFaces.ATTR_STYLE_CLASS, HTML.ATTR_CLASS, null, "listClass");
//$NON-NLS-1$
- Element termFacet = SourceDomUtil.getFacetByName(sourceElement,
- RichFaces.NAME_FACET_TERM);
+ Element termFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_TERM);
Map<String, List<Node>> termFacetChildren = VisualDomUtil
.findFacetElements(termFacet, pageContext);
Node termNode= ComponentUtil.getFacetBody(termFacetChildren);
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 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -73,7 +73,8 @@
/*
* Encode Caption
*/
- Element caption = SourceDomUtil.getFacetByName(sourceElement,
RichFaces.NAME_FACET_CAPTION);
+ Element caption = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_CAPTION);
Map<String, List<Node>> captionFacetChildren =
VisualDomUtil.findFacetElements(caption, pageContext);
Node captionBody = ComponentUtil.getFacetBody(captionFacetChildren);
encodeCaption(pageContext, creationData, sourceElement, visualDocument, table,
captionBody);
@@ -81,7 +82,8 @@
/*
* Encode Header
*/
- Element header = SourceDomUtil.getFacetByName(sourceElement,
RichFaces.NAME_FACET_HEADER);
+ Element header = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_HEADER);
Map<String, List<Node>> headerFacetChildren =
VisualDomUtil.findFacetElements(header, pageContext);
Node headerBody = ComponentUtil.getFacetBody(headerFacetChildren);
if (headerBody != null) {
@@ -98,7 +100,8 @@
/*
* Encode Footer
*/
- Element footer = SourceDomUtil.getFacetByName(sourceElement,
RichFaces.NAME_FACET_FOOTER);
+ Element footer = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_FOOTER);
Map<String, List<Node>> footerFacetChildren =
VisualDomUtil.findFacetElements(footer, pageContext);
Node footerBody = ComponentUtil.getFacetBody(footerFacetChildren);
if (footerBody != null) {
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 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -71,7 +71,8 @@
/*
* Encode Caption
*/
- Element caption = SourceDomUtil.getFacetByName(sourceElement,
RichFaces.NAME_FACET_CAPTION);
+ Element caption = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_CAPTION);
Map<String, List<Node>> captionFacetChildren =
VisualDomUtil.findFacetElements(caption, pageContext);
Node captionNode= null;
if (captionFacetChildren.get(VisualDomUtil.FACET_JSF_TAG).size() > 0) {
@@ -82,7 +83,8 @@
/*
* Encode Header
*/
- Element header = SourceDomUtil.getFacetByName(sourceElement,
RichFaces.NAME_FACET_HEADER);
+ Element header = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_HEADER);
Map<String, List<Node>> headerFacetChildren =
VisualDomUtil.findFacetElements(header, pageContext);
boolean headerJsfElementPresents =
headerFacetChildren.get(VisualDomUtil.FACET_JSF_TAG).size() > 0;
boolean hasColumnWithHeader = hasColumnWithFacet(columns,
RichFaces.NAME_FACET_HEADER);
@@ -116,7 +118,8 @@
/*
* Encode Footer
*/
- Element footer = SourceDomUtil.getFacetByName(sourceElement,
RichFaces.NAME_FACET_FOOTER);
+ Element footer = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_FOOTER);
Map<String, List<Node>> footerFacetChildren =
VisualDomUtil.findFacetElements(footer, pageContext);
boolean footerJsfElementPresents =
footerFacetChildren.get(VisualDomUtil.FACET_JSF_TAG).size() > 0;
boolean hasColumnWithFooter = hasColumnWithFacet(columns,
RichFaces.NAME_FACET_FOOTER);
@@ -192,7 +195,8 @@
String element) {
for (Element column : headersOrFooters) {
- Element facet = SourceDomUtil.getFacetByName(column, facetName);
+ Element facet = SourceDomUtil.getFacetByName(pageContext,
+ column, facetName);
/*
* If facet is null unwanted cells might be added.
* Thus do not add TD for such facets.
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListTemplate.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListTemplate.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+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.Constants;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.SourceDomUtil;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Template for rich:list.
+ *
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class RichFacesListTemplate extends VpeAbstractTemplate {
+
+ private static final String TYPE_DEFINITIONS = "definitions"; //$NON-NLS-1$
+ private static final String TYPE_ORDERED = "ordered"; //$NON-NLS-1$
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ Element sourceElement = (Element) sourceNode;
+
+ String firstRowClass = getFirstRowClass(sourceElement);
+
+ nsIDOMElement outerContainer;
+ nsIDOMElement innerContainer;
+ VpeChildrenInfo termInfo = null;
+ String type = sourceElement.getAttribute(RichFaces.ATTR_TYPE);
+ if (TYPE_ORDERED.equals(type)) {
+ outerContainer = visualDocument.createElement(HTML.TAG_OL);
+ innerContainer = visualDocument.createElement(HTML.TAG_LI);
+ } else if (TYPE_DEFINITIONS.equals(type)) {
+ outerContainer = visualDocument.createElement(HTML.TAG_DL);
+
+ nsIDOMElement termContainer = visualDocument.createElement(HTML.TAG_DT);
+ termContainer.setAttribute(HTML.ATTR_CLASS, firstRowClass);
+ outerContainer.appendChild(termContainer);
+ Element termElement = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_TERM);
+ termInfo = new VpeChildrenInfo(termContainer);
+ termInfo.addSourceChild(termElement);
+
+ innerContainer = visualDocument.createElement(HTML.TAG_DD);
+ } else { // "unordered" by default
+ outerContainer = visualDocument.createElement(HTML.TAG_UL);
+ innerContainer = visualDocument.createElement(HTML.TAG_LI);
+ }
+
+ VisualDomUtil.copyAttribute(sourceElement, RichFaces.ATTR_STYLE,
+ outerContainer, HTML.ATTR_STYLE);
+ VisualDomUtil.copyAttribute(sourceElement, RichFaces.ATTR_STYLE_CLASS,
+ outerContainer, HTML.ATTR_CLASS);
+ innerContainer.setAttribute(HTML.ATTR_CLASS, firstRowClass);
+
+ outerContainer.appendChild(innerContainer);
+
+ VpeCreationData creationData = new VpeCreationData(outerContainer);
+ if (termInfo != null) {
+ creationData.addChildrenInfo(termInfo);
+ }
+
+ NodeList childNodes = sourceElement.getChildNodes();
+ VpeChildrenInfo nonFacetChildrenInfo = new VpeChildrenInfo(innerContainer);
+ for (int i = 0; i < childNodes.getLength(); i++) {
+ Node childNode = childNodes.item(i);
+ if (!SourceDomUtil.isFacetElement(pageContext, childNode)) {
+ nonFacetChildrenInfo.addSourceChild(childNode);
+ }
+ }
+ creationData.addChildrenInfo(nonFacetChildrenInfo);
+
+ return creationData;
+ }
+
+ private String getFirstRowClass(Element sourceElement) {
+ StringBuilder firstRowClass = new StringBuilder();
+
+ if (sourceElement.hasAttribute(RichFaces.ATTR_ROW_CLASSES)) {
+ String rowClasses = sourceElement.getAttribute(RichFaces.ATTR_ROW_CLASSES);
+ int commaIndex = rowClasses.indexOf(Constants.COMMA);
+ if (commaIndex >= 0) {
+ firstRowClass.append(rowClasses.substring(0, commaIndex));
+ } else {
+ firstRowClass.append(rowClasses);
+ }
+ firstRowClass.append(Constants.WHITE_SPACE);
+ }
+ if (sourceElement.hasAttribute(RichFaces.ATTR_ROW_CLASS)) {
+ firstRowClass.append(sourceElement.getAttribute(RichFaces.ATTR_ROW_CLASS));
+ }
+
+ return firstRowClass.toString();
+ }
+}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -172,7 +172,8 @@
td.setAttribute(HTML.ATTR_CLASS, tdClass);
td.setAttribute(HTML.ATTR_STYLE, tdStyle);
- Element labelFacet = SourceDomUtil.getFacetByName(sourceElement,
RichFaces.NAME_FACET_LABEL);
+ Element labelFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_LABEL);
Map<String, List<Node>> labelFacetChildren =
VisualDomUtil.findFacetElements(labelFacet, pageContext);
boolean labelFacetHtmlChildrenPresent = labelFacetChildren
.get(VisualDomUtil.FACET_HTML_TAGS).size() > 0;
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -58,7 +58,8 @@
* Find elements from the f:facet
*/
Map<String, List<Node>> headerFacetChildren = null;
- Element headerFacet = SourceDomUtil.getFacetByName(sourceElement,
RichFaces.NAME_FACET_HEADER);
+ Element headerFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_HEADER);
if (headerFacet != null) {
headerFacetChildren = VisualDomUtil.findFacetElements(headerFacet, pageContext);
nsIDOMElement headerDiv = visualDocument.createElement(HTML.TAG_DIV);
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -93,12 +93,14 @@
* or supplementary HTML tags from facets
* then progress bar has more divs than usual.
*/
- Element initialFacet = SourceDomUtil.getFacetByName(sourceElement,
"initial"); //$NON-NLS-1$
+ Element initialFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, "initial"); //$NON-NLS-1$
Map<String, List<Node>> initialFacetChildren =
VisualDomUtil.findFacetElements(initialFacet, pageContext);
boolean initialFacetHtmlChildrenPresent = initialFacetChildren
.get(VisualDomUtil.FACET_HTML_TAGS).size() > 0;
- Element completeFacet = SourceDomUtil.getFacetByName(sourceElement,
"complete"); //$NON-NLS-1$
+ Element completeFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, "complete"); //$NON-NLS-1$
Map<String, List<Node>> completeFacetChildren =
VisualDomUtil.findFacetElements(completeFacet, pageContext);
boolean completeFacetHtmlChildrenPresent = completeFacetChildren
.get(VisualDomUtil.FACET_HTML_TAGS).size() > 0;
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -97,7 +97,8 @@
* Find elements from the f:facet
*/
Map<String, List<Node>> headerFacetChildren = null;
- Element headerFacet = SourceDomUtil.getFacetByName(sourceElement,
RichFaces.NAME_FACET_HEADER);
+ Element headerFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_HEADER);
if (headerFacet != null) {
headerFacetChildren = VisualDomUtil.findFacetElements(headerFacet, pageContext);
/*
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -121,7 +121,8 @@
+ STYLE_SEMICOLUMN + contentStyle);
Map<String, List<Node>> labelFacetChildren = null;
- Element labelFacet = SourceDomUtil.getFacetByName(sourceElement,
RichFaces.NAME_FACET_LABEL);
+ Element labelFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_LABEL);
if (null != labelFacet) {
labelFacetChildren = VisualDomUtil.findFacetElements(labelFacet, pageContext);
}
@@ -290,7 +291,8 @@
* Encode the Label Facet
* Find elements from the f:facet
*/
- Element labelFacet = SourceDomUtil.getFacetByName(sourceElement,
RichFaces.NAME_FACET_LABEL);
+ Element labelFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_LABEL);
if (null != labelFacet) {
/*
* By adding attribute VPE-FACET to this visual node
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 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -60,6 +60,7 @@
public static final String ATTR_NAME = "name"; //$NON-NLS-1$
public static final String ATTR_POPUP = "popup";//$NON-NLS-1$
public static final String ATTR_ROWS = "rows"; //$NON-NLS-1$
+ public static final String ATTR_ROW_CLASS = "rowClass"; //$NON-NLS-1$
public static final String ATTR_ROW_CLASSES = "rowClasses"; //$NON-NLS-1$
public static final String ATTR_SELECT_ITEM_LABEL = "itemLabel";
//$NON-NLS-1$
public static final String ATTR_SELECT_ITEM_VALUE = "itemValue";
//$NON-NLS-1$showButton
@@ -70,6 +71,7 @@
public static final String ATTR_SORTABLE = "sortable"; //$NON-NLS-1$
public static final String ATTR_STYLE = "style"; //$NON-NLS-1$
public static final String ATTR_STYLE_CLASS = "styleClass"; //$NON-NLS-1$
+ public static final String ATTR_TYPE = "type"; //$NON-NLS-1$
public static final String ATTR_VALUE = "value"; //$NON-NLS-1$
public static final String ATTR_VISIBLE = "visible"; //$NON-NLS-1$
public static final String ATTR_WIDTH = "width"; //$NON-NLS-1$
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2010-11-09
13:06:17 UTC (rev 26360)
@@ -883,7 +883,16 @@
<vpe:drop container="no"/>
</vpe:dnd>
</vpe:template>
- </vpe:tag>
+ </vpe:tag>
+ <vpe:tag name="rich:list" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesListTemplate">
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="yes"/>
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
<vpe:tag name="rich:clientId" case-sensitive="yes">
<vpe:template children="no" modify="no">
</vpe:template>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml 2010-11-09
13:06:17 UTC (rev 26360)
@@ -0,0 +1,68 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:rich="http://richfaces.org/rich">
+ <style>
+ .gray-background {
+ background-color: gray;
+ }
+ .red-background {
+ background-color: red;
+ border: 5px solid red;
+ }
+ .bold-weight {
+ font-weight: bold;
+ }
+ .italic-style {
+ font-style: italic;
+ }
+ </style>
+
+ <p><b>rich:list, default type:</b></p>
+ <rich:list id="default" value="#{carsBean.inventoryVendorLists}"
id="list"
+ var="vendorList" styleClass="red-background"
style="background-color:white"
+ rowClass="gray-background" rowClasses="italic-style,
bold-weight">
+ <h:outputText value="#{vendorList.vendor}" />
+ </rich:list>
+
+ <p><b>rich:list type="ordered"</b></p>
+ <rich:list id="ordered" value="#{carsBean.inventoryVendorLists}"
id="list"
+ var="vendorList" type="ordered"
styleClass="red-background" style="background-color:white"
+ rowClass="gray-background" rowClasses="italic-style,
bold-weight">
+ <f:facet name="term">
+ <h:panelGroup layout="block">
+ <h:outputText value="In stock: #{vendorList.count}"
+ style="font-weight:bold" />
+ </h:panelGroup>
+ </f:facet>
+ <h:outputText value="#{vendorList.vendor}" />
+ </rich:list>
+
+ <p><b>rich:list type="unordered"</b></p>
+ <rich:list id="unordered"
value="#{carsBean.inventoryVendorLists}" id="list"
+ var="vendorList" type="unordered"
styleClass="red-background" style="background-color:white"
+ rowClass="gray-background" rowClasses="italic-style,
bold-weight">
+ <f:facet name="term">
+ <h:panelGroup layout="block">
+ <h:outputText value="In stock: #{vendorList.count}"
+ style="font-weight:bold" />
+ </h:panelGroup>
+ </f:facet>
+ <h:outputText value="#{vendorList.vendor}" />
+ </rich:list>
+
+ <p><b>rich:list type="definitions"</b></p>
+ <rich:list id="definitions"
value="#{carsBean.inventoryVendorLists}" id="list"
+ var="vendorList" type="definitions"
styleClass="red-background" style="background-color:white"
+ rowClass="gray-background" rowClasses="italic-style,
bold-weight">
+ <f:facet name="term">
+ <h:panelGroup layout="block">
+ <h:outputText value="In stock: #{vendorList.count}"
+ style="font-weight:bold" />
+ </h:panelGroup>
+ </f:facet>
+ <h:outputText value="#{vendorList.vendor}" />
+ </rich:list>
+</ui:composition>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml.xml 2010-11-09
13:06:17 UTC (rev 26360)
@@ -0,0 +1,47 @@
+<tests>
+ <test id="default">
+ <UL STYLE="background-color: white;" CLASS="red-background">
+ <LI CLASS="italic-style gray-background">
+ <SPAN CLASS="vpe-text">
+ #{vendorList.vendor}
+ </SPAN>
+ </LI>
+ </UL>
+ </test>
+ <test id="ordered">
+ <OL STYLE="background-color: white;" CLASS="red-background">
+ <LI CLASS="italic-style gray-background">
+ <SPAN CLASS="vpe-text">
+ #{vendorList.vendor}
+ </SPAN>
+ </LI>
+ </OL>
+ </test>
+ <test id="unordered">
+ <UL STYLE="background-color: white;" CLASS="red-background">
+ <LI CLASS="italic-style gray-background">
+ <SPAN CLASS="vpe-text">
+ #{vendorList.vendor}
+ </SPAN>
+ </LI>
+ </UL>
+ </test>
+ <test id="definitions">
+ <DL STYLE="background-color: white;" CLASS="red-background">
+ <DT CLASS="italic-style gray-background">
+ <SPAN>
+ <DIV STYLE="-moz-user-modify: read-write;">
+ <SPAN STYLE="font-weight: bold;">
+ In stock: #{vendorList.count}
+ </SPAN>
+ </DIV>
+ </SPAN>
+ </DT>
+ <DD CLASS="italic-style gray-background">
+ <SPAN CLASS="vpe-text">
+ #{vendorList.vendor}
+ </SPAN>
+ </DD>
+ </DL>
+ </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 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -213,6 +213,10 @@
performInvisibleTagTest("components/jQuery.xhtml", "jQuery");
//$NON-NLS-1$ //$NON-NLS-2$
}
+ public void testList() throws Throwable {
+ performContentTest("components/list.xhtml");//$NON-NLS-1$
+ }
+
public void testListShuttle() throws Throwable {
performContentTest("components/listShuttle.xhtml");//$NON-NLS-1$
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -95,21 +95,33 @@
return result;
}
- public static Element getFacetByName(Element sourceElement, String facetName) {
+ public static Element getFacetByName(VpePageContext pageContext,
+ Element sourceElement, String facetName) {
+ if (facetName == null) {
+ return null;
+ }
+
Element facetElement = null;
NodeList children = sourceElement.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- if ((facetName != null)
- && (node instanceof Element)
- && (node.getNodeName() != null)
- && (node.getNodeName().indexOf(":facet") > 0) //$NON-NLS-1$
- && (facetName.equalsIgnoreCase((((Element)
node)).getAttribute("name")))) { //$NON-NLS-1$
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ if (isFacetElement(pageContext, node)
+ && facetName.equalsIgnoreCase( ((Element)
node).getAttribute("name") )) { //$NON-NLS-1$
facetElement = (Element) node;
- }
- }
- return facetElement;
+ }
+ }
+ return facetElement;
}
+
+ public static boolean isFacetElement(VpePageContext pageContext, Node node) {
+ if (node instanceof Element) {
+ String templateName = VpeTemplateManager.getInstance()
+ .getTemplateName(pageContext, node);
+ return "f:facet".equals(templateName);
+ } else {
+ return false;
+ }
+ }
/**
* Returns a XPath expression given a DOM Node.
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-2010 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
* and is available at
http://www.eclipse.org/legal/epl-v10.html
*
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.vpe.editor.util;
@@ -17,6 +17,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.swt.graphics.Point;
@@ -215,27 +216,51 @@
}
}
}
+
+ /**
+ * Copies all attributes from source node to visual node.
+ *
+ * @param sourceElement the source element
+ * @param sourceAttrName the name of source attribute
+ * @param visualElement the visual element
+ * @param visualAttrName the resulting name of visual attribute
+ */
+ public static void copyAttribute(Element sourceElement, String sourceAttrName,
+ nsIDOMElement visualElement, String visualAttrName) {
+ if (sourceElement.hasAttribute(sourceAttrName)) {
+ String attrValue = sourceElement.getAttribute(sourceAttrName);
+ visualElement.setAttribute(visualAttrName, attrValue);
+ }
+ }
/**
* Copies all attributes from source node to visual node.
*
* @param sourceElement the source element
+ * @param visualElement the visual element
* @param attributes list names of attributes which will copy
- * @param visualElement the visual element
*/
- public static void copyAttributes(Element sourceElement, List<String> attributes,
nsIDOMElement visualElement) {
-
- if (attributes == null)
- return;
-
+ public static void copyAttributes(Element sourceElement, nsIDOMElement visualElement,
List<String> attributes) {
for (String attributeName : attributes) {
- if (sourceElement.hasAttribute(attributeName)) {
- String attributeValue = sourceElement.getAttribute(attributeName);
- visualElement.setAttribute(attributeName, attributeValue);
- }
+ copyAttribute(sourceElement, attributeName, visualElement, attributeName);
}
-
}
+
+ /**
+ * Copies all attributes from source node to visual node.
+ *
+ * @param sourceElement the source element
+ * @param visualElement the visual element
+ * @param sourceToVisualMap mapping for attributes' names.
+ */
+ public static void copyAttributes(Element sourceElement,
+ nsIDOMElement visualElement, Map<String, String> sourceToVisualMap) {
+ for (Entry<String, String> sourceToVisual : sourceToVisualMap.entrySet()) {
+ String sourceAttrName = sourceToVisual.getKey();
+ String visualAttrName = sourceToVisual.getValue();
+ copyAttribute(sourceElement, sourceAttrName, visualElement, visualAttrName);
+ }
+ }
/**
* Returns instance of {@link nsIAccessibilityService}.
@@ -555,5 +580,4 @@
}
return false;
}
-
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -10,12 +10,15 @@
******************************************************************************/
package org.jboss.tools.vpe.spring.template;
+import java.util.HashMap;
+import java.util.Map;
+
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.jboss.tools.vpe.spring.template.util.Spring;
-import org.jboss.tools.vpe.spring.template.util.VpeSpringUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
@@ -28,6 +31,13 @@
* @see <a
href="http://static.springsource.org/spring/docs/3.0.x/spring-framew...
select tag</>
*/
public class SpringFormSelectTemplate extends VpeAbstractTemplate {
+ public static final Map<String, String> COMMON_SPRING_FORM_ATTRIBUTES_MAP
+ = new HashMap<String, String>() {{
+ put(Spring.ATTR_ID, HTML.ATTR_ID);
+ put(Spring.ATTR_CSS_STYLE, HTML.ATTR_STYLE);
+ put(Spring.ATTR_CSS_CLASS, HTML.ATTR_CLASS);
+ put(HTML.ATTR_SIZE, HTML.ATTR_SIZE);
+ }};
/* (non-Javadoc)
* @see
org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext,
org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
@@ -37,10 +47,9 @@
Element sourceElement = (Element) sourceNode;
nsIDOMElement select = visualDocument.createElement(HTML.TAG_SELECT);
- VpeSpringUtil.copyCommonAttributes(sourceElement, select);
- VpeSpringUtil.copyAttribute(sourceElement, HTML.ATTR_SIZE,
- select, HTML.ATTR_SIZE);
+ VisualDomUtil.copyAttributes(sourceElement, select,
COMMON_SPRING_FORM_ATTRIBUTES_MAP);
+
if (Spring.VALUE_TRUE.equals(sourceElement.getAttribute(Spring.ATTR_DISABLED))) {
select.setAttribute(HTML.ATTR_DISABLED, HTML.ATTR_DISABLED);
}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/VpeSpringUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/VpeSpringUtil.java 2010-11-09
12:56:31 UTC (rev 26359)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/VpeSpringUtil.java 2010-11-09
13:06:17 UTC (rev 26360)
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.spring.template.util;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.jboss.tools.vpe.editor.util.HTML;
-import org.mozilla.interfaces.nsIDOMElement;
-import org.w3c.dom.Element;
-
-/**
- * @author Yahor Radtsevich (yradtsevich)
- *
- */
-public class VpeSpringUtil {
-
- public static final Map<String, String> COMMON_SPRING_FORM_ATTRIBUTES_MAP
- = new HashMap<String, String>() {{
- put(Spring.ATTR_ID, HTML.ATTR_ID);
- put(Spring.ATTR_CSS_STYLE, HTML.ATTR_STYLE);
- put(Spring.ATTR_CSS_CLASS, HTML.ATTR_CLASS);
- }};
-
- public static void copyAttribute(Element sourceElement, String sourceAttrName,
- nsIDOMElement visualElement, String visualAttrName) {
- if (sourceElement.hasAttribute(sourceAttrName)) {
- String attrValue = sourceElement.getAttribute(sourceAttrName);
- visualElement.setAttribute(visualAttrName, attrValue);
- }
- }
-
- public static void copyAttributes(Element sourceElement,
- nsIDOMElement visualElement, Map<String, String> sourceToVisualMap) {
- for (Entry<String, String> sourceToVisual : sourceToVisualMap.entrySet()) {
- String sourceAttrName = sourceToVisual.getKey();
- String visualAttrName = sourceToVisual.getValue();
- copyAttribute(sourceElement, sourceAttrName, visualElement, visualAttrName);
- }
- }
-
- public static void copyCommonAttributes(Element sourceElement,
- nsIDOMElement visualElement) {
- copyAttributes(sourceElement, visualElement,
- COMMON_SPRING_FORM_ATTRIBUTES_MAP);
- }
-}