Author: mareshkau
Date: 2007-08-31 11:24:21 -0400 (Fri, 31 Aug 2007)
New Revision: 3415
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-744
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-08-31
15:24:14 UTC (rev 3414)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-08-31
15:24:21 UTC (rev 3415)
@@ -2435,9 +2435,22 @@
* Calls when editor content should be refreshed
*/
public void onRefresh() {
+ //when we using separate thread to display selection rectangle
+ //it's working more better than without
+ /*
+ * HACK
+ * We need wait some time while standart event will be handled
+ * and in process event handles some components are repainted(like buttons)
+ * and flasher are not repainted, so we should paint flasher
+ */
+ Display.getCurrent().asyncExec(new Thread(){
+ public void run(){
+
+ getXulRunnerEditor().showSelectionRectangle();
+ }
+ });
+// getXulRunnerEditor().showSelectionRectangle();
- getXulRunnerEditor().showSelectionRectangle();
-
}
/**
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2007-08-31
15:24:14 UTC (rev 3414)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2007-08-31
15:24:21 UTC (rev 3415)
@@ -391,7 +391,7 @@
offset = visualNode.getNodeValue().length();
}
selection.collapse(visualNode, offset);
- nsIDOMElement visualParentElement = (nsIDOMElement) visualNode.getParentNode();
+ nsIDOMElement visualParentElement = (nsIDOMElement)
visualNode.getParentNode().queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
visualBuilder.setSelectionRectangle(visualParentElement);
break;
case nsIDOMNode.ELEMENT_NODE:
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java 2007-08-31
15:24:14 UTC (rev 3414)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java 2007-08-31
15:24:21 UTC (rev 3415)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.mozilla;
-import org.eclipse.swt.widgets.Display;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
import org.mozilla.interfaces.nsIClipboardDragDropHooks;
@@ -393,25 +392,7 @@
//just ignore this event
} else if(DRAGOVEREVENT.equals(domEvent.getType())) {
getEditorDomEventListener().dragOver(domEvent);
- }
-
- /*
- * HACK
- * We need wait some time while standart event will be handled
- * and in process event handles some components are repainted(like buttons)
- * and flasher are not repainted, so we should paint flasher
- */
- Display.getCurrent().asyncExec(new Thread(){
- public void run() {
- try {
- sleep(50);
- getEditorDomEventListener().onRefresh();
- } catch (InterruptedException e) {
- //JUST IGNORE exception
- e.printStackTrace();
- }
- }
- });
+ }
getEditorDomEventListener().onRefresh();