/**
* Returns the <code>Transferable</code>'s data in the requested
* <code>DataFlavor</code> if possible.
* @param flavor the requested flavor for the data
* @return the data in the requested flavor, as outlined above
* @throws UnsupportedFlavorException if the requested data flavor is
* not supported.
* @throws IOException if an IOException occurs while retrieving the data.
* @throws NullPointerException if flavor is <code>null</code>
*/
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException,
IOException {
if (flavor.equals(flavors[STRING])) {
return (Object)str;
} else if (flavor.equals(flavors[PLAIN_TEXT])) {
return new StringReader(str == null ? "" : str);
} else if (flavor.equals(flavors[WATCH])) {
return watch;
} else {
throw new UnsupportedFlavorException(flavor);
}
}
WatchesNodeModel.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:incubator-netbeans
作者:
评论列表
文章目录