Author: sdzmitrovich
Date: 2008-01-16 13:12:20 -0500 (Wed, 16 Jan 2008)
New Revision: 5747
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/spacer/spacer.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1639
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/spacer/spacer.gif
===================================================================
(Binary files differ)
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-01-16
16:45:15 UTC (rev 5746)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java 2008-01-16
18:12:20 UTC (rev 5747)
@@ -7,7 +7,7 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
@@ -26,7 +26,7 @@
*/
public class RichFacesSpacerTemplate extends VpeAbstractTemplate {
- final static private String IMAGE_NAME = "/spacer/spacer.gif";
+ final static private String IMAGE_NAME = "spacer/spacer.gif";
/**
* Creates a node of the visual tree on the node of the source tree. This
@@ -35,18 +35,28 @@
*
* @param pageContext
* Contains the information on edited page.
- * @param sourceNode The current node of the source tree.
- * @param visualDocument The document of the visual tree.
+ * @param sourceNode
+ * The current node of the source tree.
+ * @param visualDocument
+ * 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) {
- nsIDOMElement img = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ nsIDOMElement img = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_IMG);
ComponentUtil.setImg(img, IMAGE_NAME);
- if(sourceNode instanceof Element) {
- img.setAttribute("width", getSize((Element)sourceNode, "width"));
- img.setAttribute("height", getSize((Element)sourceNode,
"height"));
+ if (sourceNode instanceof Element) {
+ // ComponentUtil.copyAttributes(sourceNode, img);
+ img.setAttribute("style", ((Element) sourceNode)
+ .getAttribute("style"));
+ img.setAttribute("class", ((Element) sourceNode)
+ .getAttribute("styleClass"));
+ img.setAttribute("width", getSize((Element) sourceNode,
"width"));
+ img.setAttribute("height", getSize((Element) sourceNode,
"height"));
+
}
VpeCreationData creationData = new VpeCreationData(img);
@@ -55,8 +65,8 @@
}
private String getSize(Element sourceElement, String attributeName) {
- String size = sourceElement.getAttribute(attributeName);
- if (size==null || size.length()==0) {
+ String size = sourceElement.getAttribute(attributeName);
+ if (size == null || size.length() == 0) {
return "1px";
} else {
return size;
@@ -70,11 +80,18 @@
* 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);
+ 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);
+ nsIDOMElement img = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ // ComponentUtil.copyAttributes(sourceElement, img);
+ img.setAttribute("style", sourceElement.getAttribute("style"));
+ img.setAttribute("class",
sourceElement.getAttribute("styleClass"));
img.setAttribute("width", getSize(sourceElement, "width"));
img.setAttribute("height", getSize(sourceElement, "height"));
}