Package snap.view

Class ClipboardData

java.lang.Object
snap.view.ClipboardData

public class ClipboardData extends Object
ClipboardData represents a data entry from a copy/paste or drag/drop.
  • Constructor Details

    • ClipboardData

      public ClipboardData(Object aSource)
      Creates a ClipboardData from source.
    • ClipboardData

      public ClipboardData(String aMimeType, Object aSource)
      Creates a ClipboardData from source.
  • Method Details

    • getSource

      public Object getSource()
      The source of the file.
    • getSourceURL

      public WebURL getSourceURL()
      Returns the URL to the file.
    • isString

      public boolean isString()
      Returns whether data is String.
    • isFileList

      public boolean isFileList()
      Returns whether data is File list.
    • isFile

      public boolean isFile()
      Returns whether data is a File.
    • isImage

      public boolean isImage()
      Returns whether data is image.
    • getName

      public String getName()
      Returns the file name.
    • setName

      protected void setName(String aValue)
      Sets the file name.
    • getExtension

      public String getExtension()
      Returns the file extension.
    • getMIMEType

      public String getMIMEType()
      Returns the file content type.
    • isLoaded

      public boolean isLoaded()
      Returns whether data is loaded.
    • setLoaded

      protected void setLoaded(boolean aValue)
      Sets whether data is loaded.
    • addLoadListener

      public void addLoadListener(Consumer<ClipboardData> aLoadLsnr)
      Adds a load listener.
    • getString

      public String getString()
      Returns the data as string.
    • getBytes

      public byte[] getBytes()
      Returns the data as byte array.
    • setBytes

      protected void setBytes(byte[] theBytes)
      Sets the bytes.
    • getInputStream

      public InputStream getInputStream()
      Returns the data as input stream.
    • getFiles

      public List<ClipboardData> getFiles()
      Returns the data as a list of files.
    • getJavaFile

      public File getJavaFile()
      Returns a conventional Java file, if available.
    • getJavaFiles

      public List<File> getJavaFiles()
      Returns the data as list of Java files.
    • getImage

      public Image getImage()
      Returns the data as image.
    • get

      public static ClipboardData get(Object theData)
      Returns a ClipboardData for given object.