You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

VSourceIsTarget.java 696B

123456789101112131415161718192021222324
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. /**
  5. *
  6. */
  7. package com.vaadin.terminal.gwt.client.ui.dd;
  8. import com.vaadin.event.dd.acceptcriteria.SourceIsTarget;
  9. import com.vaadin.terminal.gwt.client.ComponentConnector;
  10. import com.vaadin.terminal.gwt.client.UIDL;
  11. @AcceptCriterion(SourceIsTarget.class)
  12. final public class VSourceIsTarget extends VAcceptCriterion {
  13. @Override
  14. protected boolean accept(VDragEvent drag, UIDL configuration) {
  15. ComponentConnector dragSource = drag.getTransferable().getDragSource();
  16. ComponentConnector paintable = VDragAndDropManager.get()
  17. .getCurrentDropHandler().getConnector();
  18. return paintable == dragSource;
  19. }
  20. }