Demos and Usage of java.awt.datatransfer.Transferable.getTransferDataFlavors()


   1: import java.awt.datatransfer.DataFlavor;
   2: import java.awt.datatransfer.Transferable;
   3: import java.awt.datatransfer.UnsupportedFlavorException;
   4:         ...
   5: 
   6:     static class CopyTransferable implements Transferable {
   7:         ...
   8:         private final Transferable _transferable;
   9: 
  10:         ...
  11:         public DataFlavor[] getTransferDataFlavors() {
  12:             return _transferable.getTransferDataFlavors();

View Full Code Here
   1: 
   2:   public static final boolean matches(Transferable _t,DataFlavor _flavor)
   3:   {
   4:         ...
   5:     return (_t!=null)&&matches(_flavor,_t.getTransferDataFlavors());
   6:   }
   7:         ...
   8: 
   9:   public static final boolean matches(Transferable _t,DataFlavor[] _flavors)
  10:   {
  11:         ...
  12:     return (_t!=null)&&matches(_t.getTransferDataFlavors(),_flavors);

View Full Code Here
   1: import jp.ujihara.java.awt.datatransfer.DataFlavor;
   2: import jp.ujihara.java.awt.datatransfer.Transferable;
   3: import jp.ujihara.java.awt.datatransfer.UnsupportedFlavorException;
   4:         ...
   5: 
   6:   public class TransferableProxy implements Transferable
   7:   {
   8:         ...
   9:     protected boolean isLocal;
  10:     protected Transferable transferable;
  11: 
  12:         ...
  13:     {
  14:       return transferable.getTransferDataFlavors();

View Full Code Here
   1: import java.awt.datatransfer.DataFlavor;
   2: import java.awt.datatransfer.Transferable;
   3: import java.awt.geom.AffineTransform;
   4:         ...
   5: 
   6:         public boolean importData(JComponent comp, Transferable t) {
   7:             if (super.importData(comp, t))
   8:         ...
   9:                         DataFlavor.selectBestTextFlavor(
  10:                             t.getTransferDataFlavors());
  11:                     if (bestFlavor != null && cell == null) {

View Full Code Here
   1: import java.awt.datatransfer.DataFlavor;
   2: import java.awt.datatransfer.Transferable;
   3: import java.awt.geom.AffineTransform;
   4:         ...
   5: 
   6:         public boolean importDataImpl(JComponent comp, Transferable t) {
   7:             if (super.importDataImpl(comp, t)) {
   8:         ...
   9:                             DataFlavor.selectBestTextFlavor(
  10:                                 t.getTransferDataFlavors());
  11:                         if (bestFlavor != null && cell == null) {

View Full Code Here
   1: import java.awt.datatransfer.DataFlavor;
   2: import java.awt.datatransfer.Transferable;
   3: import java.awt.dnd.DnDConstants;
   4:         ...
   5: 
   6:   public Transferable makeDraggableObject(Object o) {
   7:     if (o instanceof DefaultMutableTreeNode) {
   8:         ...
   9:    
  10:   public int addElement(Transferable transferable, 
  11:                         DefaultMutableTreeNode target,
  12:         ...
  13:   {
  14:     DataFlavor[] flavors = transferable.getTransferDataFlavors();

View Full Code Here
   1: import java.awt.datatransfer.StringSelection;
   2: import java.awt.datatransfer.Transferable;
   3: import java.awt.event.ActionEvent;
   4:         ...
   5: 
   6:             Transferable transferData =
   7:                 systemClipboard.getContents( null ) ;
   8:         ...
   9:             DataFlavor[] dataFlavor =
  10:                 transferData.getTransferDataFlavors() ;
  11:             DataFlavor flavor = dataFlavor[ 0 ] ;

View Full Code Here