Package org.cef.callback
Class CefDragData
- java.lang.Object
-
- org.cef.callback.CefDragData
-
public abstract class CefDragData extends java.lang.ObjectClass used to represent drag data. The methods of this class may be called on any thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCefDragData.DragOperationsSupported drag operation bit flags.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaddFile(java.lang.String path, java.lang.String displayName)Add a file that is being dragged into the webview.abstract CefDragDataclone()Returns a copy of the current objectstatic CefDragDatacreate()Create a new CefDragData object.abstract voiddispose()Removes the native reference from an unused object.protected voidfinalize()abstract intgetFileContents(java.io.OutputStream writer)Write the contents of the file being dragged out of the web view into |writer|.abstract java.lang.StringgetFileName()Return the name of the file being dragged out of the browser window.abstract booleangetFileNames(java.util.Vector<java.lang.String> names)Retrieve the list of file names that are being dragged into the browser window.abstract java.lang.StringgetFragmentBaseURL()Return the base URL that the fragment came from.abstract java.lang.StringgetFragmentHtml()Return the text/html fragment that is being dragged.abstract java.lang.StringgetFragmentText()Return the plain text fragment that is being dragged.abstract java.lang.StringgetLinkMetadata()Return the metadata, if any, associated with the link being dragged.abstract java.lang.StringgetLinkTitle()Return the title associated with the link being dragged.abstract java.lang.StringgetLinkURL()Return the link URL that is being dragged.abstract booleanisFile()Returns true if the drag data is a file.abstract booleanisFragment()Returns true if the drag data is a text or html fragment.abstract booleanisLink()Returns true if the drag data is a link.abstract booleanisReadOnly()Test if the object is set to read-only.abstract voidresetFileContents()Reset the file contents.abstract voidsetFragmentBaseURL(java.lang.String baseUrl)Set the base URL that the fragment came from.abstract voidsetFragmentHtml(java.lang.String html)Set the text/html fragment that is being dragged.abstract voidsetFragmentText(java.lang.String text)Set the plain text fragment that is being dragged.abstract voidsetLinkMetadata(java.lang.String data)Set the metadata associated with the link being dragged.abstract voidsetLinkTitle(java.lang.String title)Set the title associated with the link being dragged.abstract voidsetLinkURL(java.lang.String url)Set the link URL that is being dragged.java.lang.StringtoString()
-
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.Throwable- Throws:
java.lang.Throwable
-
create
public static final CefDragData create()
Create a new CefDragData object.
-
clone
public abstract CefDragData clone()
Returns a copy of the current object- Overrides:
clonein classjava.lang.Object
-
dispose
public abstract void dispose()
Removes the native reference from an unused object.
-
isReadOnly
public abstract boolean isReadOnly()
Test if the object is set to read-only.- Returns:
- true if this object is read-only.
-
isLink
public abstract boolean isLink()
Returns true if the drag data is a link.
-
isFragment
public abstract boolean isFragment()
Returns true if the drag data is a text or html fragment.
-
isFile
public abstract boolean isFile()
Returns true if the drag data is a file.
-
getLinkURL
public abstract java.lang.String getLinkURL()
Return the link URL that is being dragged.
-
getLinkTitle
public abstract java.lang.String getLinkTitle()
Return the title associated with the link being dragged.
-
getLinkMetadata
public abstract java.lang.String getLinkMetadata()
Return the metadata, if any, associated with the link being dragged.
-
getFragmentText
public abstract java.lang.String getFragmentText()
Return the plain text fragment that is being dragged.
-
getFragmentHtml
public abstract java.lang.String getFragmentHtml()
Return the text/html fragment that is being dragged.
-
getFragmentBaseURL
public abstract java.lang.String getFragmentBaseURL()
Return the base URL that the fragment came from. This value is used for resolving relative URLs and may be empty.
-
getFileContents
public abstract int getFileContents(java.io.OutputStream writer)
Write the contents of the file being dragged out of the web view into |writer|. Returns the number of bytes sent to |writer|. If |writer| is NULL this method will return the size of the file contents in bytes. Call getFileName() to get a suggested name for the file.- Parameters:
writer- Writes the contents into this object.- Returns:
- The number of bytes sent to writer. If writer is NULL the size of the file contents in bytes is returned.
-
getFileName
public abstract java.lang.String getFileName()
Return the name of the file being dragged out of the browser window.
-
getFileNames
public abstract boolean getFileNames(java.util.Vector<java.lang.String> names)
Retrieve the list of file names that are being dragged into the browser window.
-
setLinkURL
public abstract void setLinkURL(java.lang.String url)
Set the link URL that is being dragged.- Parameters:
url- The link URL to be set.
-
setLinkTitle
public abstract void setLinkTitle(java.lang.String title)
Set the title associated with the link being dragged.- Parameters:
title- The tile associated with the link.
-
setLinkMetadata
public abstract void setLinkMetadata(java.lang.String data)
Set the metadata associated with the link being dragged.- Parameters:
data- The metadata associated with the link.
-
setFragmentText
public abstract void setFragmentText(java.lang.String text)
Set the plain text fragment that is being dragged.- Parameters:
text- The plain text fragment to be set.
-
setFragmentHtml
public abstract void setFragmentHtml(java.lang.String html)
Set the text/html fragment that is being dragged.- Parameters:
html- The html fragment to be set.
-
setFragmentBaseURL
public abstract void setFragmentBaseURL(java.lang.String baseUrl)
Set the base URL that the fragment came from.- Parameters:
baseUrl- The base URL to be set.
-
resetFileContents
public abstract void resetFileContents()
Reset the file contents. You should do this before calling CefBrowser.dragTargetDragEnter as the web view does not allow us to drag in this kind of data.
-
addFile
public abstract void addFile(java.lang.String path, java.lang.String displayName)Add a file that is being dragged into the webview.- Parameters:
path- The file and path to be set.displayName- The name to be displayed.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-