Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 165627 Details for
Bug 301187
[package explorer] support new drag and drop import dialog when dragging from OS shell
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Updated patch with latest CVS sources
patch_301187.txt (text/plain), 5.86 KB, created by
Serge Beauchamp
on 2010-04-21 15:42:51 EDT
(
hide
)
Description:
Updated patch with latest CVS sources
Filename:
MIME Type:
Creator:
Serge Beauchamp
Created:
2010-04-21 15:42:51 EDT
Size:
5.86 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/navigator/JavaDropAdapterAssistant.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/navigator/JavaDropAdapterAssistant.java,v >retrieving revision 1.12 >diff -u -r1.12 JavaDropAdapterAssistant.java >--- ui/org/eclipse/jdt/internal/ui/navigator/JavaDropAdapterAssistant.java 2 Mar 2009 15:41:56 -0000 1.12 >+++ ui/org/eclipse/jdt/internal/ui/navigator/JavaDropAdapterAssistant.java 21 Apr 2010 19:42:20 -0000 >@@ -29,8 +29,10 @@ > > import org.eclipse.jface.viewers.ISelection; > import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.jface.window.Window; > > import org.eclipse.ui.actions.CopyFilesAndFoldersOperation; >+import org.eclipse.ui.ide.dialogs.ImportTypeDialog; > import org.eclipse.ui.navigator.CommonDropAdapter; > import org.eclipse.ui.navigator.CommonDropAdapterAssistant; > import org.eclipse.ui.views.navigator.LocalSelectionTransfer; >@@ -91,8 +93,35 @@ > return Status.CANCEL_STATUS; > > getShell().forceActive(); >+ CopyFilesAndFoldersOperation operation = new CopyFilesAndFoldersOperation(getShell()); > final Object data= FileTransfer.getInstance().nativeToJava(dropAdapter.getCurrentTransfer()); >- new CopyFilesAndFoldersOperation(getShell()).copyFiles((String[]) data, targetContainer); >+ String[] names= (String[]) data; >+ // if the target is a group and all sources are files, then >+ // automatically create links >+ int type; >+ ImportTypeDialog dialog = new ImportTypeDialog(getShell(), dropAdapter.getCurrentOperation(), names, targetContainer); >+ dialog.setResource(targetContainer); >+ if (dialog.open() == Window.OK) >+ type = dialog.getSelection(); >+ else >+ type = ImportTypeDialog.IMPORT_NONE; >+ switch (type) { >+ case ImportTypeDialog.IMPORT_COPY: >+ operation.copyFiles(names, targetContainer); >+ break; >+ case ImportTypeDialog.IMPORT_VIRTUAL_FOLDERS_AND_LINKS: >+ if (dialog.getVariable() != null) >+ operation.setRelativeVariable(dialog.getVariable()); >+ operation.createVirtualFoldersAndLinks(names, targetContainer); >+ break; >+ case ImportTypeDialog.IMPORT_LINK: >+ if (dialog.getVariable() != null) >+ operation.setRelativeVariable(dialog.getVariable()); >+ operation.linkFiles(names, targetContainer); >+ break; >+ case ImportTypeDialog.IMPORT_NONE: >+ break; >+ } > } catch (JavaModelException e) { > String title = PackagesMessages.DropAdapter_errorTitle; > String message = PackagesMessages.DropAdapter_errorMessage; >Index: ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java,v >retrieving revision 1.38 >diff -u -r1.38 FileTransferDropAdapter.java >--- ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java 22 Apr 2009 12:53:24 -0000 1.38 >+++ ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDropAdapter.java 21 Apr 2010 19:42:20 -0000 >@@ -23,8 +23,10 @@ > > import org.eclipse.jface.util.TransferDropTargetListener; > import org.eclipse.jface.viewers.StructuredViewer; >+import org.eclipse.jface.window.Window; > > import org.eclipse.ui.actions.CopyFilesAndFoldersOperation; >+import org.eclipse.ui.ide.dialogs.ImportTypeDialog; > > import org.eclipse.jdt.core.IJavaElement; > import org.eclipse.jdt.core.IJavaProject; >@@ -93,8 +95,11 @@ > > if (isContainer) { > IContainer container= (IContainer)target; >- if (container.isAccessible() && !Resources.isReadOnly(container)) >+ if (container.isAccessible() && !Resources.isReadOnly(container)) { >+ if (container.isVirtual()) >+ return DND.DROP_LINK; > return DND.DROP_COPY; >+ } > } else { > IJavaElement element= (IJavaElement)target; > if (!element.isReadOnly()) >@@ -109,9 +114,9 @@ > */ > public boolean performDrop(final Object data) { > try { >- int operation= getCurrentOperation(); >+ final int operation= getCurrentOperation(); > >- if (data == null || !(data instanceof String[]) || operation != DND.DROP_COPY) >+ if (data == null || !(data instanceof String[]) || (operation != DND.DROP_COPY) && (operation != DND.DROP_LINK)) > return false; > > final IContainer target= getActualTarget(getCurrentTarget()); >@@ -124,7 +129,34 @@ > Display.getCurrent().asyncExec(new Runnable() { > public void run() { > getShell().forceActive(); >- new CopyFilesAndFoldersOperation(getShell()).copyFiles((String[]) data, target); >+ CopyFilesAndFoldersOperation copyOperation = new CopyFilesAndFoldersOperation(getShell()); >+ String[] names= (String[]) data; >+ // if the target is a group and all sources are files, then >+ // automatically create links >+ int type; >+ ImportTypeDialog dialog = new ImportTypeDialog(getShell(), operation, names, target); >+ dialog.setResource(target); >+ if (dialog.open() == Window.OK) >+ type = dialog.getSelection(); >+ else >+ type = ImportTypeDialog.IMPORT_NONE; >+ switch (type) { >+ case ImportTypeDialog.IMPORT_COPY: >+ copyOperation.copyFiles(names, target); >+ break; >+ case ImportTypeDialog.IMPORT_VIRTUAL_FOLDERS_AND_LINKS: >+ if (dialog.getVariable() != null) >+ copyOperation.setRelativeVariable(dialog.getVariable()); >+ copyOperation.createVirtualFoldersAndLinks(names, target); >+ break; >+ case ImportTypeDialog.IMPORT_LINK: >+ if (dialog.getVariable() != null) >+ copyOperation.setRelativeVariable(dialog.getVariable()); >+ copyOperation.linkFiles(names, target); >+ break; >+ case ImportTypeDialog.IMPORT_NONE: >+ break; >+ } > } > }); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 301187
:
160048
|
160049
|
165622
| 165627