1 11 12 package org.eclipse.pde.internal.core.cheatsheet.comp; 13 14 import java.io.PrintWriter ; 15 import java.util.ArrayList ; 16 import java.util.List ; 17 18 import org.eclipse.pde.internal.core.XMLPrintHandler; 19 import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSDependency; 20 import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSModel; 21 import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSObject; 22 import org.eclipse.pde.internal.core.util.PDETextHelper; 23 import org.w3c.dom.Element ; 24 import org.w3c.dom.Text ; 25 26 30 public class CompCSDependency extends CompCSObject implements ICompCSDependency { 31 32 private String fFieldTask; 33 34 37 private static final long serialVersionUID = 1L; 38 39 43 public CompCSDependency(ICompCSModel model, ICompCSObject parent) { 44 super(model, parent); 45 reset(); 46 } 47 48 51 public List getChildren() { 52 return new ArrayList (); 53 } 54 55 58 public String getElement() { 59 return ELEMENT_DEPENDENCY; 60 } 61 62 65 public String getName() { 66 return fFieldTask; 67 } 68 69 72 public int getType() { 73 return TYPE_DEPENDENCY; 74 } 75 76 79 protected void parseAttributes(Element element) { 80 fFieldTask = element.getAttribute(ATTRIBUTE_TASK).trim(); 83 } 84 85 88 protected void parseElement(Element element) { 89 } 91 92 95 public void reset() { 96 fFieldTask = null; 97 } 98 99 102 protected void writeAttributes(StringBuffer buffer) { 103 if ((fFieldTask != null) && 105 (fFieldTask.length() > 0)) { 106 buffer.append(XMLPrintHandler.wrapAttribute( 109 ATTRIBUTE_TASK, 110 PDETextHelper.translateWriteText( 111 fFieldTask.trim(), DEFAULT_SUBSTITUTE_CHARS))); 112 } 113 } 114 115 118 protected void writeElements(String indent, PrintWriter writer) { 119 } 121 122 125 public String getFieldTask() { 126 return fFieldTask; 127 } 128 129 132 public void setFieldTask(String task) { 133 String old = fFieldTask; 134 fFieldTask = task; 135 if (isEditable()) { 136 firePropertyChanged(ATTRIBUTE_TASK, old, fFieldTask); 137 } 138 } 139 140 143 protected void parseText(Text text) { 144 } 146 147 } 148 | Popular Tags |