Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] determining data during DropTargetListener.dragEnter()

See the article:

http://www.eclipse.org/articles/Article-SWT-DND/DND-in-SWT.html

For Windows, you can do the following:

public void dragOver(DropTargetEvent event) { 
    event.feedback = DND.FEEDBACK_SELECT | DND.FEEDBACK_SCROLL; 
    if (textTransfer.isSupportedType(event.currentDataType)) { 
        // NOTE: on unsupported platforms this will return null 
        String t 
=(String)(textTransfer.nativeToJava(event.currentDataType)); 
        if (t != null) { 
            System.out.println(t); 
        } 
    } 
} 




"James Barnett" <jbarnett@xxxxxxx> 
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
12/22/2004 12:45 PM
Please respond to
platform-swt-dev


To
<platform-swt-dev@xxxxxxxxxxx>
cc

Subject
[platform-swt-dev] determining data during DropTargetListener.dragEnter()






Hi ā€“ Iā€™m trying to implement d n d from a tree viewer to a basic swt 
canvas. Each node in the tree has a different underlying data type, which 
is what I want to use in the DropTargetListener.dragEnter() to determine 
whether of not a drop is acceptable. 
 
Is there anyway I can insure that the DropTargetEvent contains a reference 
to this underlying tree node data structure? In awt I can simply set the 
DataFlavors in the Transferable object and then check these DataFlavor 
types ā€¦.
 
Thanks for your help ā€“ james barnett


Back to the top