Package java.awt.datatransfer

Examples of java.awt.datatransfer.UnsupportedFlavorException


    if (DataFlavor.imageFlavor.equals(flavor)) {
      return image;
    } else     if (DataFlavor.stringFlavor.equals(flavor)) {
      return text;
    }
    throw new UnsupportedFlavorException(flavor);
  }
View Full Code Here


    }

    public Object getTransferData(DataFlavor flavor)
        throws UnsupportedFlavorException {
      if (!isDataFlavorSupported(flavor)) {
        throw new UnsupportedFlavorException(flavor);
      }
      return data;
    }
View Full Code Here

                        return flavor.equals(DataFlavor.stringFlavor) ? (Object)content.toString()
                                                                      : new StringBufferInputStream(content.toString());
                    }

                    throw new UnsupportedFlavorException(flavor);
                }

                public boolean isDataFlavorSupported(final DataFlavor flavor) {
                    return flavor.equals(DataFlavor.stringFlavor)
                           || flavor.equals(DataFlavor.plainTextFlavor);
View Full Code Here

        }

        @Override
        public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
            if (!isDataFlavorSupported(flavor)) {
                throw new UnsupportedFlavorException(flavor);
            }
            return nodes;
        }
View Full Code Here

    }

    @Override
    public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
        if(!isDataFlavorSupported(flavor)) {
            throw new UnsupportedFlavorException(flavor);
        }
        if(data != null) {
            ObjectInput ois = null;
            try {
                ois = new ObjectInputStream(new ByteArrayInputStream(data));
View Full Code Here

        if (flavor.equals(FLAVOR))
            return entries;
        else if (flavor.equals(DataFlavor.stringFlavor))
            return text;
        else
            throw new UnsupportedFlavorException(flavor);
    }
View Full Code Here

        if (mimeType.equalsIgnoreCase(DataProvider.TYPE_IMAGE) &&
                Image.class.isAssignableFrom(flavor.getRepresentationClass())) {
            return getImage(flavor);
        }
       
        throw new UnsupportedFlavorException(flavor);
    }
View Full Code Here

    }
   
    private Object getPlainText(DataFlavor f)
            throws IOException, UnsupportedFlavorException {
        if (!data.isNativeFormatAtailable(DataProvider.FORMAT_TEXT)) {
            throw new UnsupportedFlavorException(f);
        }
        String str = data.getText();
        if (str == null) {
            throw new IOException("Data is not available");
        }
View Full Code Here

    }

    private Object getFileList(DataFlavor f)
            throws IOException, UnsupportedFlavorException {
        if (!data.isNativeFormatAtailable(DataProvider.FORMAT_FILE_LIST)) {
            throw new UnsupportedFlavorException(f);
        }
        String[] files = data.getFileList();
        if (files == null) {
            throw new IOException("Data is not available");
        }
View Full Code Here

    }

    private Object getHTML(DataFlavor f)
            throws IOException, UnsupportedFlavorException {
        if (!data.isNativeFormatAtailable(DataProvider.FORMAT_HTML)) {
            throw new UnsupportedFlavorException(f);
        }
        String str = data.getHTML();
        if (str == null) {
            throw new IOException("Data is not available");
        }
View Full Code Here

TOP

Related Classes of java.awt.datatransfer.UnsupportedFlavorException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.