KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.eclipse.core.runtime.CoreException;
14 import org.eclipse.pde.core.IIdentifiable;
15 /**
16  * A model object that represents the content of a plug-in or
17  * fragment manifest. This object contains data that is common
18  * for bo plug-ins and fragments.
19  */

20 public interface IPluginBase extends IExtensions, IIdentifiable {
21     /**
22      * A property that will be used to notify that
23      * the provider name has changed.
24      */

25     String JavaDoc P_PROVIDER = "provider-name"; //$NON-NLS-1$
26
/**
27      * A property that will be used to notify
28      * that a version has changed.
29      */

30     String JavaDoc P_VERSION = "version"; //$NON-NLS-1$
31

32     /**
33      * A property that will be used to notify
34      * that library order in a plug-in has changed.
35      */

36     String JavaDoc P_LIBRARY_ORDER = "library_order"; //$NON-NLS-1$
37

38     /**
39      * A property that will be used to notify
40      * that import order in a plug-in has changed.
41      */

42     String JavaDoc P_IMPORT_ORDER = "import_order"; //$NON-NLS-1$
43

44     /**
45      * A property that will be used to notify
46      * that 3.0 release compatibility flag has been changed.
47      */

48     String JavaDoc P_SCHEMA_VERSION = "schema-version"; //$NON-NLS-1$
49
/**
50      * Adds a new library to this plugin.
51      * This method will throw a CoreException if
52      * model is not editable.
53      *
54      * @param library the new library
55      */

56     void add(IPluginLibrary library) throws CoreException;
57
58     /**
59      * Adds a new plug-in import to this plugin.
60      * This method will throw a CoreException if
61      * model is not editable.
62      *
63      * @param pluginImport the new import object
64      */

65     void add(IPluginImport pluginImport) throws CoreException;
66     /**
67      * Removes an import from the plugin. This
68      * method will throw a CoreException if
69      * the model is not editable.
70      *
71      * @param pluginImport the import object
72      */

73     void remove(IPluginImport pluginImport) throws CoreException;
74     /**
75      * Returns libraries referenced in this plug-in.
76      *
77      * @return an array of libraries
78      */

79     IPluginLibrary[] getLibraries();
80     /**
81      * Returns imports defined in this plug-in.
82      *
83      * @return an array of import objects
84      */

85     IPluginImport[] getImports();
86     /**
87      * Returns a name of the plug-in provider.
88      *
89      * @return plug-in provider name
90      */

91     String JavaDoc getProviderName();
92     /**
93      * Returns this plug-in's version
94      * @return the version of the plug-in
95      */

96     String JavaDoc getVersion();
97     /**
98      * Removes a library from the plugin. This
99      * method will throw a CoreException if
100      * the model is not editable.
101      *
102      * @param library the library object
103      */

104     void remove(IPluginLibrary library) throws CoreException;
105     /**
106      * Sets the name of the plug-in provider.
107      * This method will throw a CoreException
108      * if the model is not editable.
109      *
110      * @param providerName the new provider name
111      */

112     void setProviderName(String JavaDoc providerName) throws CoreException;
113     /**
114      * Sets the version of the plug-in.
115      * This method will throw a CoreException
116      * if the model is not editable.
117      *
118      * @param version the new plug-in version
119      */

120     void setVersion(String JavaDoc version) throws CoreException;
121     /**
122      * Swaps the positions of the provided libraries
123      * in the list of libraries. Libraries are looked up
124      * by the class loader in the order of declaration.
125      * If two libraries contain classes with the same
126      * name, library order will determine which one is
127      * encountered first.
128      *
129      * @param l1 the first library object
130      * @param l2 the second library object
131      */

132     void swap(IPluginLibrary l1, IPluginLibrary l2) throws CoreException;
133     
134     /**
135      * Swaps the positions of the plug-ins provided in
136      * in the dependency list. This order is the one used
137      * used by the classloader when loading classes.
138      *
139      * @param import1 the first import object
140      * @param import2 the second import object
141      */

142     void swap(IPluginImport import1, IPluginImport import2) throws CoreException;
143     
144     /**
145      * Returns version of the manifest grammar
146      * @return version of the manifest grammar, or <samp>null</samp>
147      */

148     String JavaDoc getSchemaVersion();
149     /**
150      * Sets the R3.0 compatibility flag
151      * @param schemaVersion version of the manifest grammar
152      */

153     void setSchemaVersion(String JavaDoc schemaVersion) throws CoreException;
154     
155 }
156
Popular Tags