| 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 implements List { | 9 class _ChildrenElementList implements List { |
| 10 // Raw Element. | 10 // Raw Element. |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 return Lists.lastIndexOf(this, element, start); | 214 return Lists.lastIndexOf(this, element, start); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void insert(int index, Element element) { | 217 void insert(int index, Element element) { |
| 218 if (index < 0 || index > length) { | 218 if (index < 0 || index > length) { |
| 219 throw new RangeError.range(index, 0, length); | 219 throw new RangeError.range(index, 0, length); |
| 220 } | 220 } |
| 221 if (index == length) { | 221 if (index == length) { |
| 222 _element.append(element); | 222 _element.append(element); |
| 223 } else { | 223 } else { |
| 224 throw new UnimplementedError("insert on ElementLists"); | 224 _element.insertBefore(element, this[index]); |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 | 227 |
| 228 void clear() { | 228 void clear() { |
| 229 // It is unclear if we want to keep non element nodes? | 229 // It is unclear if we want to keep non element nodes? |
| 230 _element.text = ''; | 230 _element.text = ''; |
| 231 } | 231 } |
| 232 | 232 |
| 233 Element removeAt(int index) { | 233 Element removeAt(int index) { |
| 234 final result = this[index]; | 234 final result = this[index]; |
| (...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 const ScrollAlignment._internal(this._value); | 1141 const ScrollAlignment._internal(this._value); |
| 1142 toString() => 'ScrollAlignment.$_value'; | 1142 toString() => 'ScrollAlignment.$_value'; |
| 1143 | 1143 |
| 1144 /// Attempt to align the element to the top of the scrollable area. | 1144 /// Attempt to align the element to the top of the scrollable area. |
| 1145 static const TOP = const ScrollAlignment._internal('TOP'); | 1145 static const TOP = const ScrollAlignment._internal('TOP'); |
| 1146 /// Attempt to center the element in the scrollable area. | 1146 /// Attempt to center the element in the scrollable area. |
| 1147 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1147 static const CENTER = const ScrollAlignment._internal('CENTER'); |
| 1148 /// Attempt to align the element to the bottom of the scrollable area. | 1148 /// Attempt to align the element to the bottom of the scrollable area. |
| 1149 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1149 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
| 1150 } | 1150 } |
| OLD | NEW |