visually marking widgets that accept drag-and-drop drops. (vaadin7)

In my application certain tables should accept drops from drag-and-drops others should not. I have the logic that distinguishes between the two group so I created my own com.vaadin.event.dd.acceptcriteria.AcceptCriterion implementation.

However my problem is the presence of the blue frame around the widget (when the cursor hovers over widget before mouse release) even if the MyOwnAccept instance returns false.

I would expect to see the blue frame around the table doing drag and drop ONLY when MyOwnAccept instance returns true. If it returns false the drop won’t be accepted anyway so
it should not mislead the user with the blue frame as it were a legitimate object to drop on.

The code is below. What else should I override, or am I on completely wrong path[code]
public class MyOwnAccept implements AcceptCriterion {

@Override
public boolean isClientSideVerifiable() {
    return AcceptAll.get().isClientSideVerifiable();
}

@Override
public void paint(PaintTarget target) throws PaintException {
    AcceptAll.get().paint(target);
}

@Override
public void paintResponse(PaintTarget target) throws PaintException {
    AcceptAll.get().paint(target);
}

@Override
public boolean accept(DragAndDropEvent dragEvent) {
    final DataBoundTransferable t = (DataBoundTransferable) dragEvent.getTransferable();
    final Object sourceItemId = t.getItemId();

    Table fromTable = null;
    Component from = t.getSourceComponent();

    Table targetTable = null;
    Component target = dragEvent.getTargetDetails().getTarget();

    if (from instanceof Table && target instanceof Table) {
        targetTable = ((Table) target);
        fromTable = ((Table) from);
        Item item = fromTable.getItem(sourceItemId);
        String currency = null;
        String amountOrCount = null;

        String name = targetTable.getCaption();
        if (!StringUtils.isBlank(name)) {
            String[] arr = name.split(Helper.SLASH);
            currency = arr[0]

;
amountOrCount = arr[1]
;
if ((currency != null && amountOrCount != null) && (item.toString().contains(currency) && item.toString().contains(amountOrCount))) {
if (!targetTable.equals(fromTable)) {
return true;
}
}
}
}
return false;
}
}
[/code]

There is addon with similar functionality:
https://vaadin.com/directory#addon/dragdroplayouts:vaadin

Thank you for the answer. I tried it, however I still have no idea how can it help me to acheive the above mentioned goal

Take a look dashboard example:

http://dashboard.demo.vaadin.com/#!reports

When you click on the “Create new”, there is a drag and drop functionality. Take item from top bar and you see blue box around drop field. Look into sources at github and see how they implemented that.