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.core.plugin;
11:
12: import org.eclipse.core.runtime.CoreException;
13:
14: /**
15: * A model object that contains the portion of the plug-in model
16: * responsible for extensions and extension points. If
17: * the plug-in contains OSGi manifest file, plugin.xml is
18: * reduced to extensions and extension points only.
19: *
20: * @since 3.0
21: */
22: public interface IExtensions extends IPluginObject {
23: /**
24: * A model property that will be used when order of extensions
25: * changes in this object.
26: */
27: String P_EXTENSION_ORDER = "extension_order"; //$NON-NLS-1$
28:
29: /**
30: * Adds a new extension to this object. This
31: * method will throw a CoreException if
32: * model is not editable.
33: *
34: * @param extension the extension object
35: */
36: void add(IPluginExtension extension) throws CoreException;
37:
38: /**
39: * Adds a new extension point to this object.
40: * This method will throw a CoreException if the model is not editable.
41: *
42: * @param extensionPoint the extension point
43: */
44: void add(IPluginExtensionPoint extensionPoint) throws CoreException;
45:
46: /**
47: * Returns extension points defined in this object.
48: * @return an array of extension point objects
49: */
50: IPluginExtensionPoint[] getExtensionPoints();
51:
52: /**
53: * Returns extensions defined in this object.
54: *
55: * @return an array of extension objects
56: */
57: IPluginExtension[] getExtensions();
58:
59: /**
60: * Removes an extension from this object. This
61: * method will throw a CoreException if
62: * the model is not editable.
63: *
64: * @param extension the extension object
65: */
66: void remove(IPluginExtension extension) throws CoreException;
67:
68: /**
69: * Removes an extension point from this object. This
70: * method will throw a CoreException if
71: * the model is not editable.
72: *
73: * @param extensionPoint the extension point object
74: */
75: void remove(IPluginExtensionPoint extensionPoint)
76: throws CoreException;
77:
78: /**
79: * Swaps the positions of the provided extensions
80: * in the list of extensions.
81: *
82: * @param e1 the first extension object
83: * @param e2 the second extension object
84: */
85: void swap(IPluginExtension e1, IPluginExtension e2)
86: throws CoreException;
87:
88: /**
89: * Returns the position of the extension in the receiver.
90: * @param e the extension
91: * @return the 0-based index of the extension in the receiver.
92: */
93: int getIndexOf(IPluginExtension e);
94: }
|