| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 swarmlib; | 5 part of swarmlib; |
| 6 | 6 |
| 7 // This file contains View framework classes. | 7 // This file contains View framework classes. |
| 8 // As it grows, it may need to be split into multiple files. | 8 // As it grows, it may need to be split into multiple files. |
| 9 | 9 |
| 10 /** A factory that creates a view from a data model. */ | 10 /** A factory that creates a view from a data model. */ |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 163 } |
| 164 | 164 |
| 165 void onSelectedItemChange() { | 165 void onSelectedItemChange() { |
| 166 // TODO(rnystrom): use Observable to track the last value of _selectedItem | 166 // TODO(rnystrom): use Observable to track the last value of _selectedItem |
| 167 // rather than tracking it ourselves. | 167 // rather than tracking it ourselves. |
| 168 _select(findIndex(_lastSelectedItem), false); | 168 _select(findIndex(_lastSelectedItem), false); |
| 169 _select(findIndex(_selectedItem.value), true); | 169 _select(findIndex(_selectedItem.value), true); |
| 170 _lastSelectedItem = _selectedItem.value; | 170 _lastSelectedItem = _selectedItem.value; |
| 171 } | 171 } |
| 172 | 172 |
| 173 Collection<View> get childViews { | 173 Iterable<View> get childViews { |
| 174 return _itemViews.values.toList(); | 174 return _itemViews.values.toList(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void _onClick(MouseEvent e) { | 177 void _onClick(MouseEvent e) { |
| 178 int index = _findAssociatedIndex(e.target); | 178 int index = _findAssociatedIndex(e.target); |
| 179 if (index != null) { | 179 if (index != null) { |
| 180 _selectedItem.value = _data[index]; | 180 _selectedItem.value = _data[index]; |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | 183 |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 | 975 |
| 976 container = node.query('.dialog-body'); | 976 container = node.query('.dialog-body'); |
| 977 container.nodes.add(_content.node); | 977 container.nodes.add(_content.node); |
| 978 | 978 |
| 979 return node; | 979 return node; |
| 980 } | 980 } |
| 981 | 981 |
| 982 /** Override to handle dialog done. */ | 982 /** Override to handle dialog done. */ |
| 983 void onDone() { } | 983 void onDone() { } |
| 984 } | 984 } |
| OLD | NEW |