1 /*******************************************************************************2 * Copyright (c) 2006 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.pde.internal.ui.editor;12 13 import org.eclipse.pde.internal.core.text.IEditingModel;14 import org.eclipse.pde.internal.core.text.bundle.BundleModel;15 import org.eclipse.pde.internal.core.text.plugin.PluginModel;16 import org.eclipse.pde.internal.ui.editor.plugin.BundleFoldingStructureProvider;17 import org.eclipse.pde.internal.ui.editor.plugin.PluginFoldingStructureProvider;18 19 20 public class FoldingStructureProviderFactory {21 22 public static IFoldingStructureProvider createProvider(PDESourcePage editor, IEditingModel model) {23 if(model instanceof PluginModel) {24 return new PluginFoldingStructureProvider(editor, model);25 }26 if(model instanceof BundleModel) {27 return new BundleFoldingStructureProvider(editor, model);28 }29 return null;30 }31 32 }33