[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: SWT vs SWING/AWT Drag and drop

I don't know SWING/AWT implementation so I'm not sure how they generate the string to register with the OS.

Perhaps you can use the constructor DataFlavor(String) and use the same string for SWT. Or you can call getMimeType() after the DataFlavor is created to see what string is being used by SWING/AWT.

If you get it working, please report back. I'm curious what it is.

Duong

Sheldon Warkentin wrote:

Thanks Duong!

This almost entirely works. I am only having an issue with the generated Type Id in the SWT custom transfer class.

Re:
    protected static DataFlavor customFlavor = new DataFlavor
(CustomClass.class,
        "A Custom Object");

and:
	private static final String MYTYPENAME = "A Custom Object";
	private static final int MYTYPEID = registerType (MYTYPENAME);

.........................

Do I need MYTYPENAME to look something like, "Mime type/text... class=custom.class"?

With this resolved - I think I will be fully satisfied with the solution!

Thank you,
Sheldon