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.core.runtime.CoreException;14 import org.eclipse.ui.IEditorPart;15 import org.eclipse.ui.internal.components.framework.ComponentException;16 import org.eclipse.ui.internal.components.framework.ComponentFactory;17 import org.eclipse.ui.internal.components.framework.ComponentHandle;18 import org.eclipse.ui.internal.components.framework.Components;19 import org.eclipse.ui.internal.components.framework.IServiceProvider;20 21 /**22 * @since 3.123 */24 public class OldEditorToNewWrapperFactory extends ComponentFactory {25 /* (non-Javadoc)26 * @see org.eclipse.core.components.ComponentFactory#getHandle(org.eclipse.core.components.IComponentProvider)27 */28 public ComponentHandle createHandle(IServiceProvider availableServices)29 throws ComponentException {30 IEditorPart part = (IEditorPart) Components.queryInterface(availableServices,31 IEditorPart.class);32 33 StandardWorkbenchServices services = new StandardWorkbenchServices(availableServices);34 35 try {36 return new ComponentHandle(new OldEditorToNewWrapper(part, services));37 // bundle, composite, 38 // new ProviderToAdaptableAdapter(availableServices), input, page, actionBars, selectionHandler,39 // name, state, status, partDescriptor), true);40 } catch (CoreException e) {41 throw new ComponentException(part.getClass(), e);42 } 43 44 }45 }46