类java.awt.datatransfer.FlavorTable源码实例Demo

下面列出了怎么用java.awt.datatransfer.FlavorTable的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Bytecoder   文件: DataTransferer.java
/**
 * Returns a Set of all DataFlavors for which
 * 1) a mapping from at least one of the specified formats exists in the
 * specified map and
 * 2) the data translation for this mapping can be performed by the data
 * transfer subsystem.
 *
 * @param formats the data formats
 * @param map the FlavorTable which contains mappings between
 *            DataFlavors and data formats
 * @throws NullPointerException if formats or map is {@code null}
 */
public Set<DataFlavor> getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
    Set<DataFlavor> flavorSet = new HashSet<>(formats.length);

    for (long format : formats) {
        List<DataFlavor> flavors = map.getFlavorsForNative(getNativeForFormat(format));
        for (DataFlavor flavor : flavors) {
            // Don't explicitly test for String, since it is just a special
            // case of Serializable
            if (flavor.isFlavorTextType() ||
                    flavor.isFlavorJavaFileListType() ||
                    DataFlavor.imageFlavor.equals(flavor) ||
                    flavor.isRepresentationClassSerializable() ||
                    flavor.isRepresentationClassInputStream() ||
                    flavor.isRepresentationClassRemote()) {
                flavorSet.add(flavor);
            }
        }
    }

    return flavorSet;
}
 
源代码2 项目: dragonwell8_jdk   文件: DataTransferer.java
/**
 * Returns a Map whose keys are all of the possible formats into which the
 * Transferable's transfer data flavors can be translated. The value of
 * each key is the DataFlavor in which the Transferable's data should be
 * requested when converting to the format.
 * <p>
 * The map keys are sorted according to the native formats preference
 * order.
 */
public SortedMap<Long,DataFlavor> getFormatsForTransferable(
                           Transferable contents, FlavorTable map)
{
    DataFlavor[] flavors = contents.getTransferDataFlavors();
    if (flavors == null) {
        return new TreeMap();
    }
    return getFormatsForFlavors(flavors, map);
}
 
源代码3 项目: openjdk-8-source   文件: DataFlavorSearcher.java
static public DataFlavor getByteDataFlavorForNative(String[] nats) {
    FlavorTable flavorTable = (FlavorTable) SystemFlavorMap.getDefaultFlavorMap();

    for (String nat : nats) {
        java.util.List<DataFlavor> flavors = flavorTable.getFlavorsForNative(nat);
        for (DataFlavor flavor : flavors) {
            if (flavor != null
                    && flavor.getRepresentationClass().equals(byte[].class)) {
                return flavor;
            }
        }
    }
    throw new RuntimeException("No data flavor was found for natives: " + Arrays.toString(nats));
}
 
源代码4 项目: dragonwell8_jdk   文件: DataTransferer.java
/**
 * Returns a Set of all DataFlavors for which
 * 1) a mapping from at least one of the specified formats exists in the
 * specified map and
 * 2) the data translation for this mapping can be performed by the data
 * transfer subsystem.
 *
 * @param formats the data formats
 * @param map the FlavorTable which contains mappings between
 *            DataFlavors and data formats
 * @throws NullPointerException if formats or map is <code>null</code>
 */
public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
    Set flavorSet = new HashSet(formats.length);

    for (int i = 0; i < formats.length; i++) {
        String nat = getNativeForFormat(formats[i]);
        List flavors = map.getFlavorsForNative(nat);

        for (Iterator iter = flavors.iterator(); iter.hasNext(); ) {
            DataFlavor flavor = (DataFlavor)iter.next();

            // Don't explicitly test for String, since it is just a special
            // case of Serializable
            if (flavor.isFlavorTextType() ||
                flavor.isFlavorJavaFileListType() ||
                DataFlavor.imageFlavor.equals(flavor) ||
                flavor.isRepresentationClassSerializable() ||
                flavor.isRepresentationClassInputStream() ||
                flavor.isRepresentationClassRemote())
            {
                flavorSet.add(flavor);
            }
        }
    }

    return flavorSet;
}
 
源代码5 项目: jdk8u_jdk   文件: WDataTransferer.java
@Override
public SortedMap <Long, DataFlavor> getFormatsForFlavors(
        DataFlavor[] flavors, FlavorTable map)
{
    SortedMap <Long, DataFlavor> retval =
            super.getFormatsForFlavors(flavors, map);

    // The Win32 native code does not support exporting LOCALE data, nor
    // should it.
    retval.remove(L_CF_LOCALE);

    return retval;
}
 
