1 19 package org.netbeans.tax; 20 21 import java.util.List ; 22 import java.util.LinkedList ; 23 24 import org.netbeans.tax.event.TreeEventManager; 25 26 31 public abstract class TreeNodeDecl extends TreeChild { 32 33 36 37 39 43 46 protected TreeNodeDecl () { 47 super (); 48 49 } 51 52 53 54 protected TreeNodeDecl (TreeNodeDecl nodeDecl) { 55 super (nodeDecl); 56 } 57 58 59 63 65 public final TreeDTDRoot getOwnerDTD () { 66 TreeDocumentRoot doc = getOwnerDocument (); 67 68 if (doc instanceof TreeDTDRoot) 69 return (TreeDTDRoot)doc; 70 71 if (doc instanceof TreeDocument) 72 return ((TreeDocument)doc).getDocumentType (); 73 74 return null; 75 } 76 77 78 79 83 86 protected static class TokenList { 87 88 private List tokenList; 89 90 91 93 94 public TokenList () { 95 tokenList = new LinkedList (); 96 } 98 99 100 public void add (Object token) { 101 tokenList.add (token); 102 } 103 104 110 111 public void remove (Object token) { 112 tokenList.remove (token); 113 } 114 115 public int size () { 116 return tokenList.size (); 117 } 118 119 } 120 121 122 126 129 public abstract static class Content extends TreeObject { 130 131 132 private TreeNodeDecl nodeDecl; 133 134 138 139 protected Content (TreeNodeDecl nodeDecl) { 140 super (); 141 142 this.nodeDecl = nodeDecl; 143 } 144 145 148 protected Content () { 149 this ((TreeNodeDecl)null); 150 } 151 152 153 protected Content (Content content) { 154 super (content); 155 156 this.nodeDecl = content.nodeDecl; 157 } 158 159 160 164 166 public final boolean isInContext () { 167 return ( getNodeDecl () != null ); 168 } 169 170 171 175 177 public final TreeNodeDecl getNodeDecl () { 178 return nodeDecl; 179 } 180 181 183 protected void setNodeDecl (TreeNodeDecl nodeDecl) { 184 this.nodeDecl = nodeDecl; 185 } 186 187 191 194 public final TreeEventManager getEventManager () { 195 return nodeDecl.getEventManager (); 196 } 197 198 } 200 } | Popular Tags |