OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
6 | 6 |
7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated | 7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated |
8 // functionality. | 8 // functionality. |
9 class _ChildrenElementList extends ListBase<Element> { | 9 class _ChildrenElementList extends ListBase<Element> { |
10 // Raw Element. | 10 // Raw Element. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 void remove(Object object) { | 174 void remove(Object object) { |
175 if (object is Element) { | 175 if (object is Element) { |
176 Element element = object; | 176 Element element = object; |
177 if (identical(element.parentNode, _element)) { | 177 if (identical(element.parentNode, _element)) { |
178 _element.$dom_removeChild(element); | 178 _element.$dom_removeChild(element); |
179 } | 179 } |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 void removeAll(Iterable elements) { | |
184 _childElements.removeAll(elements); | |
185 } | |
186 | |
187 void retainAll(Iterable elements) { | |
188 _childElements.retainAll(elements); | |
189 } | |
190 | |
191 void removeWhere(bool test(Element element)) { | 183 void removeWhere(bool test(Element element)) { |
192 _childElements.removeWhere(test); | 184 _childElements.removeWhere(test); |
193 } | 185 } |
194 | 186 |
195 void retainWhere(bool test(Element element)) { | 187 void retainWhere(bool test(Element element)) { |
196 _childElements.retainWhere(test); | 188 _childElements.retainWhere(test); |
197 } | 189 } |
198 | 190 |
199 void removeRange(int start, int rangeLength) { | 191 void removeRange(int start, int rangeLength) { |
200 throw new UnimplementedError(); | 192 throw new UnimplementedError(); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 } | 335 } |
344 | 336 |
345 Element removeLast() { | 337 Element removeLast() { |
346 throw new UnsupportedError(''); | 338 throw new UnsupportedError(''); |
347 } | 339 } |
348 | 340 |
349 void remove(Object element) { | 341 void remove(Object element) { |
350 throw new UnsupportedError(''); | 342 throw new UnsupportedError(''); |
351 } | 343 } |
352 | 344 |
353 void removeAll(Iterable elements) { | |
354 throw new UnsupportedError(''); | |
355 } | |
356 | |
357 void retainAll(Iterable elements) { | |
358 throw new UnsupportedError(''); | |
359 } | |
360 | |
361 void removeWhere(bool test(Element element)) { | 345 void removeWhere(bool test(Element element)) { |
362 throw new UnsupportedError(''); | 346 throw new UnsupportedError(''); |
363 } | 347 } |
364 | 348 |
365 void retainWhere(bool test(Element element)) { | 349 void retainWhere(bool test(Element element)) { |
366 throw new UnsupportedError(''); | 350 throw new UnsupportedError(''); |
367 } | 351 } |
368 | 352 |
369 Element get first => _nodeList.first; | 353 Element get first => _nodeList.first; |
370 | 354 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 * | 492 * |
509 * This set makes it easy to add, remove or toggle the classes applied to | 493 * This set makes it easy to add, remove or toggle the classes applied to |
510 * this element. | 494 * this element. |
511 * | 495 * |
512 * element.classes.add('selected'); | 496 * element.classes.add('selected'); |
513 * element.classes.toggle('isOnline'); | 497 * element.classes.toggle('isOnline'); |
514 * element.classes.remove('selected'); | 498 * element.classes.remove('selected'); |
515 */ | 499 */ |
516 CssClassSet get classes => new _ElementCssClassSet(this); | 500 CssClassSet get classes => new _ElementCssClassSet(this); |
517 | 501 |
518 void set classes(Collection<String> value) { | 502 void set classes(Iterable<String> value) { |
519 CssClassSet classSet = classes; | 503 CssClassSet classSet = classes; |
520 classSet.clear(); | 504 classSet.clear(); |
521 classSet.addAll(value); | 505 classSet.addAll(value); |
522 } | 506 } |
523 | 507 |
524 /** | 508 /** |
525 * Allows access to all custom data attributes (data-*) set on this element. | 509 * Allows access to all custom data attributes (data-*) set on this element. |
526 * | 510 * |
527 * The keys for the map must follow these rules: | 511 * The keys for the map must follow these rules: |
528 * | 512 * |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 const ScrollAlignment._internal(this._value); | 969 const ScrollAlignment._internal(this._value); |
986 toString() => 'ScrollAlignment.$_value'; | 970 toString() => 'ScrollAlignment.$_value'; |
987 | 971 |
988 /// Attempt to align the element to the top of the scrollable area. | 972 /// Attempt to align the element to the top of the scrollable area. |
989 static const TOP = const ScrollAlignment._internal('TOP'); | 973 static const TOP = const ScrollAlignment._internal('TOP'); |
990 /// Attempt to center the element in the scrollable area. | 974 /// Attempt to center the element in the scrollable area. |
991 static const CENTER = const ScrollAlignment._internal('CENTER'); | 975 static const CENTER = const ScrollAlignment._internal('CENTER'); |
992 /// Attempt to align the element to the bottom of the scrollable area. | 976 /// Attempt to align the element to the bottom of the scrollable area. |
993 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 977 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
994 } | 978 } |
OLD | NEW |