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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 } | 334 } |
343 | 335 |
344 Element removeLast() { | 336 Element removeLast() { |
345 throw new UnsupportedError(''); | 337 throw new UnsupportedError(''); |
346 } | 338 } |
347 | 339 |
348 void remove(Object element) { | 340 void remove(Object element) { |
349 throw new UnsupportedError(''); | 341 throw new UnsupportedError(''); |
350 } | 342 } |
351 | 343 |
352 void removeAll(Iterable elements) { | |
353 throw new UnsupportedError(''); | |
354 } | |
355 | |
356 void retainAll(Iterable elements) { | |
357 throw new UnsupportedError(''); | |
358 } | |
359 | |
360 void removeWhere(bool test(Element element)) { | 344 void removeWhere(bool test(Element element)) { |
361 throw new UnsupportedError(''); | 345 throw new UnsupportedError(''); |
362 } | 346 } |
363 | 347 |
364 void retainWhere(bool test(Element element)) { | 348 void retainWhere(bool test(Element element)) { |
365 throw new UnsupportedError(''); | 349 throw new UnsupportedError(''); |
366 } | 350 } |
367 | 351 |
368 Element get first => _nodeList.first; | 352 Element get first => _nodeList.first; |
369 | 353 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 * | 491 * |
508 * This set makes it easy to add, remove or toggle the classes applied to | 492 * This set makes it easy to add, remove or toggle the classes applied to |
509 * this element. | 493 * this element. |
510 * | 494 * |
511 * element.classes.add('selected'); | 495 * element.classes.add('selected'); |
512 * element.classes.toggle('isOnline'); | 496 * element.classes.toggle('isOnline'); |
513 * element.classes.remove('selected'); | 497 * element.classes.remove('selected'); |
514 */ | 498 */ |
515 CssClassSet get classes => new _ElementCssClassSet(this); | 499 CssClassSet get classes => new _ElementCssClassSet(this); |
516 | 500 |
517 void set classes(Collection<String> value) { | 501 void set classes(Iterable<String> value) { |
518 CssClassSet classSet = classes; | 502 CssClassSet classSet = classes; |
519 classSet.clear(); | 503 classSet.clear(); |
520 classSet.addAll(value); | 504 classSet.addAll(value); |
521 } | 505 } |
522 | 506 |
523 /** | 507 /** |
524 * Allows access to all custom data attributes (data-*) set on this element. | 508 * Allows access to all custom data attributes (data-*) set on this element. |
525 * | 509 * |
526 * The keys for the map must follow these rules: | 510 * The keys for the map must follow these rules: |
527 * | 511 * |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 const ScrollAlignment._internal(this._value); | 968 const ScrollAlignment._internal(this._value); |
985 toString() => 'ScrollAlignment.$_value'; | 969 toString() => 'ScrollAlignment.$_value'; |
986 | 970 |
987 /// Attempt to align the element to the top of the scrollable area. | 971 /// Attempt to align the element to the top of the scrollable area. |
988 static const TOP = const ScrollAlignment._internal('TOP'); | 972 static const TOP = const ScrollAlignment._internal('TOP'); |
989 /// Attempt to center the element in the scrollable area. | 973 /// Attempt to center the element in the scrollable area. |
990 static const CENTER = const ScrollAlignment._internal('CENTER'); | 974 static const CENTER = const ScrollAlignment._internal('CENTER'); |
991 /// Attempt to align the element to the bottom of the scrollable area. | 975 /// Attempt to align the element to the bottom of the scrollable area. |
992 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 976 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
993 } | 977 } |
OLD | NEW |