<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>lekkimworld.comdnd</title>
    <link>http://lekkimworld.com/tags/dnd/</link>
    <description>IBM Lotus Notes/Domino, Websphere, IBM Connections, mobile, web, JavaScript, Java...</description>
    <language>en</language>
    <copyright>Mikkel Flindt Heisterberg (mh [at] intravision [dot] dk</copyright>
    <pubDate>Sat, 19 May 2012 06:50:25 GMT</pubDate>
    <dc:creator>Mikkel Flindt Heisterberg (mh [at] intravision [dot] dk</dc:creator>
    <dc:date>2012-05-19T06:50:25Z</dc:date>
    <dc:language>en</dc:language>
    <dc:rights>Mikkel Flindt Heisterberg (mh [at] intravision [dot] dk</dc:rights>
    <image>
      <title>lekkimworld.comdnd</title>
      <url>http://lekkimworld.com/tags/dnd/</url>
    </image>
    <item>
      <title>Drag'n'drop in SWT components</title>
      <link>http://lekkimworld.com/2009/02/19/dragndrop_in_swt_components.html</link>
      <content:encoded>&lt;p&gt;
Those who went to my &lt;a href="http://lekkimworld.com/pages/lotusphere2009.html"&gt;Lotusphere session&lt;/a&gt; already know this but doing drag'n'drop in SWT is actually quite easy. All you need to do is define a drag source and/or a drop target. The former is only required if a control in users should be able to drag data from a control in your code. The latter is required if you would like users to be able to drop stuff onto your component.
&lt;/p&gt;
&lt;p&gt;
When setting up a drag source or a drop target you specify the control the source/target controls and the types of data you can provide/accept. These types are called Transfer types and are subclasses of the &lt;a href="http://help.eclipse.org/help31/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/dnd/class-use/Transfer.html"&gt;org.eclipse.ui.dnd.Transfer&lt;/a&gt; class.
&lt;/p&gt;
&lt;p&gt;
Transfer types that might come handy - the class names should be pretty self-explanatory:
&lt;ul&gt;
&lt;li&gt;org.eclipse.swt.dnd.URLTransfer.getInstance()&lt;/li&gt;
&lt;li&gt;org.eclipse.swt.dnd.FileTransfer.getInstance()&lt;/li&gt; 
&lt;li&gt;org.eclipse.swt.dnd.TextTransfer.getInstance()&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
Making a JFace viewer a drop target is simple passing in the underlying control:
&lt;pre&gt;
DropTarget dropTarget = new DropTarget(viewer.getControl(), 
   DND.DROP_DEFAULT | DND.DROP_MOVE);
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Once the drop target has been created you set the transfer types:
&lt;pre&gt;
final Transfer[] dropTransferTypes = new Transfer[] {
  type1, 
  type2
};
dropTarget.setTransfer(dropTransferTypes);
&lt;/pre&gt;
The last thing you need is to add an instance of DropTargetListener or use a subclass of DropTargetAdapter as I do here:
&lt;pre&gt;
dropTarget.addDropListener(new DropTargetAdapter() {
  ...
  ...
});
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Creating a drag source is analogous. 
&lt;/p&gt;</content:encoded>
      <category domain="http://lekkimworld.com/tags/dnd/">dnd</category>
      <category domain="http://lekkimworld.com/tags/notes8/">notes8</category>
      <category domain="http://lekkimworld.com/tags/swt/">swt</category>
      <pubDate>Thu, 19 Feb 2009 09:24:53 GMT</pubDate>
      <guid isPermaLink="false">tag:lekkimworld.com,2009-02-19:default/1235035493384</guid>
      <dc:date>2009-02-19T09:24:53Z</dc:date>
    </item>
    <item>
      <title>Dragging Sametime buddies around</title>
      <link>http://lekkimworld.com/2008/11/06/dragging_sametime_buddies_around.html</link>
      <content:encoded>&lt;p&gt;
I have been playing a little with the drag'n'drop support in the Notes 8.5 beta client and found out that a VCard is created the you drag a Sametime contact to a place that accepts dragging files to (this probably also works in earlier versions). This means that dragging a Sametime buddy to the desktop will create a VCard for that person. Nice! Dragging the buddy to an e-mail (or other place which accepts text transfer) will create a mailto-link.
&lt;/p&gt;
&lt;p&gt;
Just one of those nice, time saving features...
&lt;/p&gt;</content:encoded>
      <category domain="http://lekkimworld.com/tags/dnd/">dnd</category>
      <category domain="http://lekkimworld.com/tags/notes85/">notes85</category>
      <category domain="http://lekkimworld.com/tags/sametime/">sametime</category>
      <pubDate>Thu, 06 Nov 2008 12:35:00 GMT</pubDate>
      <guid isPermaLink="false">tag:lekkimworld.com,2008-11-06:default/1225974900000</guid>
      <dc:date>2008-11-06T12:35:00Z</dc:date>
    </item>
  </channel>
</rss>


