Bug 277836 [Compatibility] Setup Compatibility so you can run tests Remove the legacy hook.
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/workbench/ui/renderers/swt/SWTPartFactory.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/workbench/ui/renderers/swt/SWTPartFactory.java index 181519d..8fc9237 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/workbench/ui/renderers/swt/SWTPartFactory.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/workbench/ui/renderers/swt/SWTPartFactory.java
@@ -26,7 +26,6 @@ import org.eclipse.e4.ui.model.application.MToolBarItem; import org.eclipse.e4.ui.services.EHandlerService; import org.eclipse.e4.ui.workbench.swt.util.ISWTResourceUtiltities; -import org.eclipse.e4.workbench.ui.ILegacyHook; import org.eclipse.e4.workbench.ui.IResourceUtiltities; import org.eclipse.e4.workbench.ui.renderers.PartFactory; import org.eclipse.emf.common.notify.Notification; @@ -58,19 +57,6 @@ Widget widget = (Widget) widgetObject; Menu swtMenu; - if (menu != null && menu.getId() != null - && menu.getId().equals("org.eclipse.ui.main.menu")) { //$NON-NLS-1$ - menu.getItems().clear(); - // Pre-populate the main menu - ILegacyHook lh = (ILegacyHook) context.get(ILegacyHook.class - .getName()); - if (part.getContext() != null) { - lh.loadMenu(part.getContext(), menu); - } else { - lh.loadMenu(context, menu); - } - } - if (widget instanceof MenuItem) { swtMenu = new Menu(((MenuItem) widget).getParent().getShell(), SWT.DROP_DOWN); @@ -99,15 +85,6 @@ public Object createToolBar(MPart<?> part, Object widgetObject, MToolBar toolbar) { - if (toolbar != null && toolbar.getId() != null - && toolbar.getId().equals("org.eclipse.ui.main.toolbar") //$NON-NLS-1$ - && toolbar.getItems().size() == 0) { - // Pre-populate the main toolbar - ILegacyHook lh = (ILegacyHook) context.get(ILegacyHook.class - .getName()); - lh.loadToolbar(toolbar); - } - int orientation = SWT.HORIZONTAL; Composite composite = (Composite) widgetObject; if (composite.getLayout() instanceof RowLayout) {
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/ILegacyHook.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/ILegacyHook.java deleted file mode 100644 index 0878a31..0000000 --- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/workbench/ui/ILegacyHook.java +++ /dev/null
@@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.workbench.ui; - -import org.eclipse.e4.core.services.context.IEclipseContext; -import org.eclipse.e4.ui.model.application.MMenu; -import org.eclipse.e4.ui.model.application.MToolBar; -import org.eclipse.e4.ui.model.workbench.MPerspective; - -public interface ILegacyHook { - public void loadMenu(IEclipseContext context, MMenu menuModel); - - public void loadToolbar(MToolBar toolbar); - - public void loadPerspective(MPerspective<?> perspModel); -}