1 19 20 package org.apache.tools.ant.module.nodes; 21 22 import org.openide.nodes.Node; 23 import org.openide.util.NbBundle; 24 import org.w3c.dom.Element ; 25 26 class AntProperty extends Node.Property<String > { 27 28 private Element el; 29 private String name; 30 31 public AntProperty(Element el, String name) { 32 this(name); 33 this.el = el; 34 } 35 36 protected AntProperty(String name) { 37 super(String .class); 38 setName(name); 39 this.name = name; 40 } 41 42 protected Element getElement() { 43 return el; 44 } 45 46 @Override 47 public String getValue() { 48 Element el = getElement(); 49 if (el == null) { return NbBundle.getMessage(AntProperty.class, "LBL_property_invalid_no_element"); 51 } 52 return el.getAttribute(name); 53 } 54 55 @Override 56 public boolean canRead() { 57 return true; 58 } 59 60 @Override 61 public boolean canWrite() { 62 return false; 63 } 64 65 @Override 66 public void setValue(String val) throws IllegalArgumentException { 67 throw new IllegalArgumentException (); 68 } 69 70 } 71 | Popular Tags |