Project: JDT
Bug 310089 Clean up ImportTypeDialog.open() and CopyFilesAndFoldersOperation API
Reported: 2010-04-22 06:57:46 | Status: verified fixed

N20100421-2000. Calling open() on a dialog should always open a dialog. The current implementation violates the API contract of Window.open() and is a hack. We should get rid of this before 3.6 ships. To make it easy for clients (so they don't have to take over that code) we should add CopyFilesAndFoldersOperation.copyOrLinkFiles(String[] fileNames, IContainer destination, int operation) which will query the preferences as currently done in ImportTypeDialog.open() and then handle the drop operation i.e. the boiler plate code which is currently done by the clients. ==> that way the clients only have to call copyOrLinkFiles(...) instead of all the boiler plate code. For 3.6 we must at least fix the open() method but I would also add the copyOrLinkFiles(...) API because it makes the clients code much simpler and reduces code duplication (4 places!) in the SDK.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/navigator/JavaDropAdapterAssistant.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java