1 11 package org.eclipse.core.runtime.model; 12 13 23 public class ConfigurationElementModel extends PluginModelObject { 24 25 private String value = null; 27 private ConfigurationPropertyModel[] properties = null; 28 private ConfigurationElementModel[] children = null; 29 30 private Object parent = null; 33 36 public ConfigurationElementModel() { 37 super(); 38 } 39 40 48 public Object getParent() { 49 return parent; 50 } 51 52 60 public ExtensionModel getParentExtension() { 61 Object p = getParent(); 62 while (p != null && p instanceof ConfigurationElementModel) 63 p = ((ConfigurationElementModel) p).getParent(); 64 return (ExtensionModel) p; 65 } 66 67 72 public ConfigurationPropertyModel[] getProperties() { 73 return properties; 74 } 75 76 81 public ConfigurationElementModel[] getSubElements() { 82 return children; 83 } 84 85 90 public String getValue() { 91 return value; 92 } 93 94 100 public String getValueAsIs() { 101 return value; 102 } 103 104 110 public void markReadOnly() { 111 super.markReadOnly(); 112 if (children != null) 113 for (int i = 0; i < children.length; i++) 114 children[i].markReadOnly(); 115 if (properties != null) 116 for (int i = 0; i < properties.length; i++) 117 properties[i].markReadOnly(); 118 } 119 120 126 public void setLocalizedValue(String value) { 127 this.value = value; 128 } 129 130 138 public void setParent(Object value) { 139 assertIsWriteable(); 140 parent = value; 141 } 142 143 150 public void setProperties(ConfigurationPropertyModel[] value) { 151 assertIsWriteable(); 152 properties = value; 153 } 154 155 163 public void setSubElements(ConfigurationElementModel[] value) { 164 assertIsWriteable(); 165 children = value; 166 } 167 168 174 public void setValue(String value) { 175 assertIsWriteable(); 176 this.value = value; 177 } 178 } 179 | Popular Tags |