KickJava   Java API By Example, From Geeks To Geeks.

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


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 contents of a plug-in
15  * in a plug-in manifest.
16  * <p>
17  * This class may be instantiated, or further subclassed.
18  * </p>
19  * @deprecated In Eclipse 3.0 the runtime was refactored and all
20  * non-essential elements removed. This class provides facilities primarily intended
21  * for tooling. As such it has been removed and no directly substitutable API provided.
22  */

23 public class PluginDescriptorModel extends PluginModel {
24
25     // DTD properties (included in plug-in manifest)
26
private String JavaDoc pluginClass = null;
27
28     // transient properties (not included in plug-in manifest)
29
private boolean enabled = true; // whether or not the plugin definition loaded ok
30
private PluginFragmentModel[] fragments;
31
32     /**
33      * Creates a new plug-in descriptor model in which all fields
34      * are <code>null</code>.
35      */

36     public PluginDescriptorModel() {
37         super();
38     }
39
40     /**
41      * Returns true if this plugin has all of it's prerequisites and is,
42      * therefore enabled.
43      *
44      * @return whether or not this plug-in is fully resolved
45      */

46     public boolean getEnabled() {
47         return enabled;
48     }
49
50     /**
51      * Returns the fragments installed for this plug-in.
52      *
53      * @return this plug-in's fragments or <code>null</code>
54      */

55     public PluginFragmentModel[] getFragments() {
56         return fragments;
57     }
58
59     /**
60      * Returns the fully qualified name of the Java class which implements
61      * the runtime support for this plug-in.
62      *
63      * @return the name of this plug-in's runtime class or <code>null</code>.
64      */

65     public String JavaDoc getPluginClass() {
66         return pluginClass;
67     }
68
69     /**
70      * Returns the unique identifier of the plug-in related to this model
71      * or <code>null</code>.
72      * This identifier is a non-empty string and is unique
73      * within the plug-in registry.
74      *
75      * @return the unique identifier of the plug-in related to this model
76      * (e.g. <code>"com.example"</code>) or <code>null</code>.
77      */

78     public String JavaDoc getPluginId() {
79         return getId();
80     }
81
82     /**
83      * Sets the value of the field 'enabled' to the parameter 'value'.
84      * If this plugin is enabled (default) it is assumed to have all
85      * of it's prerequisites.
86      *
87      * @param value set to false if this plugin should be disabled and
88      * true otherwise.
89      */

90     public void setEnabled(boolean value) {
91         enabled = value;
92     }
93
94     /**
95      * Sets the list of fragments for this plug-in.
96      * This object must not be read-only.
97      *
98      * @param value the fragments for this plug-in. May be <code>null</code>.
99      */

100     public void setFragments(PluginFragmentModel[] value) {
101         assertIsWriteable();
102         fragments = value;
103     }
104
105     /**
106      * Sets the fully qualified name of the Java class which implements
107      * the runtime support for this plug-in.
108      * This object must not be read-only.
109      *
110      * @param value the name of this plug-in's runtime class.
111      * May be <code>null</code>.
112      */

113     public void setPluginClass(String JavaDoc value) {
114         assertIsWriteable();
115         pluginClass = value;
116     }
117 }
118
Popular Tags