源代码6 项目: jdk8u-dev-jdk   文件: DataTransferer.java
/**
 * Returns a Map whose keys are all of the possible formats into which the
 * Transferable's transfer data flavors can be translated. The value of
 * each key is the DataFlavor in which the Transferable's data should be
 * requested when converting to the format.
 * <p>
 * The map keys are sorted according to the native formats preference
 * order.
 */
public SortedMap<Long,DataFlavor> getFormatsForTransferable(
                           Transferable contents, FlavorTable map)
{
    DataFlavor[] flavors = contents.getTransferDataFlavors();
    if (flavors == null) {
        return new TreeMap();
    }
    return getFormatsForFlavors(flavors, map);
}
 
源代码7 项目: TencentKona-8   文件: DataTransferer.java
/**
 * Returns a Map whose keys are all of the possible formats into which the
 * Transferable's transfer data flavors can be translated. The value of
 * each key is the DataFlavor in which the Transferable's data should be
 * requested when converting to the format.
 * <p>
 * The map keys are sorted according to the native formats preference
 * order.
 */
public SortedMap<Long,DataFlavor> getFormatsForTransferable(
                           Transferable contents, FlavorTable map)
{
    DataFlavor[] flavors = contents.getTransferDataFlavors();
    if (flavors == null) {
        return new TreeMap();
    }
    return getFormatsForFlavors(flavors, map);
}
 
源代码8 项目: hottub   文件: DataTransferer.java
/**
 * Returns a Set of all DataFlavors for which
 * 1) a mapping from at least one of the specified formats exists in the
 * specified map and
 * 2) the data translation for this mapping can be performed by the data
 * transfer subsystem.
 *
 * @param formats the data formats
 * @param map the FlavorTable which contains mappings between
 *            DataFlavors and data formats
 * @throws NullPointerException if formats or map is <code>null</code>
 */
public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
    Set flavorSet = new HashSet(formats.length);

    for (int i = 0; i < formats.length; i++) {
        String nat = getNativeForFormat(formats[i]);
        List flavors = map.getFlavorsForNative(nat);

        for (Iterator iter = flavors.iterator(); iter.hasNext(); ) {
            DataFlavor flavor = (DataFlavor)iter.next();

            // Don't explicitly test for String, since it is just a special
            // case of Serializable
            if (flavor.isFlavorTextType() ||
                flavor.isFlavorJavaFileListType() ||
                DataFlavor.imageFlavor.equals(flavor) ||
                flavor.isRepresentationClassSerializable() ||
                flavor.isRepresentationClassInputStream() ||
                flavor.isRepresentationClassRemote())
            {
                flavorSet.add(flavor);
            }
        }
    }

    return flavorSet;
}
 
源代码9 项目: TencentKona-8   文件: DataTransferer.java
/**
 * Returns a Set of all DataFlavors for which
 * 1) a mapping from at least one of the specified formats exists in the
 * specified map and
 * 2) the data translation for this mapping can be performed by the data
 * transfer subsystem.
 *
 * @param formats the data formats
 * @param map the FlavorTable which contains mappings between
 *            DataFlavors and data formats
 * @throws NullPointerException if formats or map is <code>null</code>
 */
public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
    Set flavorSet = new HashSet(formats.length);

    for (int i = 0; i < formats.length; i++) {
        String nat = getNativeForFormat(formats[i]);
        List flavors = map.getFlavorsForNative(nat);

        for (Iterator iter = flavors.iterator(); iter.hasNext(); ) {
            DataFlavor flavor = (DataFlavor)iter.next();

            // Don't explicitly test for String, since it is just a special
            // case of Serializable
            if (flavor.isFlavorTextType() ||
                flavor.isFlavorJavaFileListType() ||
                DataFlavor.imageFlavor.equals(flavor) ||
                flavor.isRepresentationClassSerializable() ||
                flavor.isRepresentationClassInputStream() ||
                flavor.isRepresentationClassRemote())
            {
                flavorSet.add(flavor);
            }
        }
    }

    return flavorSet;
}
 
