edu.northwestern.at.utils.swing
Class URLTransferable
java.lang.Object
edu.northwestern.at.utils.swing.URLTransferable
- All Implemented Interfaces:
- java.awt.datatransfer.Transferable
public class URLTransferable
- extends java.lang.Object
- implements java.awt.datatransfer.Transferable
Implements a transferable class for URLs.
Field Summary |
protected java.lang.String |
URLString
The URL in string format. |
Constructor Summary |
URLTransferable(java.lang.String URLString)
Create URL transferable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
URLString
protected java.lang.String URLString
- The URL in string format.
URLTransferable
public URLTransferable(java.lang.String URLString)
- Create URL transferable.
- Parameters:
URLString
- The URL as a string.
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
- Specified by:
getTransferDataFlavors
in interface java.awt.datatransfer.Transferable
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
- Specified by:
isDataFlavorSupported
in interface java.awt.datatransfer.Transferable
getTransferData
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
throws java.awt.datatransfer.UnsupportedFlavorException,
java.io.IOException
- Return URL for bookmark in string format.
- Specified by:
getTransferData
in interface java.awt.datatransfer.Transferable
- Parameters:
flavor
- Data flavor.
- Returns:
- URL in string format followed by "\n"
followed by URL title.
- Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException