Class DataTransfer

java.lang.Object
one.jpro.platform.file.event.DataTransfer

public class DataTransfer extends Object
Data transfer class.
Author:
Besmir Beqiri
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final javafx.scene.input.DataFormat
    Represents a single File.
    static final javafx.scene.input.DataFormat
    Represents a List of File sources.
    static final javafx.scene.input.DataFormat
    Represents a List of Files.
    static final javafx.scene.input.DataFormat
    Represents a List of MIME types.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
     
    final Object
    getData(javafx.scene.input.DataFormat format)
     
    final File
    Gets the File which had previously been registered.
    final List<File>
    Gets the List of File which had previously been registered.
    Gets the List of FileSource which had previously been registered.
    final List<String>
    Gets the List of MIME types as strings which had previously been registered.
    final boolean
    hasData(javafx.scene.input.DataFormat format)
    Tests whether there is any data of the given DataFormat type.
    final boolean
    Gets whether a File has been registered as data.
    final boolean
    Gets whether a List of Files has been registered as data.
    final boolean
    Gets whether a List of FileSource has been registered as data.
    final boolean
    Gets whether a List of MIME types as strings has been registered as data.
    final void
    putData(javafx.scene.input.DataFormat format, Object value)
     
    final void
    setData(Map<javafx.scene.input.DataFormat,Object> map)
     

    Methods inherited from class java.lang.Object

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

    • FILE

      public static final javafx.scene.input.DataFormat FILE
      Represents a single File.
    • FILES

      public static final javafx.scene.input.DataFormat FILES
      Represents a List of Files.
    • FILE_SOURCES

      public static final javafx.scene.input.DataFormat FILE_SOURCES
      Represents a List of File sources.
    • MIME_TYPES

      public static final javafx.scene.input.DataFormat MIME_TYPES
      Represents a List of MIME types.
  • Constructor Details

    • DataTransfer

      public DataTransfer()
  • Method Details

    • getData

      public final Object getData(javafx.scene.input.DataFormat format)
    • putData

      public final void putData(javafx.scene.input.DataFormat format, Object value)
    • setData

      public final void setData(Map<javafx.scene.input.DataFormat,Object> map)
    • clearData

      public final void clearData()
    • hasData

      public final boolean hasData(javafx.scene.input.DataFormat format)
      Tests whether there is any data of the given DataFormat type.
      Parameters:
      format - the format type
      Returns:
      true if there is data for this type
    • hasFile

      public final boolean hasFile()
      Gets whether a File has been registered as data.
      Returns:
      true if hasData(DataTransfer.FILE) returns true, false otherwise
    • getFile

      public final File getFile()
      Gets the File which had previously been registered. This is equivalent to invoking getData(DataTransfer.FILE). If no such entry exists, null is returned.
      Returns:
      The File source associated with FILE, or null if there is none.
    • hasFiles

      public final boolean hasFiles()
      Gets whether a List of Files has been registered as data.
      Returns:
      true if hasData(DataTransfer.FILES) returns true, false otherwise
    • getFiles

      public final List<File> getFiles()
      Gets the List of File which had previously been registered. This is equivalent to invoking getData(DataTransfer.FILES). If no such entry exists, null is returned.
      Returns:
      The List of Files associated with FILES, or null if there is none.
    • hasFileSources

      public final boolean hasFileSources()
      Gets whether a List of FileSource has been registered as data.
      Returns:
      true if hasData(DataTransfer.FILE_SOURCES) returns true, false otherwise
    • getFileSources

      public final List<FileSource> getFileSources()
      Gets the List of FileSource which had previously been registered. This is equivalent to invoking getData(DataTransfer.FILE_SOURCES). If no such entry exists, null is returned.
      Returns:
      The List of Files associated with FILE_SOURCES, or null if there is none.
    • hasMimeTypes

      public final boolean hasMimeTypes()
      Gets whether a List of MIME types as strings has been registered as data.
      Returns:
      true if hasData(DataTransfer.MIME_TYPES) returns true, false otherwise
    • getMimeTypes

      public final List<String> getMimeTypes()
      Gets the List of MIME types as strings which had previously been registered. This is equivalent to invoking getData(DataTransfer.MIME_TYPES). If no such entry exists, null is returned.
      Returns:
      The List of MIME types as strings associated with MIME_TYPES, or null if there is none.