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

Side by Side Diff: dart/site/try/src/decoration.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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library trydart.decoration; 5 library trydart.decoration;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 8
9 class Decoration { 9 class Decoration {
10 final String color; 10 final String color;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 warning(text) { 93 warning(text) {
94 if (text is String) { 94 if (text is String) {
95 text = new Text(text); 95 text = new Text(text);
96 } 96 }
97 return new SpanElement() 97 return new SpanElement()
98 ..classes.add('alert') 98 ..classes.add('alert')
99 ..style.opacity = '0.75' 99 ..style.opacity = '0.75'
100 ..append(text); 100 ..append(text);
101 } 101 }
102
103 class CodeCompletionDecoration extends Decoration {
104 const CodeCompletionDecoration(
105 {String color: '#000000',
106 bool bold: false,
107 bool italic: false,
108 bool stress: false,
109 bool important: false})
110 : super(color: color, bold: bold, italic: italic, stress: stress,
111 important: important);
112
113 static from(Decoration decoration) {
114 return new CodeCompletionDecoration(
115 color: decoration.color,
116 bold: decoration.bold,
117 italic: decoration.italic,
118 stress: decoration.stress,
119 important: decoration.important);
120 }
121
122 Element applyTo(text) {
123 var codeCompletion = new DivElement()
124 ..contentEditable = 'false'
125 ..classes.add('dart-code-completion')
126 ..appendText('Completion goes here');
127 return super.applyTo(text)
128 ..classes.add('dart-code-completion-holder')
129 ..nodes.add(codeCompletion);
130 }
131 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698