1 11 package org.eclipse.pde.internal.ui.model.plugin; 12 13 import org.eclipse.core.runtime.*; 14 import org.eclipse.pde.core.plugin.*; 15 import org.eclipse.pde.internal.ui.model.*; 16 17 public class PluginAttribute extends PluginObjectNode 18 implements 19 IPluginAttribute , IDocumentAttribute{ 20 21 private static final long serialVersionUID = 1L; 22 23 private IDocumentNode fEnclosingElement; 24 private String fValue; 25 private int fNameOffset = -1; 26 private int fNameLength = -1; 27 private int fValueOffset = -1; 28 private int fValueLength = -1; 29 30 33 public String getValue() { 34 return fValue; 35 } 36 39 public void setValue(String value) throws CoreException { 40 fValue = value; 41 } 42 45 public void setEnclosingElement(IDocumentNode node) { 46 fEnclosingElement = node; 47 } 48 51 public IDocumentNode getEnclosingElement() { 52 return fEnclosingElement; 53 } 54 57 public void setNameOffset(int offset) { 58 fNameOffset = offset; 59 } 60 63 public int getNameOffset() { 64 return fNameOffset; 65 } 66 69 public void setNameLength(int length) { 70 fNameLength = length; 71 } 72 75 public int getNameLength() { 76 return fNameLength; 77 } 78 81 public void setValueOffset(int offset) { 82 fValueOffset = offset; 83 } 84 87 public int getValueOffset() { 88 return fValueOffset; 89 } 90 93 public void setValueLength(int length) { 94 fValueLength = length; 95 } 96 99 public int getValueLength() { 100 return fValueLength; 101 } 102 105 public String getAttributeName() { 106 return getName(); 107 } 108 111 public String getAttributeValue() { 112 return getValue(); 113 } 114 115 118 public String write() { 119 return getName() + "=\"" + getWritableString(getValue()) + "\""; } 121 122 public String getWritableString(String source) { 123 return super 124 .getWritableString(source) 125 .replaceAll("\\r", "
") .replaceAll("\\n", "
"); } 128 129 } 130 | Popular Tags |