Author: mareshkau
Date: 2007-08-28 11:22:33 -0400 (Tue, 28 Aug 2007)
New Revision: 3390
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.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-743
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-08-28
15:17:11 UTC (rev 3389)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-08-28
15:22:33 UTC (rev 3390)
@@ -23,6 +23,8 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.Path;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.ui.IEditorInput;
@@ -1437,22 +1439,22 @@
}
void setMoveCursor(nsIDOMMouseEvent mouseEvent) {
- // TODO Max Areshkau figure out with selected element
-// nsIDOMElement selectedElement = browser.getSelectedElement();
-// if (selectedElement != null && canInnerDrag(selectedElement)) {
-// if (inDragArea(getNodeBounds(selectedElement),
VisualDomUtil.getMousePoint(mouseEvent))) {
-// // TODO Max Areshkau add DnD support
-// dnd.setMoveCursor();
-// }
-// }
+
+ nsIDOMElement selectedElement = xulRunnerEditor.getLastSelectedElement();
+
+ if (selectedElement != null && canInnerDrag(selectedElement)) {
+ if (inDragArea(getNodeBounds(selectedElement),
VisualDomUtil.getMousePoint(mouseEvent))) {
+ // TODO Max Areshkau add DnD support
+ //dnd.setMoveCursor();
+ }
+ }
}
private boolean inDragArea(Rectangle dragArea, Point mousePoint) {
//TODO add drag and drop support
-// return dragArea.contains(mousePoint) &&
-// mousePoint.x < (dragArea.x + DRAG_AREA_WIDTH) &&
-// mousePoint.y < (dragArea.y + DRAG_AREA_HEIGHT);
- return false;
+ return dragArea.contains(mousePoint) &&
+ mousePoint.x < (dragArea.x + DRAG_AREA_WIDTH) &&
+ mousePoint.y < (dragArea.y + DRAG_AREA_HEIGHT);
}
nsIDOMElement getDragElement(nsIDOMMouseEvent mouseEvent) {
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-28
15:17:11 UTC (rev 3389)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaDomEventListener.java 2007-08-28
15:22:33 UTC (rev 3390)
@@ -371,7 +371,7 @@
if (editorDomEventListener != null && !isXulElement(mouseEvent)) {
boolean canDragFlag = editorDomEventListener.canInnerDrag(mouseEvent);
- //start drag session
+ //start drag sessionvpe-element
if(canDragFlag) {
getEditorDomEventListener().startDragSession(domEvent);