Skip to content

Commit bf58da2

Browse files
committed
Dropping a file onto the top of an image wasn't possible on a label
containing an imageView.The issue was previously fixed via eclipse-platform/eclipse.platform.swt#649. However, in the workbench, dropping onto the image still didn’t work. The issue is now resolved by calling a DropTarget on the shell obtained from the active IWorkbenchWindow.
1 parent 789b373 commit bf58da2

File tree

1 file changed

+6
-0
lines changed
  • bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt

1 file changed

+6
-0
lines changed

bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
import org.eclipse.swt.custom.CTabFolder2Listener;
8888
import org.eclipse.swt.custom.CTabFolderEvent;
8989
import org.eclipse.swt.custom.CTabItem;
90+
import org.eclipse.swt.dnd.DND;
91+
import org.eclipse.swt.dnd.DropTarget;
9092
import org.eclipse.swt.events.ControlEvent;
9193
import org.eclipse.swt.events.ControlListener;
9294
import org.eclipse.swt.events.MouseAdapter;
@@ -158,6 +160,8 @@ public class StackRenderer extends LazyStackRenderer {
158160
*/
159161
private static final String TAB_FONT_KEY = "org.eclipse.ui.workbench.TAB_TEXT_FONT"; //$NON-NLS-1$
160162

163+
private static final int DROP_OPERATIONS = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
164+
161165
@Inject
162166
@Preference(nodePath = "org.eclipse.e4.ui.workbench.renderers.swt")
163167
private IEclipsePreferences preferences;
@@ -719,6 +723,8 @@ public Object createWidget(MUIElement element, Object parent) {
719723
if (PartStackUtil.isEditorStack(element)) {
720724
createOnboardingControls(tabFolder);
721725
initializeOnboardingInformationInEditorStack(tabFolder);
726+
Shell shell = Display.getCurrent().getActiveShell();
727+
new DropTarget(shell, DROP_OPERATIONS);
722728
}
723729
tabFolder.setMRUVisible(getMRUValue());
724730

0 commit comments

Comments
 (0)