svn changeset:12351/svn branch:6.3tags/6.7.0.beta1
@@ -127,7 +127,6 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
dragLeavPostponed = false; | |||
return false; | |||
} | |||
ApplicationConnection.getConsole().log("HTML 5 Drag Enter"); | |||
VTransferable transferable = new VTransferable(); | |||
transferable.setDragSource(this); | |||
@@ -144,7 +143,6 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
return true; | |||
} | |||
ApplicationConnection.getConsole().log("HTML 5 Drag Leave posponed..."); | |||
dragLeavPostponed = true; | |||
DeferredCommand.addCommand(new Command() { | |||
public void execute() { | |||
@@ -155,8 +153,6 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
if (dragLeavPostponed | |||
&& vaadinDragEvent != null | |||
&& VDragAndDropManager.get().getCurrentDropHandler() == getDropHandler()) { | |||
ApplicationConnection.getConsole().log( | |||
"...HTML 5 Drag Leave"); | |||
VDragAndDropManager.get().interruptDrag(); | |||
} | |||
dragLeavPostponed = false; | |||
@@ -172,7 +168,6 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
return true; | |||
} | |||
ApplicationConnection.getConsole().log("HTML 5 Drag Over"); | |||
vaadinDragEvent.setCurrentGwtEvent(event); | |||
getDropHandler().dragOver(vaadinDragEvent); | |||
// needed to be set for Safari, otherwise drop will not happen | |||
@@ -182,8 +177,6 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
event.setDragEffect("copy"); | |||
} else { | |||
event.setDragEffect(s); | |||
ApplicationConnection.getConsole().log( | |||
"Drag effect set to " + s); | |||
} | |||
} | |||
event.preventDefault(); | |||
@@ -196,24 +189,19 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
return true; | |||
} | |||
ApplicationConnection.getConsole().log("HTML 5 Drag Drop"); | |||
VTransferable transferable = vaadinDragEvent.getTransferable(); | |||
JsArrayString types = event.getTypes(); | |||
ApplicationConnection.getConsole().log("Types fetched"); | |||
for (int i = 0; i < types.length(); i++) { | |||
String type = types.get(i); | |||
ApplicationConnection.getConsole().log("Type: " + type); | |||
if (isAcceptedType(type)) { | |||
String data = event.getDataAsText(type); | |||
if (data != null) { | |||
ApplicationConnection.getConsole().log(type + " : " + data); | |||
transferable.setData(type, data); | |||
} | |||
} | |||
} | |||
ApplicationConnection.getConsole().log("checking files"); | |||
int fileCount = event.getFileCount(); | |||
if (fileCount > 0) { | |||
transferable.setData("filecount", fileCount); | |||
@@ -229,8 +217,6 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
} | |||
ApplicationConnection.getConsole().log("Ending drag"); | |||
VDragAndDropManager.get().endDrag(); | |||
vaadinDragEvent = null; | |||
event.preventDefault(); | |||
@@ -351,14 +337,12 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
@Override | |||
public void dragEnter(VDragEvent drag) { | |||
updateDropDetails(drag); | |||
ApplicationConnection.getConsole().log("DDWrapper DragEnter"); | |||
currentlyValid = false; | |||
super.dragEnter(drag); | |||
} | |||
@Override | |||
public void dragLeave(VDragEvent drag) { | |||
ApplicationConnection.getConsole().log("DDWrapper DragLeave"); | |||
deEmphasis(true); | |||
dragLeavPostponed = false; | |||
} | |||
@@ -378,7 +362,6 @@ public class VDragAndDropWrapper extends VCustomComponent implements | |||
@Override | |||
public boolean drop(VDragEvent drag) { | |||
ApplicationConnection.getConsole().log("Drop" + drag.sinceStart()); | |||
deEmphasis(true); | |||
Map<String, Object> dd = drag.getDropDetails(); |
@@ -448,14 +448,14 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, | |||
boolean cont = true; | |||
while (cont && scrollBody.getLastRendered() > optimalFirstRow | |||
&& scrollBody.getFirstRendered() < optimalFirstRow) { | |||
// client.console.log("removing row from start"); | |||
// removing row from start | |||
cont = scrollBody.unlinkRow(true); | |||
} | |||
final int optimalLastRow = (int) (firstRowInViewPort + pageLength + pageLength | |||
* cache_rate); | |||
cont = true; | |||
while (cont && scrollBody.getLastRendered() > optimalLastRow) { | |||
// client.console.log("removing row from the end"); | |||
// removing row from the end | |||
cont = scrollBody.unlinkRow(false); | |||
} | |||
scrollBody.fixSpacers(); |
@@ -215,9 +215,6 @@ public class VTree extends FlowPanel implements Paintable, VHasDropHandler { | |||
|| (detail == null && oldDetail != null); | |||
if (nodeHasChanged || detailHasChanded) { | |||
ApplicationConnection.getConsole().log( | |||
"Change in Transferable " + currentMouseOverKey | |||
+ " " + detail); | |||
final String newKey = currentMouseOverKey; | |||
TreeNode treeNode = keyToNode.get(oldIdOver); | |||
if (treeNode != null) { | |||
@@ -468,9 +465,6 @@ public class VTree extends FlowPanel implements Paintable, VHasDropHandler { | |||
if (nodeCaptionDiv.isOrHasChild(event.getTarget())) { | |||
if (dragMode > 0 | |||
&& event.getButton() == NativeEvent.BUTTON_LEFT) { | |||
ApplicationConnection.getConsole().log( | |||
"TreeNode m down"); | |||
event.preventDefault(); // prevent text selection | |||
mouseDownEvent = event; | |||
} | |||
@@ -479,8 +473,6 @@ public class VTree extends FlowPanel implements Paintable, VHasDropHandler { | |||
|| type == Event.ONMOUSEOUT) { | |||
if (mouseDownEvent != null) { | |||
ApplicationConnection.getConsole().log( | |||
"TreeNode drag start " + event.getType()); | |||
// start actual drag on slight move when mouse is down | |||
VTransferable t = new VTransferable(); | |||
t.setDragSource(VTree.this); |
@@ -73,8 +73,8 @@ public class VDragAndDropManager { | |||
// Util.browserDebugger(); | |||
targetElement = Util.getElementFromPoint(x, y); | |||
if (targetElement == null) { | |||
ApplicationConnection.getConsole().log( | |||
"Event on dragImage, ignored"); | |||
// ApplicationConnection.getConsole().log( | |||
// "Event on dragImage, ignored"); | |||
event.cancel(); | |||
nativeEvent.stopPropagation(); | |||
return; | |||
@@ -88,10 +88,10 @@ public class VDragAndDropManager { | |||
switch (typeInt) { | |||
case Event.ONMOUSEOVER: | |||
case Event.ONMOUSEOUT: | |||
ApplicationConnection | |||
.getConsole() | |||
.log( | |||
"IGNORING proxy image event, fired because of hack or not significant"); | |||
// ApplicationConnection | |||
// .getConsole() | |||
// .log( | |||
// "IGNORING proxy image event, fired because of hack or not significant"); | |||
return; | |||
case Event.ONMOUSEMOVE: | |||
VDropHandler findDragTarget = findDragTarget(targetElement); | |||
@@ -105,10 +105,10 @@ public class VDragAndDropManager { | |||
// dragenter on new | |||
currentDropHandler = findDragTarget; | |||
if (findDragTarget != null) { | |||
ApplicationConnection.getConsole().log( | |||
"DropHandler now" | |||
+ currentDropHandler | |||
.getPaintable()); | |||
// ApplicationConnection.getConsole().log( | |||
// "DropHandler now" | |||
// + currentDropHandler | |||
// .getPaintable()); | |||
} | |||
if (currentDropHandler != null) { | |||
@@ -127,9 +127,9 @@ public class VDragAndDropManager { | |||
default: | |||
// just update element over and let the actual | |||
// handling code do the thing | |||
ApplicationConnection.getConsole().log( | |||
"Target just modified on " | |||
+ event.getType()); | |||
// ApplicationConnection.getConsole().log( | |||
// "Target just modified on " | |||
// + event.getType()); | |||
currentDrag | |||
.setElementOver((com.google.gwt.user.client.Element) targetElement); | |||
break; | |||
@@ -137,8 +137,8 @@ public class VDragAndDropManager { | |||
} | |||
} catch (RuntimeException e) { | |||
ApplicationConnection.getConsole().log( | |||
"ERROR during elementFromPoint hack."); | |||
// ApplicationConnection.getConsole().log( | |||
// "ERROR during elementFromPoint hack."); | |||
throw e; | |||
} finally { | |||
dragElement.getStyle().setProperty("display", display); | |||
@@ -147,8 +147,6 @@ public class VDragAndDropManager { | |||
switch (typeInt) { | |||
case Event.ONMOUSEOVER: | |||
ApplicationConnection.getConsole().log( | |||
event.getNativeEvent().getType()); | |||
VDropHandler target = findDragTarget(targetElement); | |||
if (target != null && target != currentDropHandler) { | |||
@@ -158,28 +156,25 @@ public class VDragAndDropManager { | |||
} | |||
currentDropHandler = target; | |||
ApplicationConnection.getConsole().log( | |||
"DropHandler now" | |||
+ currentDropHandler.getPaintable()); | |||
// ApplicationConnection.getConsole().log( | |||
// "DropHandler now" | |||
// + currentDropHandler.getPaintable()); | |||
target.dragEnter(currentDrag); | |||
} else if (target == null && currentDropHandler != null) { | |||
ApplicationConnection.getConsole().log("Invalid state!?"); | |||
// ApplicationConnection.getConsole().log("Invalid state!?"); | |||
currentDropHandler.dragLeave(currentDrag); | |||
currentDrag.getDropDetails().clear(); | |||
currentDropHandler = null; | |||
} | |||
break; | |||
case Event.ONMOUSEOUT: | |||
ApplicationConnection.getConsole().log( | |||
event.getNativeEvent().getType()); | |||
Element relatedTarget = (Element) nativeEvent | |||
.getRelatedEventTarget().cast(); | |||
VDropHandler newDragHanler = findDragTarget(relatedTarget); | |||
if (dragElement != null | |||
&& dragElement.isOrHasChild(relatedTarget)) { | |||
ApplicationConnection.getConsole().log( | |||
"Mouse out of dragImage, ignored"); | |||
// ApplicationConnection.getConsole().log( | |||
// "Mouse out of dragImage, ignored"); | |||
return; | |||
} | |||
@@ -343,8 +338,6 @@ public class VDragAndDropManager { | |||
.getCurrentEventTarget() | |||
.cast())) { | |||
// drag image appeared below, ignore | |||
ApplicationConnection.getConsole().log( | |||
"Drag image appeared"); | |||
break; | |||
} | |||
case Event.ONKEYDOWN: | |||
@@ -362,8 +355,6 @@ public class VDragAndDropManager { | |||
.getRelatedEventTarget() | |||
.cast())) { | |||
// drag image appeared below, ignore | |||
ApplicationConnection.getConsole().log( | |||
"Drag image appeared"); | |||
break; | |||
} | |||
case Event.ONMOUSEMOVE: | |||
@@ -376,10 +367,6 @@ public class VDragAndDropManager { | |||
default: | |||
// on any other events, clean up the | |||
// deferred drag start | |||
ApplicationConnection.getConsole().log( | |||
"Drag did not start due event" | |||
+ event.getNativeEvent() | |||
.getType()); | |||
deferredStartRegistration.removeHandler(); | |||
deferredStartRegistration = null; | |||
@@ -430,22 +417,16 @@ public class VDragAndDropManager { | |||
} | |||
} | |||
if (w == null) { | |||
ApplicationConnection.getConsole().log( | |||
"No suitable DropHandler found2"); | |||
return null; | |||
} else { | |||
VDropHandler dh = ((VHasDropHandler) w).getDropHandler(); | |||
if (dh == null) { | |||
ApplicationConnection.getConsole().log( | |||
"No suitable DropHandler found3"); | |||
} | |||
return dh; | |||
} | |||
} catch (Exception e) { | |||
ApplicationConnection.getConsole().log( | |||
"FIXME: Exception when detecting drop handler"); | |||
e.printStackTrace(); | |||
// ApplicationConnection.getConsole().log( | |||
// "FIXME: Exception when detecting drop handler"); | |||
// e.printStackTrace(); | |||
return null; | |||
} | |||
@@ -529,8 +510,6 @@ public class VDragAndDropManager { | |||
private void doRequest(DragEventType drop) { | |||
if (currentDropHandler == null) { | |||
ApplicationConnection.getConsole().log( | |||
"DD request ignored, drop handler is null"); | |||
return; | |||
} | |||
Paintable paintable = currentDropHandler.getPaintable(); |
@@ -3,7 +3,6 @@ | |||
*/ | |||
package com.vaadin.terminal.gwt.client.ui.dd; | |||
import java.util.Date; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
@@ -36,8 +35,6 @@ public class VDragEvent { | |||
private int id; | |||
private Date start; | |||
private HashMap<String, Object> dropDetails = new HashMap<String, Object>(); | |||
private Element elementOver; | |||
@@ -46,7 +43,6 @@ public class VDragEvent { | |||
transferable = t; | |||
this.startEvent = startEvent; | |||
id = eventId++; | |||
start = new Date(); | |||
} | |||
public VTransferable getTransferable() { | |||
@@ -72,15 +68,6 @@ public class VDragEvent { | |||
return id; | |||
} | |||
/** | |||
* @deprecated will be removed from final implementation, here just to aid | |||
* development. | |||
*/ | |||
@Deprecated | |||
public long sinceStart() { | |||
return new Date().getTime() - start.getTime(); | |||
} | |||
/** | |||
* Detecting the element on which the the event is happening may be | |||
* problematic during drag and drop operation. This is especially the case |