Mercurial > projects > dwt-addons
comparison dwtx/jface/text/link/LinkedPositionAnnotations.d @ 134:51e6e63f930e
Regex fix for casts
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 01:46:20 +0200 |
parents | c4fb132a086c |
children | 6dcb0baaa031 |
comparison
equal
deleted
inserted
replaced
133:7d818bd32d63 | 134:51e6e63f930e |
---|---|
120 // toAdd are the new positions, which don't exist in previous = new - previous | 120 // toAdd are the new positions, which don't exist in previous = new - previous |
121 List toRemove= new ArrayList(fGroupAnnotations.values()); | 121 List toRemove= new ArrayList(fGroupAnnotations.values()); |
122 Map toAdd= new HashMap(); | 122 Map toAdd= new HashMap(); |
123 if (positions !is null) { | 123 if (positions !is null) { |
124 for (Iterator iter= positions.iterator(); iter.hasNext();) { | 124 for (Iterator iter= positions.iterator(); iter.hasNext();) { |
125 Position p= (Position) iter.next(); | 125 Position p= cast(Position) iter.next(); |
126 if (fGroupAnnotations.containsKey(p)) { | 126 if (fGroupAnnotations.containsKey(p)) { |
127 toRemove.remove(fGroupAnnotations.get(p)); | 127 toRemove.remove(fGroupAnnotations.get(p)); |
128 } else { | 128 } else { |
129 Annotation a= new Annotation(SLAVE_ANNOTATION_TYPE, false, ""); //$NON-NLS-1$ | 129 Annotation a= new Annotation(SLAVE_ANNOTATION_TYPE, false, ""); //$NON-NLS-1$ |
130 toAdd.put(a, p); | 130 toAdd.put(a, p); |
154 // toAdd are the new positions, which don't exist in previous = new - previous | 154 // toAdd are the new positions, which don't exist in previous = new - previous |
155 List toRemove= new ArrayList(fTargetAnnotations.values()); | 155 List toRemove= new ArrayList(fTargetAnnotations.values()); |
156 Map toAdd= new HashMap(); | 156 Map toAdd= new HashMap(); |
157 if (positions !is null) { | 157 if (positions !is null) { |
158 for (Iterator iter= positions.iterator(); iter.hasNext();) { | 158 for (Iterator iter= positions.iterator(); iter.hasNext();) { |
159 Position p= (Position) iter.next(); | 159 Position p= cast(Position) iter.next(); |
160 if (fTargetAnnotations.containsKey(p)) { | 160 if (fTargetAnnotations.containsKey(p)) { |
161 toRemove.remove(fTargetAnnotations.get(p)); | 161 toRemove.remove(fTargetAnnotations.get(p)); |
162 } else { | 162 } else { |
163 Annotation a= new Annotation(TARGET_ANNOTATION_TYPE, false, ""); //$NON-NLS-1$ | 163 Annotation a= new Annotation(TARGET_ANNOTATION_TYPE, false, ""); //$NON-NLS-1$ |
164 toAdd.put(a, p); | 164 toAdd.put(a, p); |
240 * | 240 * |
241 * @param list the list of positions to prune | 241 * @param list the list of positions to prune |
242 */ | 242 */ |
243 private void prune(List list) { | 243 private void prune(List list) { |
244 for (Iterator iter= list.iterator(); iter.hasNext();) { | 244 for (Iterator iter= list.iterator(); iter.hasNext();) { |
245 LinkedPosition pos= (LinkedPosition) iter.next(); | 245 LinkedPosition pos= cast(LinkedPosition) iter.next(); |
246 if (!pos.getDocument().equals(fDocument)) | 246 if (!pos.getDocument().equals(fDocument)) |
247 iter.remove(); | 247 iter.remove(); |
248 } | 248 } |
249 } | 249 } |
250 | 250 |