1 11 package org.eclipse.pde.internal.core.product; 12 13 import java.io.PrintWriter ; 14 15 import org.eclipse.pde.core.plugin.IFragmentModel; 16 import org.eclipse.pde.core.plugin.PluginRegistry; 17 import org.eclipse.pde.internal.core.iproduct.IProductModel; 18 import org.eclipse.pde.internal.core.iproduct.IProductPlugin; 19 import org.w3c.dom.Element ; 20 import org.w3c.dom.Node ; 21 22 23 public class ProductPlugin extends ProductObject implements IProductPlugin { 24 25 private static final long serialVersionUID = 1L; 26 private String fId; 27 28 public ProductPlugin(IProductModel model) { 29 super(model); 30 } 31 32 35 public String getId() { 36 return fId.trim(); 37 } 38 39 42 public void setId(String id) { 43 fId = id; 44 } 45 46 49 public void parse(Node node) { 50 if (node.getNodeType() == Node.ELEMENT_NODE) 51 fId = ((Element )node).getAttribute("id"); } 53 54 57 public void write(String indent, PrintWriter writer) { 58 writer.print(indent + "<plugin id=\"" + fId + "\""); if (PluginRegistry.findModel(fId) instanceof IFragmentModel) 60 writer.print(" fragment=\"true\""); writer.println("/>"); } 63 64 } 65 | Popular Tags |