KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > core > plugin > IPluginModelBase


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.core.plugin;
12
13 import java.net.URL JavaDoc;
14
15 import org.eclipse.osgi.service.resolver.BundleDescription;
16 import org.eclipse.pde.core.IModelChangeProvider;
17 import org.eclipse.pde.core.build.IBuildModel;
18 /**
19  * This type of model is created by parsing the manifest file.
20  * It serves as a base interface for both plug-in and
21  * fragment models by holding data common to both.
22  * If the file is a workspace resource, it will be
23  * available as the underlying resource of the model.
24  * The model may be read-only or editable.
25  * It will also make a reference to the build.properties
26  * model when created. The reference will be of the
27  * same type as the model itself: if the model is
28  * editable, it will attempt to obtain an exclusive
29  * editable copy of build.properties model.
30  * <p>
31  * The plug-in model can be disabled. Disabling the
32  * model will not change its data. Users of the
33  * model will have to decide if the disabled state
34  * if of any importance to them or not.
35  * <p>
36  * The model is capable of notifying listeners
37  * about changes. An attempt to change a read-only
38  * model will result in a CoreException.
39  */

40 public interface IPluginModelBase extends ISharedExtensionsModel, IModelChangeProvider {
41     /**
42      * Creates and return a top-level plugin model object
43      *
44      * @return a top-level model object representing a plug-in or a fragment.
45      */

46     IPluginBase createPluginBase();
47     /**
48      * Returns an associated build.properties model
49      * that works in conjunction with this model.
50      *
51      * @return the matching plugin.jars model
52      */

53     IBuildModel getBuildModel();
54     /**
55      * Returns a top-level model object. Equivalent to
56      * calling <pre>getPluginBase(true)</pre>.
57      *
58      * @return a top-level model object representing a plug-in or a fragment.
59      */

60     IPluginBase getPluginBase();
61     /**
62      * Returns a top-level model object.
63      *
64      * @param createIfMissing if true, root model object will
65      * be created if not defined.
66      *
67      * @return a top-level model object
68      */

69     IPluginBase getPluginBase(boolean createIfMissing);
70     /**
71      * Returns </samp>true</samp> if this model is currently enabled.
72      *
73      *@return true if the model is enabled
74      */

75     boolean isEnabled();
76     /**
77      * Tests if this model is for the plug-in fragment.
78      *
79      * @return <code>true</code> if the model is for the fragment,
80      * <code>false</code> otherwise.
81      */

82     boolean isFragmentModel();
83     /**
84      * Sets the enable state of the model.
85      *
86      * @param enabled the new enable state
87      */

88     void setEnabled(boolean enabled);
89     /**
90      * Returns the factory that can be used to
91      * create new objects for this model
92      * @return the plug-in model factory
93      */

94     IPluginModelFactory getPluginFactory();
95     /**
96      * Returns the location where property file containing
97      * translations of names in this model can be found.
98      *
99      * @return the location of the property file with translations
100      */

101     URL JavaDoc getNLLookupLocation();
102     /**
103      * Returns the bundle description of the plug-in
104      * in case the plug-in uses the new OSGi bundle layout.
105      *
106      * @return bundle description if this is an OSGi plug-in,
107      * or <code>null</code> if the plug-in is in a classic
108      * format.
109      *
110      * @since 3.0
111      */

112     BundleDescription getBundleDescription();
113     /**
114      * Associates the bundle description of the plug-in
115      * with this model in case the plug-in uses the new
116      * OSGi bundle layout.
117      *
118      * @param description bundle description to associate
119      * with this model
120      *
121      * @since 3.0
122      */

123     void setBundleDescription(BundleDescription description);
124 }
125
Popular Tags