blob: c492f3c2596b49bb3cac6d34e94b038d18dcfa75 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/*
@ITMillApache2LicenseForJavaFiles@
*/
/**
*
*/
package com.vaadin.event.dd.acceptCriteria;
import com.vaadin.event.DataBoundTransferable;
import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.terminal.gwt.client.ui.dd.VDataBound;
/**
* TODO Javadoc
*
* @since 6.3
*
*/
@ClientCriterion(VDataBound.class)
public final class IsDataBound extends ClientSideCriterion {
private static IsDataBound singleton = new IsDataBound();
private IsDataBound() {
}
public static IsDataBound get() {
return singleton;
}
public boolean accepts(DragAndDropEvent dragEvent) {
if (dragEvent.getTransferable() instanceof DataBoundTransferable) {
return ((DataBoundTransferable) dragEvent.getTransferable())
.getItemId() != null;
}
return false;
}
}
|