Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: samples/swarm/Views.dart

Issue 11267018: Make getKeys, getValues getters (keys, values). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // This file contains View framework classes. 5 // This file contains View framework classes.
6 // As it grows, it may need to be split into multiple files. 6 // As it grows, it may need to be split into multiple files.
7 7
8 /** A factory that creates a view from a data model. */ 8 /** A factory that creates a view from a data model. */
9 abstract class ViewFactory<D> { 9 abstract class ViewFactory<D> {
10 View newView(D item); 10 View newView(D item);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 void onSelectedItemChange() { 163 void onSelectedItemChange() {
164 // TODO(rnystrom): use Observable to track the last value of _selectedItem 164 // TODO(rnystrom): use Observable to track the last value of _selectedItem
165 // rather than tracking it ourselves. 165 // rather than tracking it ourselves.
166 _select(findIndex(_lastSelectedItem), false); 166 _select(findIndex(_lastSelectedItem), false);
167 _select(findIndex(_selectedItem.value), true); 167 _select(findIndex(_selectedItem.value), true);
168 _lastSelectedItem = _selectedItem.value; 168 _lastSelectedItem = _selectedItem.value;
169 } 169 }
170 170
171 Collection<View> get childViews { 171 Collection<View> get childViews {
172 return _itemViews.getValues(); 172 return _itemViews.values;
173 } 173 }
174 174
175 void _onClick(MouseEvent e) { 175 void _onClick(MouseEvent e) {
176 int index = _findAssociatedIndex(e.target); 176 int index = _findAssociatedIndex(e.target);
177 if (index != null) { 177 if (index != null) {
178 _selectedItem.value = _data[index]; 178 _selectedItem.value = _data[index];
179 } 179 }
180 } 180 }
181 181
182 int _findAssociatedIndex(Node leafNode) { 182 int _findAssociatedIndex(Node leafNode) {
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 976
977 container = node.query('.dialog-body'); 977 container = node.query('.dialog-body');
978 container.nodes.add(_content.node); 978 container.nodes.add(_content.node);
979 979
980 return node; 980 return node;
981 } 981 }
982 982
983 /** Override to handle dialog done. */ 983 /** Override to handle dialog done. */
984 void onDone() { } 984 void onDone() { }
985 } 985 }
OLDNEW
« no previous file with comments | « samples/markdown/html_renderer.dart ('k') | samples/tests/samples/lib/layout/grid_layout_demo.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698