Community
Participate
Working Groups
Downcasting to the internal class WorkbenchPage is unsupported. While the method getClientComposite() physically exists at the moment, we are under no obligation to keep it lying around.Even if it returned something of use (right now it returns 'null'), the class org.eclipse.ui.internal.EditorStack no longer exists in 4.x so the code _will_ crash farther down the method. Caused by: java.lang.NullPointerException at org.eclipse.php.internal.ui.dnd.DNDUtils.pageEnableExternalDrop(DNDUtils.java:89) at org.eclipse.php.internal.ui.dnd.DNDUtils.windowEnableExternalDrop(DNDUtils.java:80) at org.eclipse.php.internal.ui.dnd.DNDUtils.initEditorSiteExternalDrop(DNDUtils.java:69) at org.eclipse.php.internal.ui.PHPUiPlugin$1$1.run(PHPUiPlugin.java:145) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134) ... 47 more
thanks Remi! Jacek I remember that you tweaked PDT to e4, so I pass this to you.
I just hit this again while testing our M3 candidate build. Can anyone explain to me what the point of these DND handlers are? I can already drag files from Windows Explorer and drop them into Eclipse's editor area to have the file be opened in Eclipse. I am having difficulties understanding why this extra code is needed in PDT.
hi Remy, this DND code exists since 2007. Maybe it predates DND support in platform that you're talking about?
(In reply to comment #3) > this DND code exists since 2007. Maybe it predates DND support in platform that > you're talking about? Possibly. I tried doing DND on 3.2.0 (M20060629-1905) and it doesn't seem to work. It does work on 3.3.2 (M20080221-1800). So it is possible the original PDT was targeting 3.2.x which did not have this feature.
Created attachment 181927 [details] remove DNDUtils
ok sounds fair. DragAndDrop to editor area still works after removing DNDUtils. I removed it in HEAD and attached patch with my change.
Thanks Remy! is there anything else that needs to be fixed in PDT for Eclipse 4.x?
(In reply to comment #6) > ok sounds fair. DragAndDrop to editor area still works after removing DNDUtils. > I removed it in HEAD and attached patch with my change. Thanks, Jacek! (In reply to comment #7) > is there anything else that needs to be fixed in PDT for Eclipse 4.x? I will be opening bugs as I find them. Unfortunately, I don't use PDT or program in PHP so I'm not really able to actually do much real testing for PDT on Eclipse 4.x.
I think you can also delete ExternalFileDropAdapter? That file doesn't seem to be used anywhere. I checked out the following projects from HEAD and they all seemed to compile cleanly for me on 4.x so there doesn't appear to be too much rampant usage of workbench internals. org.eclipse.dltk.core org.eclipse.dltk.core.manipulation org.eclipse.dltk.launching org.eclipse.dltk.ui org.eclipse.php org.eclipse.php.astview org.eclipse.php.core org.eclipse.php.core.parser org.eclipse.php.debug.core org.eclipse.php.debug.daemon org.eclipse.php.debug.ui org.eclipse.php.help org.eclipse.php.server.core org.eclipse.php.server.ui org.eclipse.php.ui
yes, actually only PHPNavigatorDropAdapter and PHPViewerDropSupport seem to be only classes used outside this org.eclipse.php.internal.ui.dnd package. probably it's a good time to install FindBugs :-)
removed BasicSelectionTransferDragAdapter, DelegatingDragAdapter, DelegatingDropAdapter, ExternalFileDropAdapter, PHPViewerDragAdapter, PHPViewerDropAdapter, ResourceTransferDragAdapter, TransferDropTargetListener
Closing...