I just created an e4 application by e(fx)clipse following this tutorial, then I added two parts in my application as following screenshot.
And then when I mess around with this application, I found that these two tabs can't be drag and drop. Theoretically speaking, every window/view should be able to be drag and drop in a SWT UI based e4 application. Can anyone tell me how to make window/view drag and drop behavior possible in such an application? Really appreciate it.
Asked
Active
Viewed 220 times
0

kenshinji
- 2,021
- 4
- 25
- 39
1 Answers
0
Drag and drop is not part of the core of e4.
You must add the appropriate DnD addon to the Add-ons list in the Application.e4xmi to get drag and drop.
For JavaFX this is org.eclipse.fx.ui.workbench.renderers.base.addons.DnDAddon
(full entry in the Application.e4xmi should be bundleclass://org.eclipse.fx.ui.workbench.renderers.base/org.eclipse.fx.ui.workbench.renderers.base.addons.DnDAddon
). You may also need the cleanup addon bundleclass://org.eclipse.fx.ui.workbench.renderers.base/org.eclipse.fx.ui.workbench.renderers.base.addons.CleanUpAddon
For SWT it is org.eclipse.e4.ui.workbench.addons.dndaddon.DnDAddon

greg-449
- 109,219
- 232
- 102
- 145
-
I tried adding `bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.dndaddon.DnDAddon` into Add-on in the `Application.e4xmi` file, however I got [this error](http://pastebin.com/42PHTCpL) when I was running my app again. – kenshinji Dec 23 '16 at 08:37
-
1It turns out that the DnD addon is specific to the UI toolkit you are using. I have updated the answer with the JavaFX addon. – greg-449 Dec 23 '16 at 08:45
-
ok, now I have another [error](http://pastebin.com/ukwpqTcX) :( it tells that can't retrieve `org.eclipse.fx.ui.workbench.renderers.base.addons.DnDAddon`, but I did add `org.eclipse.fx.ui.workbench.renderers.base` into dependencies. – kenshinji Dec 23 '16 at 08:55
-
Make sure the full entry for the addon is `bundleclass://org.eclipse.fx.ui.workbench.renderers.base/org.eclipse.fx.ui.workbench.renderers.base.addons.DnDAddon` you probably also need the cleanup addon `bundleclass://org.eclipse.fx.ui.workbench.renderers.base/org.eclipse.fx.ui.workbench.renderers.base.addons.CleanUpAddon` – greg-449 Dec 23 '16 at 09:40
-
That log is still using org.eclipse.e4.ui.workbench.addons.dndaddon.DnDAddon – greg-449 Dec 23 '16 at 09:51