>>How can I find out, which topic names arrive at my application, so that I
>>can create the flavormap?
[quoted text clipped - 6 lines]
>
> Isn't it just the file extension?
Interesting approach, I don't think it will work, but I will try that.
Thanks,
Thomas
- --
Thomas Strauß - Java Programming in unusual Places
Thomas Strauss - 13 Sep 2004 23:12 GMT
>>>How can I find out, which topic names arrive at my application, so that I
>>>can create the flavormap?
Hi Folks,
I finally did it! I managed to receive dataformats that are not part of the
default flavormap.properties.
My problem was, that I could not identify the name of the datatype in the
Windows clipboard. Since I didnt know the name I couldnt setup a flavormap.
Attached, you find a small utility, which dumps the current
content-type-names of the system-clipboard.
HowTo:
1- compile the cpp-code
2- copy the data you want to identify into clipboard
3- run the cpp-app
output should be sth like this (Outlook 2002 eMail in clipboard)
Clipboard contents:
Format 49161 is DataObject
Format 49694 is RenPrivateSourceFolder
Format 49695 is RenPrivateMessages
Format 49315 is FileGroupDescriptor
Format 49314 is FileContents
Format 49166 is Object Descriptor
Format 1 is
Format 49171 is Ole Private Data
Format 16 is
Format 7 is
Format 13 is
4- register the content type you want as DataFlavor in SystemFlavorMap:
SystemFlavorMap sfm =
(SystemFlavorMap)SystemFlavorMap.getDefaultFlavorMap();
try {
sfm.setFlavorsForNative("FileContents", new DataFlavor[]{
new DataFlavor("text/x-mail; class=java.io.InputStream")
});
}
catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
String aMsg = e.getMessage();
e.printStackTrace();
}
5- In a drop, you will receive the data from the clipboard offered as the
mimetype you registered for your new dataflavor (text/x-mail in this case)
That's it!
Happy Coding,
Thomas
PS: If you require the CPP executable, mail me.
- --
Thomas Strauß - Java Programming in unusual Places
Maria De Piano - 23 Feb 2005 10:13 GMT
Thomas,
Is it possible to get the CPP executable?
Regards,
Maria