1 11 package org.eclipse.pde.internal.core.product; 12 13 import java.io.PrintWriter ; 14 15 import org.eclipse.pde.internal.core.iproduct.IConfigurationFileInfo; 16 import org.eclipse.pde.internal.core.iproduct.IProductModel; 17 import org.w3c.dom.Element ; 18 import org.w3c.dom.Node ; 19 20 21 public class ConfigurationFileInfo extends ProductObject implements 22 IConfigurationFileInfo { 23 24 private static final long serialVersionUID = 1L; 25 26 private String fUse; 27 28 private String fPath; 29 30 public ConfigurationFileInfo(IProductModel model) { 31 super(model); 32 } 33 34 37 public void setPath(String path) { 38 String old = fPath; 39 fPath = path; 40 if (isEditable()) 41 firePropertyChanged(P_PATH, old, fPath); 42 } 43 44 47 public String getPath() { 48 return fPath; 49 } 50 51 54 public void parse(Node node) { 55 if (node.getNodeType() == Node.ELEMENT_NODE) { 56 Element element = (Element )node; 57 fPath = element.getAttribute(P_PATH); 58 fUse = element.getAttribute(P_USE); 59 } 60 } 61 62 65 public void write(String indent, PrintWriter writer) { 66 writer.print(indent + "<configIni"); if (fUse != null) 68 writer.print(" " + P_USE + "=\"" + fUse + "\""); if (fPath != null && fPath.trim().length() > 0) 70 writer.print(" " + P_PATH + "=\"" + getWritableString(fPath.trim()) + "\""); writer.println("/>"); } 73 74 75 78 public void setUse(String use) { 79 String old = fUse; 80 fUse = use; 81 if (isEditable()) 82 firePropertyChanged(P_USE, old, fUse); 83 } 84 85 86 89 public String getUse() { 90 return fUse; 91 } 92 93 } 94 | Popular Tags |