src/windows/classes/sun/awt/windows/WDataTransferer.java

Print this page




 196             if (contents.isDataFlavorSupported(DataFlavor.selectionHtmlFlavor)) {
 197                 // if a user provides data represented by
 198                 // DataFlavor.selectionHtmlFlavor format, we use this
 199                 // type to store the data in the native clipboard
 200                 bytes = super.translateTransferable(contents,
 201                         DataFlavor.selectionHtmlFlavor,
 202                         format);
 203             } else if (contents.isDataFlavorSupported(DataFlavor.allHtmlFlavor)) {
 204                 // if we cannot get data represented by the
 205                 // DataFlavor.selectionHtmlFlavor format
 206                 // but the DataFlavor.allHtmlFlavor format is avialable
 207                 // we belive that the user knows how to represent
 208                 // the data and how to mark up selection in a
 209                 // system specific manner. Therefor, we use this data
 210                 bytes = super.translateTransferable(contents,
 211                         DataFlavor.allHtmlFlavor,
 212                         format);
 213             } else {
 214                 // handel other html flavor types, including custom and
 215                 // fragment ones
 216                 bytes = HTMLCodec.convertToHTMLFormat(bytes);
 217             }
 218         } else {
 219             // we handle non-html types basing on  their
 220             // flavors
 221             bytes = super.translateTransferable(contents, flavor, format);
 222         }
 223         return bytes;
 224     }
 225 
 226     // The stream is closed as a closable object
 227     public Object translateStream(InputStream str,
 228                                  DataFlavor flavor, long format,
 229                                  Transferable localeTransferable)
 230         throws IOException
 231     {
 232         if (format == CF_HTML && flavor.isFlavorTextType()) {
 233             str = new HTMLCodec(str,
 234                                  EHTMLReadMode.getEHTMLReadMode(flavor));
 235 
 236         }




 196             if (contents.isDataFlavorSupported(DataFlavor.selectionHtmlFlavor)) {
 197                 // if a user provides data represented by
 198                 // DataFlavor.selectionHtmlFlavor format, we use this
 199                 // type to store the data in the native clipboard
 200                 bytes = super.translateTransferable(contents,
 201                         DataFlavor.selectionHtmlFlavor,
 202                         format);
 203             } else if (contents.isDataFlavorSupported(DataFlavor.allHtmlFlavor)) {
 204                 // if we cannot get data represented by the
 205                 // DataFlavor.selectionHtmlFlavor format
 206                 // but the DataFlavor.allHtmlFlavor format is avialable
 207                 // we belive that the user knows how to represent
 208                 // the data and how to mark up selection in a
 209                 // system specific manner. Therefor, we use this data
 210                 bytes = super.translateTransferable(contents,
 211                         DataFlavor.allHtmlFlavor,
 212                         format);
 213             } else {
 214                 // handel other html flavor types, including custom and
 215                 // fragment ones
 216                 bytes = HTMLCodec.convertToHTMLFormat(super.translateTransferable(contents, flavor, format));
 217             }
 218         } else {
 219             // we handle non-html types basing on  their
 220             // flavors
 221             bytes = super.translateTransferable(contents, flavor, format);
 222         }
 223         return bytes;
 224     }
 225 
 226     // The stream is closed as a closable object
 227     public Object translateStream(InputStream str,
 228                                  DataFlavor flavor, long format,
 229                                  Transferable localeTransferable)
 230         throws IOException
 231     {
 232         if (format == CF_HTML && flavor.isFlavorTextType()) {
 233             str = new HTMLCodec(str,
 234                                  EHTMLReadMode.getEHTMLReadMode(flavor));
 235 
 236         }