1 19 package org.netbeans.tax; 20 21 26 public abstract class TreeEntityReference extends TreeParentNode implements TreeReference { 27 28 public static final String PROP_NAME = "name"; 30 31 32 private String name; 33 34 35 private TreeEntityDecl entityDecl; 36 37 38 42 45 protected TreeEntityReference (String name) throws InvalidArgumentException { 46 super (); 47 48 checkName (name); 49 this.name = name; 50 } 51 52 53 protected TreeEntityReference (TreeEntityReference entityReference, boolean deep) { 54 super (entityReference, deep); 55 56 this.name = entityReference.name; 57 } 59 60 61 65 67 public boolean equals (Object object, boolean deep) { 68 if (!!! super.equals (object, deep)) 69 return false; 70 71 TreeEntityReference peer = (TreeEntityReference) object; 72 if (!!! Util.equals (this.getName (), peer.getName ())) 73 return false; 74 75 return true; 76 } 77 78 81 public void merge (TreeObject treeObject) throws CannotMergeException { 82 super.merge (treeObject); 83 84 TreeEntityReference peer = (TreeEntityReference) treeObject; 85 setNameImpl (peer.getName ()); 86 } 87 88 89 93 95 public String getName () { 96 return name; 97 } 98 99 101 private final void setNameImpl (String newName) { 102 String oldName = this.name; 103 104 this.name = newName; 105 106 firePropertyChange (PROP_NAME, oldName, newName); 107 } 108 109 113 public final void setName (String newName) throws ReadOnlyException, InvalidArgumentException { 114 if ( Util.equals (this.name, newName) ) 118 return; 119 checkReadOnly (); 120 checkName (newName); 121 122 setNameImpl (newName); 126 } 127 128 129 131 protected abstract void checkName (String name) throws InvalidArgumentException; 132 133 134 136 public TreeEntityDecl getEntityDecl () { 137 return entityDecl; 138 } 139 140 141 145 148 protected abstract class ChildListContentManager extends TreeParentNode.ChildListContentManager { 149 150 } 152 } 153 | Popular Tags |