Author: yzhishko
Date: 2009-11-10 08:25:15 -0500 (Tue, 10 Nov 2009)
New Revision: 18565
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5161
https://jira.jboss.org/jira/browse/JBIDE-5105 fixed
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-11-10
09:40:28 UTC (rev 18564)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-11-10
13:25:15 UTC (rev 18565)
@@ -274,7 +274,10 @@
WebAppHelper.getWebApp(xm));
}
}
-
+
+ // Fix for JBIDE-5105, JBIDE-5161
+ visualEditor.getEditor();
+
IDOMDocument sourceDocument = sourceModel.getDocument();
// FIXED FOR JBIDE-3799 by sdzmitrovich, moved calling of this method to buid dom
// visualBuilder.refreshExternalLinks();
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-11-10
09:40:28 UTC (rev 18564)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-11-10
13:25:15 UTC (rev 18565)
@@ -913,7 +913,9 @@
// initialize editor
// this method must be invoked before any visual
// node is created, see JBIDE-5105
- visualEditor.getEditor();
+ // this method should be called after browser was loading
+ // see JBIDE-5161
+ // visualEditor.getEditor();
}
public void createPreviewBrowser() {
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 2009-11-10
09:40:28 UTC (rev 18564)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-11-10
13:25:15 UTC (rev 18565)
@@ -198,6 +198,11 @@
}
public void buildDom(Document sourceDocument) {
+ nsIDOMNodeList children = getContentArea().getChildNodes();
+ long len = children.getLength();
+ for (long i = len - 1; i >= 0; i--) {
+ getContentArea().removeChild(children.item(i));
+ }
VpeSourceDomBuilder sourceBuilder = pageContext.getSourceBuilder();
IDocument document = sourceBuilder.getStructuredTextViewer()
.getDocument();
@@ -252,13 +257,16 @@
// FIXED FOR JBIDE-3799 by sdzmitrovich, moved calling of this method to buid dom
// refreshExternalLinks();
pageContext.getBundle().refreshRegisteredBundles();
+
+ //Next path was moved to buildDom method
+ //to avoid <br> in a visual DOM before editor browser
+ //load and after reload
+// nsIDOMNodeList children = getContentArea().getChildNodes();
+// long len = children.getLength();
+// for (long i = len - 1; i >= 0; i--) {
+// getContentArea().removeChild(children.item(i));
+// }
- nsIDOMNodeList children = getContentArea().getChildNodes();
- long len = children.getLength();
- for (long i = len - 1; i >= 0; i--) {
- getContentArea().removeChild(children.item(i));
- }
-
if (sourceDocument != null) {
buildDom(sourceDocument);
}