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 125183 Details for
Bug 263845
[CommonNavigator] Drag/drop folder from non-Java Proj to Java Proj does copy instead of move sometimes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch
clipboard.txt (text/plain), 4.30 KB, created by
Francis Upton IV
on 2009-02-09 18:53:57 EST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Francis Upton IV
Created:
2009-02-09 18:53:57 EST
Size:
4.30 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface >Index: src/org/eclipse/jface/viewers/ViewerDropAdapter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/ViewerDropAdapter.java,v >retrieving revision 1.16 >diff -u -r1.16 ViewerDropAdapter.java >--- src/org/eclipse/jface/viewers/ViewerDropAdapter.java 4 Feb 2009 20:45:28 -0000 1.16 >+++ src/org/eclipse/jface/viewers/ViewerDropAdapter.java 9 Feb 2009 23:53:29 -0000 >@@ -85,6 +85,13 @@ > private int lastValidOperation; > > /** >+ * This is used because we allow the operation >+ * to be temporarily overridden (for example a move to a copy) for a drop that >+ * happens immediately after the operation is overridden. >+ */ >+ private int overrideOperation; >+ >+ /** > * The current DropTargetEvent, used only during validateDrop() > */ > private DropTargetEvent currentEvent; >@@ -181,18 +188,23 @@ > * that it is still enabled. > */ > private void doDropValidation(DropTargetEvent event) { >- //always remember what was previously requested >- if (event.detail != DND.DROP_NONE) >+ //always remember what was previously requested, but not if it >+ //was overridden >+ if (event.detail != DND.DROP_NONE && overrideOperation == -1) > lastValidOperation = event.detail; > > currentOperation = lastValidOperation; >- >- //the client may change the currentOperation inside of here > currentEvent = event; >+ overrideOperation = -1; > if (!validateDrop(currentTarget, currentOperation, event.currentDataType)) { >- currentOperation = DND.DROP_NONE; >+ currentOperation = DND.DROP_NONE; > } >- event.detail = currentOperation; >+ >+ //give the right feedback for the override >+ if (overrideOperation != -1) >+ event.detail = overrideOperation; >+ else >+ event.detail = currentOperation; > currentEvent = null; > } > >@@ -246,6 +258,9 @@ > currentLocation = determineLocation(event); > currentEvent = event; > >+ if (overrideOperation != -1) >+ currentOperation = overrideOperation; >+ > //perform the drop behavior > if (!performDrop(event.data)) { > event.detail = DND.DROP_NONE; >@@ -402,14 +417,15 @@ > public abstract boolean performDrop(Object data); > > /** >- * Sets the current operation. >+ * Overrides the current operation for a drop that happens immediately >+ * after the current validateDrop. > * > * This maybe called only from within a > * {@link #validateDrop(Object, int, TransferData)} method > * > * > * @param operation >- * the operation to set to be current. >+ * the operation to be used for the drop. > * > * @see DND#DROP_COPY > * @see DND#DROP_MOVE >@@ -418,10 +434,10 @@ > * > * @since 3.5 > */ >- protected void setCurrentOperation(int operation) { >- currentOperation = operation; >+ protected void overrideOperation(int operation) { >+ overrideOperation = operation; > } >- >+ > /* (non-Javadoc) > * Method declared on DropTargetAdapter. > * The mouse has moved over the drop target. If the >#P org.eclipse.ui.navigator >Index: src/org/eclipse/ui/navigator/CommonDropAdapter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonDropAdapter.java,v >retrieving revision 1.22 >diff -u -r1.22 CommonDropAdapter.java >--- src/org/eclipse/ui/navigator/CommonDropAdapter.java 9 Feb 2009 21:57:41 -0000 1.22 >+++ src/org/eclipse/ui/navigator/CommonDropAdapter.java 9 Feb 2009 23:53:30 -0000 >@@ -304,11 +304,23 @@ > } > > /** >- * @see org.eclipse.jface.viewers.ViewerDropAdapter#setCurrentOperation(int) >+ * Goes away once JDT has hooked to overrideOperation >+ * @param operation > * @since 3.4 > */ > public void setCurrentOperation(int operation) { >- super.setCurrentOperation(operation); >+ overrideOperation(operation); >+ } >+ >+ /** >+ * @see org.eclipse.jface.viewers.ViewerDropAdapter#overrideOperation(int) >+ * @since 3.4 >+ */ >+ public void overrideOperation(int operation) { >+ if (Policy.DEBUG_DND) { >+ System.out.println("CommonDropAdapter.overrideOperation: " + operation); //$NON-NLS-1$ >+ } >+ super.overrideOperation(operation); > } > > /*
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 263845
: 125183 |
125729