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 58288 Details for
Bug 165553
Regression: CView lost some Drag&Drop functionality support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch to fix the problem
bug165553.patch (text/plain), 7.56 KB, created by
Alex Chapiro
on 2007-02-05 16:59:27 EST
(
hide
)
Description:
Patch to fix the problem
Filename:
MIME Type:
Creator:
Alex Chapiro
Created:
2007-02-05 16:59:27 EST
Size:
7.56 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.ui >Index: src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java,v >retrieving revision 1.52 >diff -u -r1.52 CContentOutlinePage.java >--- src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java 14 Jun 2006 12:15:52 -0000 1.52 >+++ src/org/eclipse/cdt/internal/ui/editor/CContentOutlinePage.java 5 Feb 2007 20:45:26 -0000 >@@ -456,7 +456,8 @@ > TransferDropTargetListener[] dropListeners= new TransferDropTargetListener[] { > new SelectionTransferDropAdapter(fTreeViewer) > }; >- fTreeViewer.addDropSupport(ops | DND.DROP_DEFAULT, transfers, new DelegatingDropAdapter(dropListeners)); >+ fTreeViewer.addDropSupport(ops | DND.DROP_DEFAULT, transfers, >+ new DelegatingDropAdapter(fTreeViewer, dropListeners)); > > // Drag Adapter > TransferDragSourceListener[] dragListeners= new TransferDragSourceListener[] { >Index: src/org/eclipse/cdt/internal/ui/dnd/DelegatingDropAdapter.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dnd/DelegatingDropAdapter.java,v >retrieving revision 1.2 >diff -u -r1.2 DelegatingDropAdapter.java >--- src/org/eclipse/cdt/internal/ui/dnd/DelegatingDropAdapter.java 23 Jun 2005 16:01:25 -0000 1.2 >+++ src/org/eclipse/cdt/internal/ui/dnd/DelegatingDropAdapter.java 5 Feb 2007 20:45:26 -0000 >@@ -11,19 +11,23 @@ > > package org.eclipse.cdt.internal.ui.dnd; > >+import org.eclipse.cdt.core.model.ICElement; >+import org.eclipse.core.resources.IContainer; > import org.eclipse.core.runtime.Platform; > import org.eclipse.jface.util.Assert; > import org.eclipse.jface.util.SafeRunnable; >+import org.eclipse.jface.viewers.StructuredViewer; > import org.eclipse.swt.dnd.DND; > import org.eclipse.swt.dnd.DropTargetEvent; > import org.eclipse.swt.dnd.DropTargetListener; > import org.eclipse.swt.dnd.Transfer; > import org.eclipse.swt.dnd.TransferData; >+import org.eclipse.ui.part.PluginDropAdapter; > > /** > * DelegatingDropAdapter > */ >-public class DelegatingDropAdapter implements DropTargetListener { >+public class DelegatingDropAdapter extends PluginDropAdapter { // implements DropTargetListener { > private TransferDropTargetListener[] fListeners; > TransferDropTargetListener fCurrentListener; > private int fOriginalDropType; >@@ -33,7 +37,8 @@ > * > * @param listeners an array of potential listeners > */ >- public DelegatingDropAdapter(TransferDropTargetListener[] listeners) { >+ public DelegatingDropAdapter(StructuredViewer viewer, TransferDropTargetListener[] listeners) { >+ super(viewer); > Assert.isNotNull(listeners); > fListeners= listeners; > } >@@ -49,6 +54,7 @@ > public void dragEnter(DropTargetEvent event) { > fOriginalDropType= event.detail; > updateCurrentListener(event); >+ super.dragEnter(event); > } > > /** >@@ -78,13 +84,14 @@ > // only notify the current listener if it hasn't changed based on the > // operation change. otherwise the new listener would get a dragEnter > // followed by a dragOperationChanged with the exact same event. >- if (newListener != null && newListener == oldListener) { >+ if ((newListener != null) && (newListener == oldListener)) { > Platform.run(new SafeRunnable() { > public void run() throws Exception { > newListener.dragOperationChanged(event); > } > }); > } >+ super.dragOperationChanged(event); > } > > /** >@@ -104,12 +111,16 @@ > // only notify the current listener if it hasn't changed based on the > // drag over. otherwise the new listener would get a dragEnter > // followed by a dragOver with the exact same event. >- if (newListener != null && newListener == oldListener) { >- Platform.run(new SafeRunnable() { >- public void run() throws Exception { >- newListener.dragOver(event); >- } >- }); >+ if (newListener != null) { >+ if(newListener == oldListener) { >+ Platform.run(new SafeRunnable() { >+ public void run() throws Exception { >+ newListener.dragOver(event); >+ } >+ }); >+ } >+ } else { >+ super.dragOver(event); > } > } > >@@ -128,7 +139,8 @@ > getCurrentListener().drop(event); > } > }); >- } >+ } else >+ super.drop(event); > setCurrentListener(null, event); > } > >@@ -139,13 +151,18 @@ > * @see DropTargetListener#dropAccept(DropTargetEvent) > */ > public void dropAccept(final DropTargetEvent event) { >+ updateCurrentListener(event); > if (getCurrentListener() != null) { > Platform.run(new SafeRunnable() { > public void run() throws Exception { > getCurrentListener().dropAccept(event); > } > }); >- } >+ } else >+ super.dropAccept(event); >+ // Copy is the default operation >+ if(DND.DROP_DEFAULT == event.detail) >+ event.detail = DND.DROP_COPY; > } > > /** >@@ -231,7 +248,7 @@ > * > * @param event the drop target event > */ >- private void updateCurrentListener(DropTargetEvent event) { >+ private boolean updateCurrentListener(DropTargetEvent event) { > int originalDetail= event.detail; > // Revert the detail to the "original" drop type that the User > // indicated. This is necessary because the previous listener >@@ -252,13 +269,29 @@ > // event detail > if (!setCurrentListener(listener, event)) > event.detail= originalDetail; >- return; >+ return true; > } > event.currentDataType= originalDataType; > } > } > setCurrentListener(null, event); >- event.detail= DND.DROP_NONE; >+ // event.detail= DND.DROP_NONE; >+ return false; >+ } >+ >+ protected Object determineTarget(DropTargetEvent event) { >+ Object dropTarget = super.determineTarget(event); >+ if (dropTarget instanceof ICElement) >+ dropTarget = ((ICElement)dropTarget).getResource(); >+ return dropTarget; >+ } >+ >+ protected Object getCurrentTarget() { >+ Object dropTarget = super.getCurrentTarget(); >+ if (dropTarget instanceof IContainer) { >+ return dropTarget; >+ } else >+ return null; > } > > } >Index: src/org/eclipse/cdt/internal/ui/cview/CView.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java,v >retrieving revision 1.61.2.3 >diff -u -r1.61.2.3 CView.java >--- src/org/eclipse/cdt/internal/ui/cview/CView.java 6 Nov 2006 16:54:48 -0000 1.61.2.3 >+++ src/org/eclipse/cdt/internal/ui/cview/CView.java 5 Feb 2007 20:45:26 -0000 >@@ -103,6 +103,7 @@ > import org.eclipse.ui.part.ISetSelectionTarget; > import org.eclipse.ui.part.IShowInSource; > import org.eclipse.ui.part.IShowInTarget; >+import org.eclipse.ui.part.PluginTransfer; > import org.eclipse.ui.part.ResourceTransfer; > import org.eclipse.ui.part.ShowInContext; > import org.eclipse.ui.part.ViewPart; >@@ -407,13 +408,14 @@ > Transfer[] transfers= new Transfer[] { > LocalSelectionTransfer.getInstance(), > ResourceTransfer.getInstance(), >- FileTransfer.getInstance()}; >+ FileTransfer.getInstance(), >+ PluginTransfer.getInstance()}; > TransferDropTargetListener[] dropListeners= new TransferDropTargetListener[] { > new SelectionTransferDropAdapter(viewer), > new ResourceTransferDropAdapter(viewer), > new FileTransferDropAdapter(viewer) > }; >- viewer.addDropSupport(ops, transfers, new DelegatingDropAdapter(dropListeners)); >+ viewer.addDropSupport(ops, transfers, new DelegatingDropAdapter(viewer, dropListeners)); > } > > /**
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
Flags:
bjorn.freeman-benson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 165553
: 58288 |
81211