01: /*******************************************************************************
02: * Copyright (c) 2006, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.editor;
11:
12: import org.eclipse.pde.internal.core.text.IEditingModel;
13: import org.eclipse.pde.internal.core.text.bundle.BundleModel;
14: import org.eclipse.pde.internal.core.text.plugin.PluginModel;
15: import org.eclipse.pde.internal.core.text.toc.TocModel;
16: import org.eclipse.pde.internal.ui.editor.plugin.BundleFoldingStructureProvider;
17: import org.eclipse.pde.internal.ui.editor.plugin.PluginFoldingStructureProvider;
18: import org.eclipse.pde.internal.ui.editor.toc.TocFoldingStructureProvider;
19:
20: public class FoldingStructureProviderFactory {
21:
22: public static IFoldingStructureProvider createProvider(
23: PDESourcePage editor, IEditingModel model) {
24: if (model instanceof PluginModel) {
25: return new PluginFoldingStructureProvider(editor, model);
26: }
27: if (model instanceof BundleModel) {
28: return new BundleFoldingStructureProvider(editor, model);
29: }
30: if (model instanceof TocModel) {
31: return new TocFoldingStructureProvider(editor, model);
32: }
33: return null;
34: }
35:
36: }
|