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

Side by Side Diff: dart/site/try/src/user_option.dart

Issue 197923002: Mock up code completion. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Too many changes to summarize in one line. Created 6 years, 9 months 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
« dart/site/try/src/ui.dart ('K') | « dart/site/try/src/ui.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
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.
4
5 library trydart.userOption;
6
7 class UserOption {
8 final String name;
9
10 final bool isHidden;
11
12 static var storage;
13
14 const UserOption(this.name, {this.isHidden: false});
15
16 get value => storage[name];
17
18 void set value(newValue) {
19 storage[name] = newValue;
20 }
21 }
22
23 class BooleanUserOption extends UserOption {
24 const BooleanUserOption(String name, {bool isHidden: false})
25 : super(name, isHidden: isHidden);
26
27 bool get value => super.value == 'true';
28
29 void set value(bool newValue) {
30 super.value = '$newValue';
31 }
32 }
33
34 class StringUserOption extends UserOption {
35 const StringUserOption(String name, {bool isHidden: false})
36 : super(name, isHidden: isHidden);
37
38 String get value => super.value == null ? '' : super.value;
39
40 void set value(String newValue) {
41 super.value = newValue;
42 }
43 }
OLDNEW
« dart/site/try/src/ui.dart ('K') | « dart/site/try/src/ui.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698