Class CefDragData


  • public abstract class CefDragData
    extends java.lang.Object
    Class 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 class  CefDragData.DragOperations
      Supported drag operation bit flags.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void addFile​(java.lang.String path, java.lang.String displayName)
      Add a file that is being dragged into the webview.
      abstract CefDragData clone()
      Returns a copy of the current object
      static CefDragData create()
      Create a new CefDragData object.
      abstract void dispose()
      Removes the native reference from an unused object.
      protected void finalize()  
      abstract int getFileContents​(java.io.OutputStream writer)
      Write the contents of the file being dragged out of the web view into |writer|.
      abstract java.lang.String getFileName()
      Return the name of the file being dragged out of the browser window.
      abstract boolean getFileNames​(java.util.Vector<java.lang.String> names)
      Retrieve the list of file names that are being dragged into the browser window.
      abstract java.lang.String getFragmentBaseURL()
      Return the base URL that the fragment came from.
      abstract java.lang.String getFragmentHtml()
      Return the text/html fragment that is being dragged.
      abstract java.lang.String getFragmentText()
      Return the plain text fragment that is being dragged.
      abstract java.lang.String getLinkMetadata()
      Return the metadata, if any, associated with the link being dragged.
      abstract java.lang.String getLinkTitle()
      Return the title associated with the link being dragged.
      abstract java.lang.String getLinkURL()
      Return the link URL that is being dragged.
      abstract boolean isFile()
      Returns true if the drag data is a file.
      abstract boolean isFragment()
      Returns true if the drag data is a text or html fragment.
      abstract boolean isLink()
      Returns true if the drag data is a link.
      abstract boolean isReadOnly()
      Test if the object is set to read-only.
      abstract void resetFileContents()
      Reset the file contents.
      abstract void setFragmentBaseURL​(java.lang.String baseUrl)
      Set the base URL that the fragment came from.
      abstract void setFragmentHtml​(java.lang.String html)
      Set the text/html fragment that is being dragged.
      abstract void setFragmentText​(java.lang.String text)
      Set the plain text fragment that is being dragged.
      abstract void setLinkMetadata​(java.lang.String data)
      Set the metadata associated with the link being dragged.
      abstract void setLinkTitle​(java.lang.String title)
      Set the title associated with the link being dragged.
      abstract void setLinkURL​(java.lang.String url)
      Set the link URL that is being dragged.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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:
        clone in class java.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:
        toString in class java.lang.Object