Class FixedURLTransfer


  • public class FixedURLTransfer
    extends org.eclipse.swt.dnd.ByteArrayTransfer
    URL Transfer type for Drag and Drop of URLs Windows IDs are already functional. Please use Win32TransferTypes to determine the IDs for other OSes!
    See Also:
    com.biglybt.ui.swt.test.Win32TransferTypes
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private FixedURLTransfer()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private FixedURLTransfer.URLType bytebufferToJava​(byte[] buffer)  
      static FixedURLTransfer getInstance()  
      org.eclipse.swt.dnd.TransferData[] getSupportedTypes()  
      protected int[] getTypeIds()  
      protected java.lang.String[] getTypeNames()  
      private static boolean isResultOk​(org.eclipse.swt.dnd.TransferData transferData)  
      boolean isSupportedType​(org.eclipse.swt.dnd.TransferData transferData)  
      void javaToNative​(java.lang.Object object, org.eclipse.swt.dnd.TransferData transferData)  
      static void main​(java.lang.String[] args)
      Test for various UTF Strings BOM information from http://www.unicode.org/faq/utf_bom.html
      java.lang.Object nativeToJava​(org.eclipse.swt.dnd.TransferData transferData)  
      static org.eclipse.swt.dnd.TransferData pickBestType​(org.eclipse.swt.dnd.TransferData[] dataTypes, org.eclipse.swt.dnd.TransferData def)
      Sometimes, CF_Text will be in currentDataType even though CF_UNICODETEXT is present.
      private static void setResultField​(org.eclipse.swt.dnd.TransferData transferData, boolean ok)  
      • Methods inherited from class org.eclipse.swt.dnd.Transfer

        registerType, validate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • supportedTypeNames

        private java.lang.String[] supportedTypeNames
      • supportedTypeIDs

        private int[] supportedTypeIDs
      • bCheckingString

        private boolean bCheckingString
        We are in the process of checking a string to see if it's a valid URL
      • DEBUG

        private static boolean DEBUG
      • DISABLED

        private static boolean DISABLED
      • ourSupportedTypeNames

        private static final java.lang.String[] ourSupportedTypeNames
      • ourSupportedTypeIds

        private static final int[] ourSupportedTypeIds
      • field_TransferData_result

        private static java.lang.reflect.Field field_TransferData_result
      • urlTransfer

        org.eclipse.swt.dnd.URLTransfer urlTransfer
    • Constructor Detail

      • FixedURLTransfer

        private FixedURLTransfer()
    • Method Detail

      • javaToNative

        public void javaToNative​(java.lang.Object object,
                                 org.eclipse.swt.dnd.TransferData transferData)
        Overrides:
        javaToNative in class org.eclipse.swt.dnd.ByteArrayTransfer
      • nativeToJava

        public java.lang.Object nativeToJava​(org.eclipse.swt.dnd.TransferData transferData)
        Overrides:
        nativeToJava in class org.eclipse.swt.dnd.ByteArrayTransfer
      • getTypeNames

        protected java.lang.String[] getTypeNames()
        Specified by:
        getTypeNames in class org.eclipse.swt.dnd.Transfer
      • getTypeIds

        protected int[] getTypeIds()
        Specified by:
        getTypeIds in class org.eclipse.swt.dnd.Transfer
      • isSupportedType

        public boolean isSupportedType​(org.eclipse.swt.dnd.TransferData transferData)
        Overrides:
        isSupportedType in class org.eclipse.swt.dnd.ByteArrayTransfer
        Parameters:
        transferData -
        Returns:
        See Also:
        Transfer.isSupportedType(org.eclipse.swt.dnd.TransferData)
      • getSupportedTypes

        public org.eclipse.swt.dnd.TransferData[] getSupportedTypes()
        Overrides:
        getSupportedTypes in class org.eclipse.swt.dnd.ByteArrayTransfer
      • pickBestType

        public static org.eclipse.swt.dnd.TransferData pickBestType​(org.eclipse.swt.dnd.TransferData[] dataTypes,
                                                                    org.eclipse.swt.dnd.TransferData def)
        Sometimes, CF_Text will be in currentDataType even though CF_UNICODETEXT is present. This is a workaround until its fixed properly.

        Place it in dropAccept

        if (event.data instanceof URLTransfer.URLType)
                event.currentDataType = URLTransfer.pickBestType(event.dataTypes, event.currentDataType);
         
        Parameters:
        dataTypes -
        def -
        Returns:
      • main

        public static void main​(java.lang.String[] args)
        Test for various UTF Strings BOM information from http://www.unicode.org/faq/utf_bom.html
        Parameters:
        args -
      • isResultOk

        private static boolean isResultOk​(org.eclipse.swt.dnd.TransferData transferData)
      • setResultField

        private static void setResultField​(org.eclipse.swt.dnd.TransferData transferData,
                                           boolean ok)