1 11 package org.eclipse.pde.internal.core.product; 12 13 import java.io.PrintWriter ; 14 15 import org.eclipse.pde.internal.core.iproduct.IIntroInfo; 16 import org.eclipse.pde.internal.core.iproduct.IProductModel; 17 import org.w3c.dom.Element ; 18 import org.w3c.dom.Node ; 19 20 public class IntroInfo extends ProductObject implements IIntroInfo { 21 22 public static final String P_INTRO_ID = "introId"; private static final long serialVersionUID = 1L; 24 private String fIntroId; 25 26 public IntroInfo(IProductModel model) { 27 super(model); 28 } 29 30 public void setId(String id) { 31 String old = fIntroId; 32 fIntroId = id; 33 if (isEditable()) 34 firePropertyChanged(P_INTRO_ID, old, fIntroId); 35 } 36 37 public String getId() { 38 return fIntroId; 39 } 40 41 public void parse(Node node) { 42 if (node.getNodeType() == Node.ELEMENT_NODE) { 43 Element element = (Element )node; 44 fIntroId = element.getAttribute(P_INTRO_ID); 45 } 46 } 47 48 public void write(String indent, PrintWriter writer) { 49 if (fIntroId != null && fIntroId.length() > 0) 50 writer.println(indent + "<intro " + P_INTRO_ID + "=\"" + getWritableString(fIntroId) + "\"/>"); } 52 53 } 54 | Popular Tags |