1 /*******************************************************************************2 * Copyright (c) 2004, 2005 IBM Corporation and others.3 * All rights reserved. This program and the accompanying materials4 * are made available under the terms of the Eclipse Public License v1.05 * which accompanies this distribution, and is available at6 * http://www.eclipse.org/legal/epl-v10.html7 *8 * Contributors:9 * IBM Corporation - initial API and implementation10 *******************************************************************************/11 package org.eclipse.ui.internal.part;12 13 import org.eclipse.ui.IViewPart;14 import org.eclipse.ui.internal.components.framework.ComponentException;15 import org.eclipse.ui.internal.components.framework.ComponentFactory;16 import org.eclipse.ui.internal.components.framework.ComponentHandle;17 import org.eclipse.ui.internal.components.framework.Components;18 import org.eclipse.ui.internal.components.framework.IServiceProvider;19 import org.eclipse.ui.internal.part.components.services.IPartActionBars;20 21 /**22 * @since 3.123 */24 public class OldViewToNewWrapperFactory extends ComponentFactory {25 26 public ComponentHandle createHandle(IServiceProvider availableServices) throws ComponentException {27 IViewPart part = (IViewPart) Components.queryInterface(availableServices,28 IViewPart.class);29 30 IPartActionBars actionBars = (IPartActionBars) Components.queryInterface(availableServices,31 IPartActionBars.class);32 33 StandardWorkbenchServices services = new StandardWorkbenchServices(availableServices);34 35 return new ComponentHandle(new OldViewToNewWrapper(part, actionBars, services));36 }37 38 39 }40