Package snap.view
Class ClipboardData
java.lang.Object
snap.view.ClipboardData
ClipboardData represents a data entry from a copy/paste or drag/drop.
-
Constructor Summary
ConstructorDescriptionClipboardData
(Object aSource) Creates a ClipboardData from source.ClipboardData
(String aMimeType, Object aSource) Creates a ClipboardData from source. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLoadListener
(Consumer<ClipboardData> aLoadLsnr) Adds a load listener.byte[]
getBytes()
Returns the data as byte array.static ClipboardData
getClipboardDataForObject
(Object theData) Returns a ClipboardData for given object.getFiles()
Returns the data as a list of files.Returns the file type.getImage()
Returns the data as image.Returns the data as input stream.Returns a conventional Java file, if available.Returns the data as list of Java files.Returns the file content type.getName()
Returns the file name.The source of the file.Returns the URL to the file.Returns the data as string.boolean
isFile()
Returns whether data is a File.boolean
Returns whether data is File list.boolean
isImage()
Returns whether data is image.boolean
isLoaded()
Returns whether data is loaded.boolean
isString()
Returns whether data is String.protected void
setBytes
(byte[] theBytes) Sets the bytes.protected void
setLoaded
(boolean aValue) Sets whether data is loaded.protected void
Sets the file name.
-
Constructor Details
-
ClipboardData
Creates a ClipboardData from source. -
ClipboardData
Creates a ClipboardData from source.
-
-
Method Details
-
getSource
The source of the file. -
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
Returns the file name. -
setName
Sets the file name. -
getFileType
Returns the file type. -
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
Adds a load listener. -
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
Returns the data as input stream. -
getFiles
Returns the data as a list of files. -
getJavaFile
Returns a conventional Java file, if available. -
getJavaFiles
Returns the data as list of Java files. -
getImage
Returns the data as image. -
getClipboardDataForObject
Returns a ClipboardData for given object.
-