Skip to content

Enable dropping files onto labels containing ImageView in the workbench #3102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
import org.eclipse.swt.custom.CTabFolder2Listener;
import org.eclipse.swt.custom.CTabFolderEvent;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DropTarget;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.events.MouseAdapter;
Expand Down Expand Up @@ -158,6 +160,8 @@ public class StackRenderer extends LazyStackRenderer {
*/
private static final String TAB_FONT_KEY = "org.eclipse.ui.workbench.TAB_TEXT_FONT"; //$NON-NLS-1$

private static final int DROP_OPERATIONS = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;

@Inject
@Preference(nodePath = "org.eclipse.e4.ui.workbench.renderers.swt")
private IEclipsePreferences preferences;
Expand Down Expand Up @@ -719,6 +723,8 @@ public Object createWidget(MUIElement element, Object parent) {
if (PartStackUtil.isEditorStack(element)) {
createOnboardingControls(tabFolder);
initializeOnboardingInformationInEditorStack(tabFolder);
Shell shell = Display.getCurrent().getActiveShell();
new DropTarget(shell, DROP_OPERATIONS);
}
tabFolder.setMRUVisible(getMRUValue());

Expand Down
Loading