KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > runtime > model > ExtensionModel


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.core.runtime.model;
12
13 /**
14  * An object which represents the user-defined extension in a plug-in manifest.
15  * <p>
16  * This class may be instantiated, or further subclassed.
17  * </p>
18  * @deprecated In Eclipse 3.0 the runtime was refactored and all
19  * non-essential elements removed. This class provides facilities primarily intended
20  * for tooling. As such it has been removed and no directly substitutable API provided.
21  */

22 public class ExtensionModel extends PluginModelObject {
23
24     // DTD properties (included in plug-in manifest)
25
private String JavaDoc extensionPoint = null;
26     private String JavaDoc id = null;
27     private ConfigurationElementModel[] elements = null;
28
29     // transient properties (not included in plug-in manifest)
30
private PluginModel plugin = null; // declaring plugin
31

32     /**
33      * Creates a new extension model in which all fields are <code>null</code>.
34      */

35     public ExtensionModel() {
36         super();
37     }
38
39     /**
40      * Returns the extension point with which this extension is associated.
41      *
42      * @return the extension point with which this extension is associated or
43      * <code>null</code>
44      */

45     public String JavaDoc getExtensionPoint() {
46         return extensionPoint;
47     }
48
49     /**
50      * Returns the simple identifier of this extension, or <code>null</code>
51      * if this extension does not have an identifier. This identifier is
52      * specified in the plug-in manifest as a non-empty string containing no
53      * period characters (<code>'.'</code>) and must be unique within the
54      * defining plug-in.
55      *
56      * @return the simple identifier of the extension (e.g. <code>"main"</code>)
57      * or <code>null</code>
58      */

59     public String JavaDoc getId() {
60         return id;
61     }
62
63     /**
64      * Returns the plug-in model (descriptor or fragment) in which this
65      * extension is declared.
66      *
67      * @return the plug-in model in which this extension is declared or <code>null</code>
68      */

69     public PluginModel getParent() {
70         return plugin;
71     }
72
73     /**
74      * Returns the plug-in descriptor in which this extension is declared.
75      *
76      * @return the plug-in descriptor in which this extension is declared or
77      * <code>null</code>
78      */

79     public PluginDescriptorModel getParentPluginDescriptor() {
80         return (PluginDescriptorModel) plugin;
81     }
82
83     /**
84      * Returns the configuration element children of this extension.
85      *
86      * @return the configuration elements in this extension or <code>null</code>
87      */

88     public ConfigurationElementModel[] getSubElements() {
89         return elements;
90     }
91
92     /**
93      * Sets this model object and all of its descendents to be read-only.
94      * Subclasses may extend this implementation.
95      *
96      * @see #isReadOnly()
97      */

98     public void markReadOnly() {
99         super.markReadOnly();
100         if (elements != null)
101             for (int i = 0; i < elements.length; i++)
102                 elements[i].markReadOnly();
103     }
104
105     /**
106      * Set the extension point with which this extension is associated. This
107      * object must not be read-only.
108      *
109      * @param value the extension point with which this extension is associated. May
110      * be <code>null</code>.
111      */

112     public void setExtensionPoint(String JavaDoc value) {
113         assertIsWriteable();
114         extensionPoint = value;
115     }
116
117     /**
118      * Sets the simple identifier of this extension, or <code>null</code> if
119      * this extension does not have an identifier. This identifier is specified
120      * in the plug-in manifest as a non-empty string containing no period
121      * characters (<code>'.'</code>) and must be unique within the defining
122      * plug-in. This object must not be read-only.
123      *
124      * @param value
125      * the simple identifier of the extension (e.g. <code>"main"</code>).
126      * May be <code>null</code>.
127      */

128     public void setId(String JavaDoc value) {
129         assertIsWriteable();
130         id = value;
131     }
132
133     /**
134      * Sets the plug-in model in which this extension is declared. This object
135      * must not be read-only.
136      *
137      * @param value
138      * the plug-in model in which this extension is declared. May be
139      * <code>null</code>.
140      */

141     public void setParent(PluginModel value) {
142         assertIsWriteable();
143         plugin = value;
144     }
145
146     /**
147      * Sets the plug-in descriptor in which this extension is declared. This
148      * object must not be read-only.
149      *
150      * @param value
151      * the plug-in descriptor in which this extension is declared.
152      * May be <code>null</code>.
153      */

154     public void setParentPluginDescriptor(PluginDescriptorModel value) {
155         assertIsWriteable();
156         plugin = value;
157     }
158
159     /**
160      * Sets the configuration element children of this extension. This object
161      * must not be read-only.
162      *
163      * @param value
164      * the configuration elements in this extension. May be <code>null</code>.
165      */

166     public void setSubElements(ConfigurationElementModel[] value) {
167         assertIsWriteable();
168         elements = value;
169     }
170 }
171
Popular Tags