源代码10 项目: openjdk-8   文件: DataTransferer.java
/**
 * Returns a Set of all DataFlavors for which
 * 1) a mapping from at least one of the specified formats exists in the
 * specified map and
 * 2) the data translation for this mapping can be performed by the data
 * transfer subsystem.
 *
 * @param formats the data formats
 * @param map the FlavorTable which contains mappings between
 *            DataFlavors and data formats
 * @throws NullPointerException if formats or map is <code>null</code>
 */
public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
    Set flavorSet = new HashSet(formats.length);

    for (int i = 0; i < formats.length; i++) {
        String nat = getNativeForFormat(formats[i]);
        List flavors = map.getFlavorsForNative(nat);

        for (Iterator iter = flavors.iterator(); iter.hasNext(); ) {
            DataFlavor flavor = (DataFlavor)iter.next();

            // Don't explicitly test for String, since it is just a special
            // case of Serializable
            if (flavor.isFlavorTextType() ||
                flavor.isFlavorJavaFileListType() ||
                DataFlavor.imageFlavor.equals(flavor) ||
                flavor.isRepresentationClassSerializable() ||
                flavor.isRepresentationClassInputStream() ||
                flavor.isRepresentationClassRemote())
            {
                flavorSet.add(flavor);
            }
        }
    }

    return flavorSet;
}
 
源代码11 项目: TencentKona-8   文件: DataFlavorSearcher.java
static public DataFlavor getByteDataFlavorForNative(String[] nats) {
    FlavorTable flavorTable = (FlavorTable) SystemFlavorMap.getDefaultFlavorMap();

    for (String nat : nats) {
        java.util.List<DataFlavor> flavors = flavorTable.getFlavorsForNative(nat);
        for (DataFlavor flavor : flavors) {
            if (flavor != null
                    && flavor.getRepresentationClass().equals(byte[].class)) {
                return flavor;
            }
        }
    }
    throw new RuntimeException("No data flavor was found for natives: " + Arrays.toString(nats));
}
 
源代码12 项目: jdk8u60   文件: DataTransferer.java
/**
 * Returns a Map whose keys are all of the possible formats into which the
 * Transferable's transfer data flavors can be translated. The value of
 * each key is the DataFlavor in which the Transferable's data should be
 * requested when converting to the format.
 * <p>
 * The map keys are sorted according to the native formats preference
 * order.
 */
public SortedMap<Long,DataFlavor> getFormatsForTransferable(
                           Transferable contents, FlavorTable map)
{
    DataFlavor[] flavors = contents.getTransferDataFlavors();
    if (flavors == null) {
        return new TreeMap();
    }
    return getFormatsForFlavors(flavors, map);
}
 
源代码13 项目: jdk8u-dev-jdk   文件: WDataTransferer.java
@Override
public SortedMap <Long, DataFlavor> getFormatsForFlavors(
        DataFlavor[] flavors, FlavorTable map)
{
    SortedMap <Long, DataFlavor> retval =
            super.getFormatsForFlavors(flavors, map);

    // The Win32 native code does not support exporting LOCALE data, nor
    // should it.
    retval.remove(L_CF_LOCALE);

    return retval;
}
 
源代码14 项目: hottub   文件: DataFlavorSearcher.java
static public DataFlavor getByteDataFlavorForNative(String[] nats) {
    FlavorTable flavorTable = (FlavorTable) SystemFlavorMap.getDefaultFlavorMap();

    for (String nat : nats) {
        java.util.List<DataFlavor> flavors = flavorTable.getFlavorsForNative(nat);
        for (DataFlavor flavor : flavors) {
            if (flavor != null
                    && flavor.getRepresentationClass().equals(byte[].class)) {
                return flavor;
            }
        }
    }
    throw new RuntimeException("No data flavor was found for natives: " + Arrays.toString(nats));
}
 
源代码15 项目: jdk8u-jdk   文件: DataTransferer.java
/**
 * Returns a Set of all DataFlavors for which
 * 1) a mapping from at least one of the specified formats exists in the
 * specified map and
 * 2) the data translation for this mapping can be performed by the data
 * transfer subsystem.
 *
 * @param formats the data formats
 * @param map the FlavorTable which contains mappings between
 *            DataFlavors and data formats
 * @throws NullPointerException if formats or map is <code>null</code>
 */
