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

Unified 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: Merged with r34309. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/site/try/src/compiler_isolate.dart ('k') | dart/site/try/src/editor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/src/decoration.dart
diff --git a/dart/site/try/src/decoration.dart b/dart/site/try/src/decoration.dart
index 87e62b879fa7a1e51a8bfcc964884b7de420c46a..20c05eae0bf07c2b69ec7e69d0a0099a18f5cc73 100644
--- a/dart/site/try/src/decoration.dart
+++ b/dart/site/try/src/decoration.dart
@@ -99,3 +99,33 @@ warning(text) {
..style.opacity = '0.75'
..append(text);
}
+
+class CodeCompletionDecoration extends Decoration {
+ const CodeCompletionDecoration(
+ {String color: '#000000',
+ bool bold: false,
+ bool italic: false,
+ bool stress: false,
+ bool important: false})
+ : super(color: color, bold: bold, italic: italic, stress: stress,
+ important: important);
+
+ static from(Decoration decoration) {
+ return new CodeCompletionDecoration(
+ color: decoration.color,
+ bold: decoration.bold,
+ italic: decoration.italic,
+ stress: decoration.stress,
+ important: decoration.important);
+ }
+
+ Element applyTo(text) {
+ var codeCompletion = new DivElement()
+ ..contentEditable = 'false'
+ ..classes.add('dart-code-completion')
+ ..appendText('Completion goes here');
+ return super.applyTo(text)
+ ..classes.add('dart-code-completion-holder')
+ ..nodes.add(codeCompletion);
+ }
+}
« no previous file with comments | « dart/site/try/src/compiler_isolate.dart ('k') | dart/site/try/src/editor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698