Author: mareshkau
Date: 2007-08-30 13:36:26 -0400 (Thu, 30 Aug 2007)
New Revision: 3410
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/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/VpeSelectionBuilder.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2007-08-30
14:45:19 UTC (rev 3409)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeSelectionBuilder.java 2007-08-30
17:36:26 UTC (rev 3410)
@@ -90,7 +90,7 @@
if (sourceNode != null) {
switch (visualSelectedNode.getNodeType()) {
case nsIDOMNode.TEXT_NODE:
- nsIDOMElement visualParentElement =
(nsIDOMElement)visualSelectedNode.getParentNode();
+ nsIDOMElement visualParentElement =
(nsIDOMElement)visualSelectedNode.getParentNode().queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
visualBuilder.setSelectionRectangle(visualParentElement, false);
// int pos = DataHelper.textPos(visualSelectedNode.getNodeValue(),
selection.getFocusOffset());
int pos = selection.getFocusOffset();
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-30
14:45:19 UTC (rev 3409)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java 2007-08-30
17:36:26 UTC (rev 3410)
@@ -10,6 +10,7 @@
******************************************************************************/
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;
@@ -344,11 +345,15 @@
nsIDOMMouseEvent mouseEvent;
mouseEvent = (nsIDOMMouseEvent)
domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
getEditorDomEventListener().mouseDown(mouseEvent);
+// domEvent.stopPropagation();
+// domEvent.preventDefault();
} else if(MOUSEUPEVENTTYPE.equals(domEvent.getType())) {
nsIDOMMouseEvent mouseEvent;
mouseEvent = (nsIDOMMouseEvent)
domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
getEditorDomEventListener().mouseUp(mouseEvent);
+// domEvent.stopPropagation();
+// domEvent.preventDefault();
} else if(CLICKEVENTTYPE.equals(domEvent.getType())) {
nsIDOMMouseEvent mouseEvent;
@@ -389,8 +394,27 @@
} 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();
+
//not using default mozilla event handlers
}catch(Throwable th) {
//TODO Max Areshkau remove when all will be adjusted