Author: ezheleznyakov
Date: 2007-09-26 11:22:03 -0400 (Wed, 26 Sep 2007)
New Revision: 3817
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/HtmlBodyTemplate.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-897
little fix
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/HtmlBodyTemplate.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/HtmlBodyTemplate.java 2007-09-26
14:22:02 UTC (rev 3816)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/HtmlBodyTemplate.java 2007-09-26
15:22:03 UTC (rev 3817)
@@ -15,6 +15,7 @@
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNamedNodeMap;
import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -28,6 +29,7 @@
private nsIDOMElement bodyOld;
private static String STYLE_FOR_DIV = "width: 100%; height: 100%";
+ private static String ID = "id";
/**
*
@@ -37,8 +39,22 @@
goToTree(visualDocument.getChildNodes().item(0));
+ nsIDOMNamedNodeMap attrsMap = bodyOld.getAttributes();
+ long len = attrsMap.getLength();
+ int j = 0;
+ for (int i = 0; i < len; i++) {
+ nsIDOMNode attr = attrsMap.item(j);
+ if (ID.equalsIgnoreCase(attr.getNodeName())) {
+ j++;
+ continue;
+ }
+ bodyOld.removeAttribute(attr.getNodeName());
+ }
+
for (int i = 0; i < sourceNode.getAttributes().getLength(); i++) {
String name = sourceNode.getAttributes().item(i).getNodeName();
+ if(ID.equalsIgnoreCase(name))
+ continue;
String value = sourceNode.getAttributes().item(i).getNodeValue();
// all full path for 'url'
if (VpeStyleUtil.ATTRIBUTE_STYLE.equalsIgnoreCase(name))
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2007-09-26
14:22:02 UTC (rev 3816)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2007-09-26
15:22:03 UTC (rev 3817)
@@ -44,7 +44,7 @@
public static String ATTR_URL = "url";
public static String OPEN_BRACKET = "(";
public static String CLOSE_BRACKET = ")";
- public static String FILE_PRTOCOL = "file:///";
+ public static String FILE_PRTOCOL = "file://";
public static String FILE_STR = "file:";
public static String FILE_SEPARAROT = "/";