KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > runtime > IExecutableExtensionFactory


1 /*******************************************************************************
2  * Copyright (c) 2005, 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.core.runtime;
12
13 import org.eclipse.core.runtime.CoreException;
14
15 /**
16  * This interface allows extension providers to control how the instances provided to extension-points are being created
17  * by referring to the factory instead of referring to a class. For example, the following extension to the preference page
18  * extension-point uses a factory called <code>PreferencePageFactory</code>.
19  * <code><pre>
20  * <extension point="org.eclipse.ui.preferencePages">
21  * <page name="..." class="org.eclipse.update.ui.PreferencePageFactory:org.eclipse.update.ui.preferences.MainPreferencePage">
22  * </page>
23  * </extension>
24  * </pre>
25  * </code>
26  *
27  * <p>
28  * Effectively, factories give full control over the create executable extension process.
29  * </p><p>
30  * The factories are responsible for handling the case where the concrete instance implement {@link IExecutableExtension}.
31  * </p><p>
32  * Given that factories are instantiated as executable extensions, they must provide a 0-argument public constructor.
33  * Like any other executable extension, they can configured by implementing {@link org.eclipse.core.runtime.IExecutableExtension} interface.
34  * </p><p>
35  * This interface can be used without OSGi running.
36  * </p>
37  * @see org.eclipse.core.runtime.IConfigurationElement
38  */

39 public interface IExecutableExtensionFactory {
40     /**
41      * Creates and returns a new instance.
42      *
43      * @exception CoreException if an instance of the executable extension
44      * could not be created for any reason
45      */

46     Object JavaDoc create() throws CoreException;
47 }
48
Popular Tags