Author: vyemialyanchyk
Date: 2007-11-01 13:51:22 -0400 (Thu, 01 Nov 2007)
New Revision: 4643
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
code revert
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-11-01
17:48:28 UTC (rev 4642)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-11-01
17:51:22 UTC (rev 4643)
@@ -241,26 +241,6 @@
return false;
}
- private boolean reCreateNode(nsIDOMNode visualOldNode, Node sourceNode, nsIDOMNode
visualContainer) {
- nsIDOMNode visualNewNode = createNode(sourceNode, visualContainer);
- try {
- if (visualNewNode != null) {
- nsIDOMHTMLInputElement iDOMInputElement = (nsIDOMHTMLInputElement)
visualNewNode.queryInterface(nsIDOMHTMLInputElement.NS_IDOMHTMLINPUTELEMENT_IID);
- iDOMInputElement.setReadOnly(true);
- }
- } catch(XPCOMException ex) {
- //just ignore this exception
- }
- if (visualNewNode != null) {
- visualContainer.replaceChild(visualOldNode, visualNewNode);
- return true;
- }
- else {
- visualContainer.removeChild(visualOldNode);
- }
- return false;
- }
-
private nsIDOMElement createBorder(Node sourceNode,
nsIDOMElement visualNode, boolean block) {
nsIDOMElement border = null;
@@ -819,7 +799,8 @@
nsIDOMNode visualContainer = visualOldNode.getParentNode();
nsIDOMNode visualNextNode = visualOldNode.getNextSibling();
if (visualContainer != null) {
- reCreateNode(visualOldNode, sourceNode, visualContainer);
+ visualContainer.removeChild(visualOldNode);
+ addNode(sourceNode, visualNextNode, visualContainer);
}
} else {
if (sourceNode.getNodeType() == Node.TEXT_NODE) {
@@ -2022,9 +2003,7 @@
protected nsIDOMNode createTextNode(Node sourceNode, boolean registerFlag ) {
String sourceText = sourceNode.getNodeValue();
if (sourceText.trim().length() <= 0) {
- if (registerFlag) {
- registerNodes(new VpeNodeMapping(sourceNode, null));
- }
+ registerNodes(new VpeNodeMapping(sourceNode, null));
return null;
}
Show replies by date