Class DnDImportUtils

java.lang.Object
com.levigo.jadice.web.client.tools.dnd.DnDImportUtils

public class DnDImportUtils extends Object
Helper class to handle common import actions.
  • Constructor Details

    • DnDImportUtils

      public DnDImportUtils()
  • Method Details

    • getDropEffectByKeys

      public static com.google.gwt.dom.client.DataTransfer.DropEffect getDropEffectByKeys(DnDParameter parameter)
      Returns the matching DataTransfer.DropEffect by the keys that are pressed.
      • No key = MOVE
      • CTRL = COPY
      • CTRL + SHIFT = LINK
      The keys for the DataTransfer.DropEffect are based on given standards. To get the correct effect while dragging for example between the browser and a java application the same keys have to be used to define the effect. Otherwise the effect would not be reliable as feedback of the accepted action in a cross application drag and drop.
      Parameters:
      parameter - The parameters used for the import
      Returns:
      The to the pressed keys matching dropEffect.
    • datastoreHasType

      public static boolean datastoreHasType(com.google.gwt.dom.client.NativeEvent event, String type)
      Checks if the datastore of the event contains the given type. We cannot check the content of the type but we can check the presence of the type.
      Parameters:
      event - The event which holds the datastore to check
      type - The type to search for
      Returns:
      True if the datastore contains the type, false otherwise