public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
    Set flavorSet = new HashSet(formats.length);

    for (int i = 0; i < formats.length; i++) {
        String nat = getNativeForFormat(formats[i]);
        List flavors = map.getFlavorsForNative(nat);

        for (Iterator iter = flavors.iterator(); iter.hasNext(); ) {
            DataFlavor flavor = (DataFlavor)iter.next();

            // Don't explicitly test for String, since it is just a special
            // case of Serializable
            if (flavor.isFlavorTextType() ||
                flavor.isFlavorJavaFileListType() ||
                DataFlavor.imageFlavor.equals(flavor) ||
                flavor.isRepresentationClassSerializable() ||
                flavor.isRepresentationClassInputStream() ||
                flavor.isRepresentationClassRemote())
            {
                flavorSet.add(flavor);
            }
        }
    }

    return flavorSet;
}
 
源代码16 项目: jdk8u60   文件: DataTransferer.java
/**
 * Returns a Set of all DataFlavors for which
 * 1) a mapping from at least one of the specified formats exists in the
 * specified map and
 * 2) the data translation for this mapping can be performed by the data
 * transfer subsystem.
 *
 * @param formats the data formats
 * @param map the FlavorTable which contains mappings between
 *            DataFlavors and data formats
 * @throws NullPointerException if formats or map is <code>null</code>
 */
public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
    Set flavorSet = new HashSet(formats.length);

    for (int i = 0; i < formats.length; i++) {
        String nat = getNativeForFormat(formats[i]);
        List flavors = map.getFlavorsForNative(nat);

        for (Iterator iter = flavors.iterator(); iter.hasNext(); ) {
            DataFlavor flavor = (DataFlavor)iter.next();

            // Don't explicitly test for String, since it is just a special
            // case of Serializable
            if (flavor.isFlavorTextType() ||
                flavor.isFlavorJavaFileListType() ||
                DataFlavor.imageFlavor.equals(flavor) ||
                flavor.isRepresentationClassSerializable() ||
                flavor.isRepresentationClassInputStream() ||
                flavor.isRepresentationClassRemote())
            {
                flavorSet.add(flavor);
            }
        }
    }

    return flavorSet;
}
 
源代码17 项目: jdk8u-dev-jdk   文件: DataFlavorSearcher.java
static public DataFlavor getByteDataFlavorForNative(String[] nats) {
    FlavorTable flavorTable = (FlavorTable) SystemFlavorMap.getDefaultFlavorMap();

    for (String nat : nats) {
        java.util.List<DataFlavor> flavors = flavorTable.getFlavorsForNative(nat);
        for (DataFlavor flavor : flavors) {
            if (flavor != null
                    && flavor.getRepresentationClass().equals(byte[].class)) {
                return flavor;
            }
        }
    }
    throw new RuntimeException("No data flavor was found for natives: " + Arrays.toString(nats));
}
 
源代码18 项目: openjdk-jdk8u   文件: DataTransferer.java
/**
 * Returns a Map whose keys are all of the possible formats into which the
 * Transferable's transfer data flavors can be translated. The value of
 * each key is the DataFlavor in which the Transferable's data should be
 * requested when converting to the format.
 * <p>
 * The map keys are sorted according to the native formats preference
 * order.
 */
public SortedMap<Long,DataFlavor> getFormatsForTransferable(
                           Transferable contents, FlavorTable map)
{
    DataFlavor[] flavors = contents.getTransferDataFlavors();
    if (flavors == null) {
        return new TreeMap();
    }
    return getFormatsForFlavors(flavors, map);
}
 
源代码19 项目: openjdk-jdk8u   文件: DataTransferer.java
/**
 * Returns a Set of all DataFlavors for which
 * 1) a mapping from at least one of the specified formats exists in the
 * specified map and
 * 2) the data translation for this mapping can be performed by the data
 * transfer subsystem.
 *
 * @param formats the data formats
 * @param map the FlavorTable which contains mappings between
 *            DataFlavors and data formats
 * @throws NullPointerException if formats or map is <code>null</code>
 */
public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
    Set flavorSet = new HashSet(formats.length);

    for (int i = 0; i < formats.length; i++) {
        String nat = getNativeForFormat(formats[i]);
        List flavors = map.getFlavorsForNative(nat);

        for (Iterator iter = flavors.iterator(); iter.hasNext(); ) {
            DataFlavor flavor = (DataFlavor)iter.next();

            // Don't explicitly test for String, since it is just a special
            // case of Serializable
            if (flavor.isFlavorTextType() ||
                flavor.isFlavorJavaFileListType() ||
                DataFlavor.imageFlavor.equals(flavor) ||
                flavor.isRepresentationClassSerializable() ||
                flavor.isRepresentationClassInputStream() ||
                flavor.isRepresentationClassRemote())
            {
                flavorSet.add(flavor);
            }
        }
    }

    return flavorSet;
}
 
