1 19 27 28 package org.netbeans.modules.websvc.core; 29 30 import java.awt.datatransfer.DataFlavor ; 31 import java.awt.datatransfer.Transferable ; 32 import java.awt.datatransfer.UnsupportedFlavorException ; 33 import java.io.IOException ; 34 35 39 public class WebServiceTransferable implements Transferable { 40 private WebServiceReference ref; 41 42 public static final DataFlavor WS_FLAVOR = 43 new DataFlavor (WebServiceReference.class, "webservice ref"); 44 45 46 public WebServiceTransferable(WebServiceReference ref) { 47 this.ref = ref; 48 } 49 50 public boolean isDataFlavorSupported(DataFlavor flavor) { 51 return WS_FLAVOR.equals(flavor); 52 } 53 54 public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException , IOException { 55 if (WS_FLAVOR.equals(flavor)) { 56 return ref; 57 } 58 throw new UnsupportedFlavorException (flavor); 59 } 60 61 public DataFlavor [] getTransferDataFlavors() { 62 return new DataFlavor [] { 63 WS_FLAVOR 64 }; 65 } 66 67 } 68 | Popular Tags |