Author: izhukov
Date: 2008-12-15 05:51:48 -0500 (Mon, 15 Dec 2008)
New Revision: 12587
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/paint2D/paint2D.css
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/RichFacesPaint2DTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.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/resources/richFacesTest/WebContent/pages/components/paint2D.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/paint2D.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/spacer.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/spacer.xhtml.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
Improve templates functionality for "paint2D" and "spacer" VPE
components
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/paint2D/paint2D.css
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/paint2D/paint2D.css 2008-12-15
07:45:59 UTC (rev 12586)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/paint2D/paint2D.css 2008-12-15
10:51:48 UTC (rev 12587)
@@ -1,4 +1,2 @@
-.imgStyleClass{
-width: 300;
-height : 120;
+.rich-paint2D{
}
\ No newline at end of file
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 2008-12-15
07:45:59 UTC (rev 12586)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-12-15
10:51:48 UTC (rev 12587)
@@ -440,7 +440,24 @@
*
* @param attributeName the attribute name
* @param sourceElement the source element
+ * @param defaultValue the default value
+ *
+ * @return the attribute
+ */
+ public static String getAttribute(Element sourceElement, String attributeName, String
defaultValue) {
+ String attribute = sourceElement.getAttribute(attributeName);
+ if (attribute == null) {
+ attribute = defaultValue;
+ }
+ return attribute;
+ }
+
+ /**
+ * Returns value of attribute.
*
+ * @param attributeName the attribute name
+ * @param sourceElement the source element
+ *
* @return the attribute
*/
public static String getAttribute(nsIDOMElement sourceElement, String attributeName)
{
@@ -525,10 +542,10 @@
String path =
ElService.getInstance().replaceEl(pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile(),
fileImageName);
File file = new File(inputPath.toOSString() + File.separator + path);
if (file.exists()) {
- img.setAttribute(HtmlComponentUtil.HTML_ATR_SRC,
HtmlComponentUtil.FILE_PROTOCOL + inputPath.toString() + "/" //$NON-NLS-1$
+ img.setAttribute(HTML.ATTR_SRC, HtmlComponentUtil.FILE_PROTOCOL +
inputPath.toString() + "/" //$NON-NLS-1$
+ path.replace('\\', '/'));
} else {
- img.setAttribute(HtmlComponentUtil.HTML_ATR_SRC,
undefinedImgName.replace('\\', '/'));
+ img.setAttribute(HTML.ATTR_SRC, undefinedImgName.replace('\\',
'/'));
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java 2008-12-15
07:45:59 UTC (rev 12586)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java 2008-12-15
10:51:48 UTC (rev 12587)
@@ -10,13 +10,16 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
+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.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
-import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
@@ -35,6 +38,16 @@
/** PAINT2D_CSS_FILE */
private static final String PAINT2D_CSS_FILE = "/paint2D/paint2D.css";
//$NON-NLS-1$
+ /** DEFAULT_WIDTH */
+ private static final String DEFAULT_WIDTH = "10"; //$NON-NLS-1$
+ /** DEFAULT_HEIGHT */
+ private static final String DEFAULT_HEIGHT = "10"; //$NON-NLS-1$
+ /** ATTR_TRANSPARENT_VALUE */
+ private static final String ATTR_TRANSPARENT_VALUE = "transparent";
//$NON-NLS-1$
+
+ /** RICH_PAINT2D_STYLE */
+ private static final String RICH_PAINT2D_STYLE = "rich-paint2D";
//$NON-NLS-1$
+
/**
* Create html instead rich:faces component.
*
@@ -48,19 +61,59 @@
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
ComponentUtil.setCSSLink(pageContext, PAINT2D_CSS_FILE, "paint2d");
//$NON-NLS-1$
+ // convert to Element
+ Element sourceElement = (Element) sourceNode;
nsIDOMElement img = visualDocument.createElement(HTML.TAG_IMG);
ComponentUtil.setImg(img, IMAGE_NAME);
- String attrValue = ((Element) sourceNode).getAttribute(RichFaces.ATTR_STYLE_CLASS);
- if (attrValue != null && attrValue.length() != 0) {
- img.setAttribute(HTML.ATTR_CLASS, attrValue);
- } else if (((Element) sourceNode).getAttribute(HTML.ATTR_WIDTH) == null
- && ((Element) sourceNode).getAttribute(HTML.ATTR_HEIGHT) == null) {
- img.setAttribute(HTML.ATTR_CLASS, "imgStyleClass"); //$NON-NLS-1$
+
+ // set STYLE attributes
+ String attrValue = ComponentUtil.getAttribute(sourceElement, RichFaces.ATTR_STYLE);
+ if (attrValue.length() != 0) {
+ img.setAttribute(HTML.ATTR_STYLE, attrValue);
}
- VisualDomUtil.copyAttributes(sourceNode, img);
- VpeCreationData creationData = new VpeCreationData(img);
+ // set CLASS attribute
+ attrValue = ComponentUtil.getAttribute(sourceElement, RichFaces.ATTR_STYLE_CLASS);
+ String styleClass = RICH_PAINT2D_STYLE;
+ if (attrValue.length() != 0) {
+ styleClass += Constants.WHITE_SPACE + attrValue;
+ }
+ img.setAttribute(HTML.ATTR_CLASS, styleClass);
+ // set WIDTH attribute
+ String width = ComponentUtil.getAttribute(sourceElement, HTML.ATTR_WIDTH,
DEFAULT_WIDTH);
+ img.setAttribute(HTML.ATTR_WIDTH, width);
+ // set HEIGHT attribute
+ String height = ComponentUtil.getAttribute(sourceElement, HTML.ATTR_HEIGHT,
DEFAULT_HEIGHT);
+ img.setAttribute(HTML.ATTR_HEIGHT, height);
+ // set BGCOLOR attribute
+ String bgColor = ComponentUtil.getAttribute(sourceElement, HTML.ATTR_BGCOLOR,
ATTR_TRANSPARENT_VALUE);
+ img.setAttribute(HTML.ATTR_BGCOLOR, bgColor);
+ // ================================================================================
+ // Check if template component has children elements
+ // ================================================================================
+ List<Node> list = ComponentUtil.getChildren(sourceElement, true);
+ VpeCreationData creationData = null;
+ if (list != null && list.size() > 0) {
+ nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_SPAN);
+
+ // this element is used to contains template children
+ nsIDOMElement childDiv = visualDocument.createElement(HTML.TAG_SPAN);
+
+ rootDiv.appendChild(childDiv);
+ rootDiv.appendChild(img);
+
+ // Create return variable contains template
+ creationData = new VpeCreationData(rootDiv);
+ VpeChildrenInfo divInfo = new VpeChildrenInfo(childDiv);
+ creationData.addChildrenInfo(divInfo);
+ for (Node child : list) {
+ divInfo.addSourceChild(child);
+ }
+ } else {
+ creationData = new VpeCreationData(img);
+ }
+
return creationData;
}
-}
+}
\ No newline at end of file
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java 2008-12-15
07:45:59 UTC (rev 12586)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java 2008-12-15
10:51:48 UTC (rev 12587)
@@ -10,14 +10,18 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
+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.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.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
-import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -26,13 +30,23 @@
*/
public class RichFacesSpacerTemplate extends VpeAbstractTemplate {
- final static private String IMAGE_NAME = "spacer/spacer.gif";
+ /** IMAGE_NAME */
+ private static final String IMAGE_NAME = "/spacer/spacer.gif"; //$NON-NLS-1$
+ /** SPACER_CSS_FILE */
+ private static final String SPACER_CSS_FILE = "/spacer/spacer.css";
//$NON-NLS-1$
+
+ /** DEFAULT_SIZE */
+ private static final String DEFAULT_SIZE = "1px"; //$NON-NLS-1$
+
+ /** RICH_SPACER_STYLE */
+ private static final String RICH_SPACER_STYLE = "rich-spacer"; //$NON-NLS-1$
+
/**
* Creates a node of the visual tree on the node of the source tree. This
* visual node should not have the parent node This visual node can have
* child nodes.
- *
+ *
* @param pageContext
* Contains the information on edited page.
* @param sourceNode
@@ -41,63 +55,58 @@
* The document of the visual tree.
* @return The information on the created node of the visual tree.
*/
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+ ComponentUtil.setCSSLink(pageContext, SPACER_CSS_FILE, "spacer");
//$NON-NLS-1$
+ // convert to Element
+ Element sourceElement = (Element) sourceNode;
- nsIDOMElement img = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ nsIDOMElement img = visualDocument.createElement(HTML.TAG_IMG);
ComponentUtil.setImg(img, IMAGE_NAME);
- Element sourceElement = (Element) sourceNode;
+ // set STYLE attributes
+ String attrValue = ComponentUtil.getAttribute(sourceElement, RichFaces.ATTR_STYLE);
+ if (attrValue.length() != 0) {
+ img.setAttribute(HTML.ATTR_STYLE, attrValue);
+ }
+ // set CLASS attribute
+ attrValue = ComponentUtil.getAttribute(sourceElement, RichFaces.ATTR_STYLE_CLASS);
+ String styleClass = RICH_SPACER_STYLE;
+ if (attrValue.length() != 0) {
+ styleClass += Constants.WHITE_SPACE + attrValue;
+ }
+ img.setAttribute(HTML.ATTR_CLASS, styleClass);
+ // set WIDTH attribute
+ String width = ComponentUtil.getAttribute(sourceElement, HTML.ATTR_WIDTH,
DEFAULT_SIZE);
+ img.setAttribute(HTML.ATTR_WIDTH, width);
+ // set HEIGHT attribute
+ String height = ComponentUtil.getAttribute(sourceElement, HTML.ATTR_HEIGHT,
DEFAULT_SIZE);
+ img.setAttribute(HTML.ATTR_HEIGHT, height);
- setData(sourceElement, img);
+ // ================================================================================
+ // Check if template component has children elements
+ // ================================================================================
+ List<Node> list = ComponentUtil.getChildren(sourceElement, true);
+ VpeCreationData creationData = null;
+ if (list != null && list.size() > 0) {
+ nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_SPAN);
- VpeCreationData creationData = new VpeCreationData(img);
+ // this element is used to contains template children
+ nsIDOMElement childDiv = visualDocument.createElement(HTML.TAG_SPAN);
- return creationData;
- }
+ rootDiv.appendChild(childDiv);
+ rootDiv.appendChild(img);
- private String getSize(Element sourceElement, String attributeName) {
- String size = sourceElement.getAttribute(attributeName);
- if (size == null || size.length() == 0) {
- return "1px";
+ // Create return variable contains template
+ creationData = new VpeCreationData(rootDiv);
+ VpeChildrenInfo divInfo = new VpeChildrenInfo(childDiv);
+ creationData.addChildrenInfo(divInfo);
+ for (Node child : list) {
+ divInfo.addSourceChild(child);
+ }
} else {
- return size;
+ creationData = new VpeCreationData(img);
}
- }
- /**
- *
- * @see
com.exadel.vpe.editor.template.VpeAbstractTemplate#setAttribute(com.exadel.vpe.editor.context.VpePageContext,
- * org.w3c.dom.Element, org.w3c.dom.Document, org.w3c.dom.Node,
- * java.lang.Object, java.lang.String, java.lang.String)
- */
- @Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement,
- nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data,
- String name, String value) {
- super.setAttribute(pageContext, sourceElement, visualDocument,
- visualNode, data, name, value);
-
- nsIDOMElement img = (nsIDOMElement) visualNode
- .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
-
- setData(sourceElement, img);
+ return creationData;
}
-
- /**
- *
- * @param sourceElement
- * @param visualElement
- */
- private void setData(Element sourceElement, nsIDOMElement visualElement) {
-
- visualElement
- .setAttribute("style", sourceElement.getAttribute("style"));
- visualElement.setAttribute("class", sourceElement
- .getAttribute("styleClass"));
- visualElement.setAttribute("width", getSize(sourceElement,
"width"));
- visualElement.setAttribute("height", getSize(sourceElement,
"height"));
-
- }
}
\ No newline at end of file
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 2008-12-15
07:45:59 UTC (rev 12586)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-12-15
10:51:48 UTC (rev 12587)
@@ -7,7 +7,7 @@
<vpe:tag name="rich:paint2D" case-sensitive="yes">
- <vpe:template children="no" modify="yes"
+ <vpe:template children="yes" modify="yes"
class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesPaint2DTemplate">
<vpe:resize>
<vpe:width width-attr="style.width" />
@@ -17,6 +17,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="no"></vpe:drop>
</vpe:dnd>
+ <vpe:pseudoContent defaultText="no" />
</vpe:template>
</vpe:tag>
@@ -216,7 +217,7 @@
</vpe:tag>
<vpe:tag name="rich:spacer" case-sensitive="yes">
- <vpe:template children="no" modify="yes"
+ <vpe:template children="yes" modify="yes"
class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesSpacerTemplate">
<vpe:resize>
<vpe:width width-attr="style.width" />
@@ -230,13 +231,11 @@
<vpe:format type="BackgroundColorFormat">
<vpe:formatAttribute type="style" />
</vpe:format>
- </vpe:textFormatting>
-
+ </vpe:textFormatting>
+ <vpe:pseudoContent defaultText="no"/>
</vpe:template>
- </vpe:tag>
+ </vpe:tag>
-
-
<vpe:tag name="rich:separator" case-sensitive="yes">
<vpe:template children="no" modify="no"
class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesSeparatorTemplate">
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/paint2D.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/paint2D.xhtml 2008-12-15
07:45:59 UTC (rev 12586)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/paint2D.xhtml 2008-12-15
10:51:48 UTC (rev 12587)
@@ -8,11 +8,16 @@
<head>
</head>
-
<body>
<f:view>
-<rich:paint2D id="paint2D" width="300" height="120"
data="#{paintData}"
- format="png" paint="#{paintBean.paint}" />
+<rich:paint2D id="paint2D" data="#{paintData}"
format="png" paint="#{paintBean.paint}"/>
+<rich:paint2D id="paint2DWithData" width="300"
height="120" data="#{paintData}"
+ format="png" paint="#{paintBean.paint}"
style="color:red" styleClass="customStyleClass"/>
+<rich:paint2D id="paint2DWithDataAndChildren" width="300"
height="120" data="#{paintData}"
+ format="png" paint="#{paintBean.paint}"
style="color:red" styleClass="customStyleClass">
+ Mama mila ramu
+ <input type="button" value="Button"/>
+</rich:paint2D>
</f:view>
</body>
</html>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/paint2D.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/paint2D.xhtml.xml 2008-12-15
07:45:59 UTC (rev 12586)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/paint2D.xhtml.xml 2008-12-15
10:51:48 UTC (rev 12587)
@@ -1,7 +1,20 @@
<tests>
<test id="paint2D">
- <IMG WIDTH="300" HEIGHT="120"
- SRC="/.*resources/paint2D/paint2D.gif/"
- ID="paint2D" DATA="#{paintData}" FORMAT="png"
PAINT="#{paintBean.paint}" />
- </test>
+ <IMG WIDTH="10" HEIGHT="10"
SRC="/.*resources/paint2D/paint2D.gif/"
+ CLASS="rich-paint2D" BGCOLOR="transparent"/>
+ </test>
+ <test id="paint2DWithData">
+ <IMG WIDTH="300" HEIGHT="120"
SRC="/.*resources/paint2D/paint2D.gif/"
+ STYLE="color: red;" CLASS="rich-paint2D customStyleClass"
BGCOLOR="transparent"/>
+ </test>
+ <test id="paint2DWithDataAndChildren">
+ <SPAN>
+ <SPAN>
+ <SPAN>Mama mila ramu</SPAN>
+ <INPUT TYPE="button" VALUE="Button"/>
+ </SPAN>
+ <IMG WIDTH="300" HEIGHT="120"
SRC="/.*resources/paint2D/paint2D.gif/"
+ STYLE="color: red;" CLASS="rich-paint2D
customStyleClass" BGCOLOR="transparent"/>
+ </SPAN>
+ </test>
</tests>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/spacer.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/spacer.xhtml 2008-12-15
07:45:59 UTC (rev 12586)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/spacer.xhtml 2008-12-15
10:51:48 UTC (rev 12587)
@@ -5,15 +5,15 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
-
<head>
</head>
-
<body>
<f:view>
- line1
- <rich:spacer id="spacer" width="1" height="5"
title="Here is a spacer..." />
- line2
+ <rich:spacer id="spacer"/>
+ <rich:spacer id="spacerCSS" styleClass="customStyleClass"
style="color:red" width="100" height="200"/>
+ <rich:spacer id="spacerCSSWithChildren"
styleClass="customStyleClass" style="color:red" width="100"
height="200">
+ <input type="button" value="Button"/><br/>Mama
mila ramu
+ </rich:spacer>
</f:view>
</body>
</html>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/spacer.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/spacer.xhtml.xml 2008-12-15
07:45:59 UTC (rev 12586)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/spacer.xhtml.xml 2008-12-15
10:51:48 UTC (rev 12587)
@@ -1,6 +1,20 @@
<tests>
<test id="spacer">
- <IMG WIDTH="1" HEIGHT="5"
- SRC="/.*resources/spacer/spacer.gif/" />
- </test>
+ <IMG WIDTH="1" HEIGHT="1"
SRC="/.*resources/spacer/spacer.gif/" CLASS="rich-spacer"/>
+ </test>
+ <test id="spacerCSS">
+ <IMG WIDTH="100" HEIGHT="200"
SRC="/.*resources/spacer/spacer.gif/"
+ STYLE="color: red;" CLASS="rich-spacer
customStyleClass"/>
+ </test>
+ <test id="spacerCSSWithChildren">
+ <SPAN>
+ <SPAN>
+ <INPUT TYPE="button" VALUE="Button"
STYLE="-moz-user-modify: read-write;"/>
+ <BR/>
+ <SPAN>Mama mila ramu</SPAN>
+ </SPAN>
+ <IMG WIDTH="100" HEIGHT="200"
SRC="/.*resources/spacer/spacer.gif/"
+ STYLE="color: red;" CLASS="rich-spacer
customStyleClass"/>
+ </SPAN>
+ </test>
</tests>
\ No newline at end of file
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-12-15
07:45:59 UTC (rev 12586)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-12-15
10:51:48 UTC (rev 12587)
@@ -101,6 +101,7 @@
public static final String ATTR_SCOPE = "scope"; //$NON-NLS-1$
public static final String ATTR_SPAN = "span"; //$NON-NLS-1$
public static final String ATTR_BACKGROUND = "background"; //$NON-NLS-1$
+ public static final String ATTR_BGCOLOR = "bgcolor"; //$NON-NLS-1$
/**Use this constant if you have to span a column to entire row.*/
/* While in HTML 4.01 standard "colspan='0'" should be used for this
purpose,