源代码20 项目: jdk8u-jdk   文件: WDataTransferer.java
@Override
public SortedMap <Long, DataFlavor> getFormatsForFlavors(
        DataFlavor[] flavors, FlavorTable map)
{
    SortedMap <Long, DataFlavor> retval =
            super.getFormatsForFlavors(flavors, map);

    // The Win32 native code does not support exporting LOCALE data, nor
    // should it.
    retval.remove(L_CF_LOCALE);

    return retval;
}
 
源代码21 项目: hottub   文件: DataTransferer.java
/**
 * Returns a Map whose keys are all of the possible formats into which the
 * Transferable's transfer data flavors can be translated. The value of
 * each key is the DataFlavor in which the Transferable's data should be
 * requested when converting to the format.
 * <p>
 * The map keys are sorted according to the native formats preference
 * order.
 */
public SortedMap<Long,DataFlavor> getFormatsForTransferable(
                           Transferable contents, FlavorTable map)
{
    DataFlavor[] flavors = contents.getTransferDataFlavors();
    if (flavors == null) {
        return new TreeMap();
    }
    return getFormatsForFlavors(flavors, map);
}
 
源代码22 项目: openjdk-jdk8u-backup   文件: DataTransferer.java
/**
 * Returns a Map whose keys are all of the possible formats into which the
 * Transferable's transfer data flavors can be translated. The value of
 * each key is the DataFlavor in which the Transferable's data should be
 * requested when converting to the format.
 * <p>
 * The map keys are sorted according to the native formats preference
 * order.
 */
public SortedMap<Long,DataFlavor> getFormatsForTransferable(
                           Transferable contents, FlavorTable map)
{
    DataFlavor[] flavors = contents.getTransferDataFlavors();
    if (flavors == null) {
        return new TreeMap();
    }
    return getFormatsForFlavors(flavors, map);
}
 
源代码23 项目: jdk8u-jdk   文件: DataFlavorSearcher.java
static public DataFlavor getByteDataFlavorForNative(String[] nats) {
    FlavorTable flavorTable = (FlavorTable) SystemFlavorMap.getDefaultFlavorMap();

    for (String nat : nats) {
        java.util.List<DataFlavor> flavors = flavorTable.getFlavorsForNative(nat);
        for (DataFlavor flavor : flavors) {
            if (flavor != null
                    && flavor.getRepresentationClass().equals(byte[].class)) {
                return flavor;
            }
        }
    }
    throw new RuntimeException("No data flavor was found for natives: " + Arrays.toString(nats));
}
 
源代码24 项目: jdk8u-dev-jdk   文件: DataTransferer.java
/**
 * Returns a Set of all DataFlavors for which
 * 1) a mapping from at least one of the specified formats exists in the
 * specified map and
 * 2) the data translation for this mapping can be performed by the data
 * transfer subsystem.
 *
 * @param formats the data formats
 * @param map the FlavorTable which contains mappings between
 *            DataFlavors and data formats
 * @throws NullPointerException if formats or map is <code>null</code>
 */
public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
    Set flavorSet = new HashSet(formats.length);

    for (int i = 0; i < formats.length; i++) {
        String nat = getNativeForFormat(formats[i]);
        List flavors = map.getFlavorsForNative(nat);

        for (Iterator iter = flavors.iterator(); iter.hasNext(); ) {
            DataFlavor flavor = (DataFlavor)iter.next();

            // Don't explicitly test for String, since it is just a special
            // case of Serializable
            if (flavor.isFlavorTextType() ||
                flavor.isFlavorJavaFileListType() ||
                DataFlavor.imageFlavor.equals(flavor) ||
                flavor.isRepresentationClassSerializable() ||
                flavor.isRepresentationClassInputStream() ||
                flavor.isRepresentationClassRemote())
            {
                flavorSet.add(flavor);
            }
        }
    }

    return flavorSet;
}
 
