I have two applications:
1. My own Image Explorer
. I want to operate with images via such options like copy-paste
. I created own DataFlavor type for this. (Yeah, I really need that!) It is looks like
DataFlavor supportedFlavor = new DataFlavor(app.my.ImageWrapper.class, "ImageWrapper class");
And in my Transferable
I use this DataFlavor
:
@Override
public boolean isDataFlavorSupported(DataFlavor flavor) {
return supportedFlavor.equals(flavor);
}
@Override
public DataFlavor[] getTransferDataFlavors() {
return new DataFlavor[]{supportedFlavor}; // Simpled for SSCCE, I don't create new flavor each time really
}
2. FlavorListener from this answer. It should listen to FlavorEvents
for detecting which data type is copied.
My problem is:
When I get the event from other application after copying the text, files, images, the DataFlavor
is never null. But if I get the event after copying the my Object, it cannot detect any DataFlavor. WHY?
PS: Sorry for my bad English.