KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > model > plugin > PluginExtensionPointNode


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 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.internal.ui.model.plugin;
12
13 import org.eclipse.core.runtime.*;
14 import org.eclipse.pde.core.plugin.*;
15
16 public class PluginExtensionPointNode extends PluginObjectNode
17         implements
18             IPluginExtensionPoint {
19
20     private static final long serialVersionUID = 1L;
21
22     /* (non-Javadoc)
23      * @see org.eclipse.pde.core.plugin.IPluginExtensionPoint#getFullId()
24      */

25     public String JavaDoc getFullId() {
26         String JavaDoc pluginID = getPluginBase().getId();
27         return (pluginID != null) ? pluginID + "." + getId() : getId(); //$NON-NLS-1$
28
}
29     /* (non-Javadoc)
30      * @see org.eclipse.pde.core.plugin.IPluginExtensionPoint#getSchema()
31      */

32     public String JavaDoc getSchema() {
33         return getXMLAttributeValue("schema"); //$NON-NLS-1$
34
}
35     /* (non-Javadoc)
36      * @see org.eclipse.pde.core.plugin.IPluginExtensionPoint#setSchema(java.lang.String)
37      */

38     public void setSchema(String JavaDoc schema) throws CoreException {
39         setXMLAttribute(P_SCHEMA, schema);
40     }
41     /* (non-Javadoc)
42      * @see org.eclipse.pde.core.IIdentifiable#getId()
43      */

44     public String JavaDoc getId() {
45         return getXMLAttributeValue(P_ID);
46     }
47     /* (non-Javadoc)
48      * @see org.eclipse.pde.core.IIdentifiable#setId(java.lang.String)
49      */

50     public void setId(String JavaDoc id) throws CoreException {
51         setXMLAttribute(P_ID, id);
52     }
53     
54     /* (non-Javadoc)
55      * @see org.eclipse.pde.core.plugin.IPluginObject#setName(java.lang.String)
56      */

57     public void setName(String JavaDoc name) throws CoreException {
58         setXMLAttribute(P_NAME, name);
59     }
60     
61     /* (non-Javadoc)
62      * @see org.eclipse.pde.core.plugin.IPluginObject#getName()
63      */

64     public String JavaDoc getName() {
65         return getXMLAttributeValue(P_NAME);
66     }
67     
68     /* (non-Javadoc)
69      * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#write()
70      */

71     public String JavaDoc write(boolean indent) {
72         return indent ? getIndent() + writeShallow(true) : writeShallow(true);
73     }
74     
75     /* (non-Javadoc)
76      * @see org.eclipse.pde.internal.ui.model.plugin.PluginObjectNode#writeShallow(boolean)
77      */

78     public String JavaDoc writeShallow(boolean terminate) {
79         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc("<extension-point"); //$NON-NLS-1$
80
appendAttribute(buffer, P_ID);
81         appendAttribute(buffer, P_NAME);
82         appendAttribute(buffer, P_SCHEMA);
83
84         if (terminate)
85             buffer.append("/"); //$NON-NLS-1$
86
buffer.append(">"); //$NON-NLS-1$
87
return buffer.toString();
88     }
89     
90     
91 }
92
Popular Tags