源代码25 项目: openjdk-jdk8u-backup   文件: DataTransferer.java
/**
 * Returns a Set of all DataFlavors for which
 * 1) a mapping from at least one of the specified formats exists in the
 * specified map and
 * 2) the data translation for this mapping can be performed by the data
 * transfer subsystem.
 *
 * @param formats the data formats
 * @param map the FlavorTable which contains mappings between
 *            DataFlavors and data formats
 * @throws NullPointerException if formats or map is <code>null</code>
 */
public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
    Set flavorSet = new HashSet(formats.length);

    for (int i = 0; i < formats.length; i++) {
        String nat = getNativeForFormat(formats[i]);
        List flavors = map.getFlavorsForNative(nat);

        for (Iterator iter = flavors.iterator(); iter.hasNext(); ) {
            DataFlavor flavor = (DataFlavor)iter.next();

            // Don't explicitly test for String, since it is just a special
            // case of Serializable
            if (flavor.isFlavorTextType() ||
                flavor.isFlavorJavaFileListType() ||
                DataFlavor.imageFlavor.equals(flavor) ||
                flavor.isRepresentationClassSerializable() ||
                flavor.isRepresentationClassInputStream() ||
                flavor.isRepresentationClassRemote())
            {
                flavorSet.add(flavor);
            }
        }
    }

    return flavorSet;
}
 
源代码26 项目: openjdk-8   文件: DataTransferer.java
/**
 * Returns a Map whose keys are all of the possible formats into which the
 * Transferable's transfer data flavors can be translated. The value of
 * each key is the DataFlavor in which the Transferable's data should be
 * requested when converting to the format.
 * <p>
 * The map keys are sorted according to the native formats preference
 * order.
 */
public SortedMap<Long,DataFlavor> getFormatsForTransferable(
                           Transferable contents, FlavorTable map)
{
    DataFlavor[] flavors = contents.getTransferDataFlavors();
    if (flavors == null) {
        return new TreeMap();
    }
    return getFormatsForFlavors(flavors, map);
}
 
源代码27 项目: openjdk-jdk8u-backup   文件: WDataTransferer.java
@Override
public SortedMap <Long, DataFlavor> getFormatsForFlavors(
        DataFlavor[] flavors, FlavorTable map)
{
    SortedMap <Long, DataFlavor> retval =
            super.getFormatsForFlavors(flavors, map);

    // The Win32 native code does not support exporting LOCALE data, nor
    // should it.
    retval.remove(L_CF_LOCALE);

    return retval;
}
 
源代码28 项目: openjdk-jdk8u-backup   文件: DataFlavorSearcher.java
static public DataFlavor getByteDataFlavorForNative(String[] nats) {
    FlavorTable flavorTable = (FlavorTable) SystemFlavorMap.getDefaultFlavorMap();

    for (String nat : nats) {
        java.util.List<DataFlavor> flavors = flavorTable.getFlavorsForNative(nat);
        for (DataFlavor flavor : flavors) {
            if (flavor != null
                    && flavor.getRepresentationClass().equals(byte[].class)) {
                return flavor;
            }
        }
    }
    throw new RuntimeException("No data flavor was found for natives: " + Arrays.toString(nats));
}
 
源代码29 项目: Bytecoder   文件: DataTransferer.java
/**
 * Returns a Map whose keys are all of the possible formats into which the
 * Transferable's transfer data flavors can be translated. The value of
 * each key is the DataFlavor in which the Transferable's data should be
 * requested when converting to the format.
 * <p>
 * The map keys are sorted according to the native formats preference
 * order.
 */
public SortedMap<Long,DataFlavor> getFormatsForTransferable(Transferable contents,
                                                            FlavorTable map)
{
    DataFlavor[] flavors = contents.getTransferDataFlavors();
    if (flavors == null) {
        return Collections.emptySortedMap();
    }
    return getFormatsForFlavors(flavors, map);
}
 
源代码30 项目: openjdk-jdk9   文件: WDataTransferer.java
@Override
public SortedMap <Long, DataFlavor> getFormatsForFlavors(
        DataFlavor[] flavors, FlavorTable map)
{
    SortedMap <Long, DataFlavor> retval =
            super.getFormatsForFlavors(flavors, map);

    // The Win32 native code does not support exporting LOCALE data, nor
    // should it.
    retval.remove(L_CF_LOCALE);

    return retval;
}
 
 类所在包
 同包方法