1 11 package org.eclipse.pde.internal.core.text.plugin; 12 13 import java.io.PrintWriter ; 14 15 import org.eclipse.core.runtime.CoreException; 16 import org.eclipse.pde.core.plugin.IPluginExtensionPoint; 17 import org.eclipse.pde.core.plugin.ISharedPluginModel; 18 import org.eclipse.pde.internal.core.text.IDocumentNode; 19 20 public class PluginExtensionPointNode extends PluginObjectNode implements 21 IPluginExtensionPoint, IDocumentExtensionPoint { 22 23 private static final long serialVersionUID = 1L; 24 25 29 public String getFullId() { 30 String id = getId(); 31 String version = getPluginBase().getSchemaVersion(); 32 if ("3.2".equals(version) && id != null && id.indexOf('.') != -1) return id; 34 String pluginID = getPluginBase().getId(); 35 return (pluginID != null) ? pluginID + "." + id : id; } 37 40 public String getSchema() { 41 return getXMLAttributeValue("schema"); } 43 46 public void setSchema(String schema) throws CoreException { 47 setXMLAttribute(P_SCHEMA, schema); 48 } 49 52 public String getId() { 53 return getXMLAttributeValue(P_ID); 54 } 55 58 public void setId(String id) throws CoreException { 59 setXMLAttribute(P_ID, id); 60 } 61 62 65 public void setName(String name) throws CoreException { 66 setXMLAttribute(P_NAME, name); 67 } 68 69 72 public String getName() { 73 return getXMLAttributeValue(P_NAME); 74 } 75 76 79 public String write(boolean indent) { 80 return indent ? getIndent() + writeShallow(true) : writeShallow(true); 81 } 82 83 86 public String writeShallow(boolean terminate) { 87 StringBuffer buffer = new StringBuffer ("<extension-point"); appendAttribute(buffer, P_ID); 89 appendAttribute(buffer, P_NAME); 90 appendAttribute(buffer, P_SCHEMA); 91 92 if (terminate) 93 buffer.append("/"); buffer.append(">"); return buffer.toString(); 96 } 97 98 101 public void reconnect(ISharedPluginModel model, IDocumentNode parent) { 102 super.reconnect(model, null, parent); 103 } 104 105 108 public void write(String indent, PrintWriter writer) { 109 writer.write(write(true)); 111 } 112 113 116 public void writeDelimeter(PrintWriter writer) { 117 writer.println(getIndent()); 118 } 119 120 } 121 | Popular Tags |