01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 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.core.ibundle;
11:
12: import org.eclipse.pde.core.IEditable;
13: import org.eclipse.pde.core.plugin.IPluginImport;
14: import org.eclipse.pde.core.plugin.IPluginLibrary;
15: import org.eclipse.pde.core.plugin.IPluginModelBase;
16: import org.eclipse.pde.core.plugin.ISharedExtensionsModel;
17:
18: /**
19: * An adapter of the pre-3.0 plug-in model base interface that is capable of
20: * maintaining the predictable facade when dealing with plug-in with OSGi
21: * manifest files. The goal is to use the same adapter interface with the
22: * manifest coming and going and transparently switch between
23: * META-INF/MANIFEST.MF and plugin.xml/fragment.xml.
24: *
25: * @since 3.0
26: */
27: public interface IBundlePluginModelBase extends IPluginModelBase,
28: IEditable {
29: /**
30: * Returns the underlying OSGi bundle model object if bundle manifest is
31: * present.
32: *
33: * @return OSGi bundle model or <code>null</code> if bundle manifest is
34: * not present.
35: */
36: IBundleModel getBundleModel();
37:
38: /**
39: * Returns the model that is responsible for tracking extensions and
40: * extension points. Typically this content is stored in plugin.xml file.
41: *
42: * @return extensions model or <code>null</code> if not present.
43: */
44: ISharedExtensionsModel getExtensionsModel();
45:
46: /**
47: * Sets the bundle manifest model for this adapter. All calls related to
48: * data that is normally stored in this model (e.g. plug-in ID, plug-in
49: * name, provider name etc.) will be delegated to it if not
50: * <code>null</code>.
51: *
52: * @param bundleModel
53: * the bundle model to use in this adapter or <code>null</code>
54: * if there is no bundle model.
55: */
56: void setBundleModel(IBundleModel bundleModel);
57:
58: /**
59: * Sets the extensions model for this adapter. All the calls related to
60: * extensions and extension points will be delegated to this model if not
61: * <code>null</code>.
62: *
63: * @param extensionsModel
64: * the model that stores extensions and extension points
65: */
66: void setExtensionsModel(ISharedExtensionsModel extensionsModel);
67:
68: /**
69: * Factory method for creating a new import object. This is important for
70: * maintaining the adapter because <code>IPluginBase</code> returns an
71: * array of <code>IPluginImport</code> objects for dependency information.
72: *
73: * @return a newly created import object
74: */
75: IPluginImport createImport();
76:
77: /**
78: * Factory method for creating a new runtime object. This is important for
79: * maintaining the adapter because <code>IPluginBase</code> returns an
80: * array of <code>IPluginLibrary</code> objects for runtime information.
81: *
82: * @return a newly created plug-in library object
83: */
84: IPluginLibrary createLibrary();
85:
86: /**
87: * Saves the adapter by delegating the operation to the underlying models
88: * that need saving.
89: */
90: void save();
91:
92: /**
93: * Returns the bundle localization
94: * @return the bundle localization
95: */
96: String getBundleLocalization();
97: }
|