Top Description Fields Constructors Methods
sun.awt.datatransfer

public Class DesktopDatatransferServiceImpl

extends Object
implements DesktopDatatransferService
Class Inheritance
All Implemented Interfaces
sun.datatransfer.DesktopDatatransferService
Imports
sun.awt.AppContext, sun.datatransfer.DesktopDatatransferService, java.awt.EventQueue, java.awt.datatransfer.DataFlavor, .FlavorMap, java.util.LinkedHashSet, java.util.function.Supplier

Provides desktop services to the datatransfer module according to DesktopDatatransferService interface.
Author
Petr Pchelko
Since
9

Field Summary

Modifier and TypeField and Description
private static final Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getDefaultUnicodeEncoding()

Implements sun.datatransfer.DesktopDatatransferService.getDefaultUnicodeEncoding.

Get a platform-dependent default unicode encoding to use in datatransfer system.

public FlavorMap
getFlavorMap(Supplier<FlavorMap>
a constructor that should be used to create a new instance of the FlavorMap
supplier
)

Implements sun.datatransfer.DesktopDatatransferService.getFlavorMap.

Takes an appropriate FlavorMap from the desktop.

public LinkedHashSet<String>
getPlatformMappingsForFlavor(DataFlavor
DataFlavor to return mappings for
df
)

Implements sun.datatransfer.DesktopDatatransferService.getPlatformMappingsForFlavor.

Returns platform-specific mappings for the specified flavor.

public LinkedHashSet<DataFlavor>
getPlatformMappingsForNative(String
a native format to return flavors for
nat
)

Implements sun.datatransfer.DesktopDatatransferService.getPlatformMappingsForNative.

Returns platform-specific mappings for the specified native format.

public void
invokeOnEventThread(Runnable
a Runnable to invoke
r
)

Implements sun.datatransfer.DesktopDatatransferService.invokeOnEventThread.

If desktop is present - invokes a Runnable on the event dispatch thread.

public boolean
public void
registerTextFlavorProperties(String nat, String charset, String eoln, String terminators)

Implements sun.datatransfer.DesktopDatatransferService.registerTextFlavorProperties.

This method is called for text flavor mappings established while parsing the default flavor mappings file.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FLAVOR_MAP_KEYback to summary
private static final Object FLAVOR_MAP_KEY

Constructor Detail

DesktopDatatransferServiceImplback to summary
public DesktopDatatransferServiceImpl()

Method Detail

getDefaultUnicodeEncodingback to summary
public String getDefaultUnicodeEncoding()

Implements sun.datatransfer.DesktopDatatransferService.getDefaultUnicodeEncoding.

Doc from sun.datatransfer.DesktopDatatransferService.getDefaultUnicodeEncoding.

Get a platform-dependent default unicode encoding to use in datatransfer system.

Returns:String

default unicode encoding

Annotations
@Override
getFlavorMapback to summary
public FlavorMap getFlavorMap(Supplier<FlavorMap> supplier)

Implements sun.datatransfer.DesktopDatatransferService.getFlavorMap.

Doc from sun.datatransfer.DesktopDatatransferService.getFlavorMap.

Takes an appropriate FlavorMap from the desktop. If no appropriate table is found - uses a provided supplier to instantiate a table. If the desktop is absent - creates and returns a system singleton.

Parameters
supplier:Supplier<FlavorMap>

a constructor that should be used to create a new instance of the FlavorMap

Returns:FlavorMap

a FlavorMap

Annotations
@Override
getPlatformMappingsForFlavorback to summary
public LinkedHashSet<String> getPlatformMappingsForFlavor(DataFlavor df)

Implements sun.datatransfer.DesktopDatatransferService.getPlatformMappingsForFlavor.

Doc from sun.datatransfer.DesktopDatatransferService.getPlatformMappingsForFlavor.

Returns platform-specific mappings for the specified flavor. If there are no platform-specific mappings for this flavor, the method returns an empty Set.

Parameters
df:DataFlavor

DataFlavor to return mappings for

Returns:LinkedHashSet<String>

set of platform-specific mappings for a DataFlavor

Annotations
@Override
getPlatformMappingsForNativeback to summary
public LinkedHashSet<DataFlavor> getPlatformMappingsForNative(String nat)

Implements sun.datatransfer.DesktopDatatransferService.getPlatformMappingsForNative.

Doc from sun.datatransfer.DesktopDatatransferService.getPlatformMappingsForNative.

Returns platform-specific mappings for the specified native format. If there are no platform-specific mappings for this native, the method returns an empty Set.

Parameters
nat:String

a native format to return flavors for

Returns:LinkedHashSet<DataFlavor>

set of platform-specific mappings for a native format

Annotations
@Override
invokeOnEventThreadback to summary
public void invokeOnEventThread(Runnable r)

Implements sun.datatransfer.DesktopDatatransferService.invokeOnEventThread.

Doc from sun.datatransfer.DesktopDatatransferService.invokeOnEventThread.

If desktop is present - invokes a Runnable on the event dispatch thread. Otherwise invokes a run() method directly.

Parameters
r:Runnable

a Runnable to invoke

Annotations
@Override
isDesktopPresentback to summary
public boolean isDesktopPresent()

Implements sun.datatransfer.DesktopDatatransferService.isDesktopPresent.

Doc from sun.datatransfer.DesktopDatatransferService.isDesktopPresent.

Checks if desktop is present.

Returns:boolean

true is the desktop is present

Annotations
@Override
registerTextFlavorPropertiesback to summary
public void registerTextFlavorProperties(String nat, String charset, String eoln, String terminators)

Implements sun.datatransfer.DesktopDatatransferService.registerTextFlavorProperties.

Doc from sun.datatransfer.DesktopDatatransferService.registerTextFlavorProperties.

This method is called for text flavor mappings established while parsing the default flavor mappings file. It stores the "eoln" and "terminators" parameters which are not officially part of the MIME type. They are MIME parameters specific to the flavormap.properties file format.

Annotations
@Override