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 class TextWrappingImplementation extends CharacterDataWrappingImplementation imp
lements Text { | 5 class TextWrappingImplementation extends CharacterDataWrappingImplementation imp
lements Text { |
| 6 /** @domName Document.createTextNode */ |
6 factory TextWrappingImplementation(String content) { | 7 factory TextWrappingImplementation(String content) { |
7 return new TextWrappingImplementation._wrap( | 8 return new TextWrappingImplementation._wrap( |
8 dom.document.createTextNode(content)); | 9 dom.document.createTextNode(content)); |
9 } | 10 } |
10 | 11 |
11 TextWrappingImplementation._wrap(ptr) : super._wrap(ptr); | 12 TextWrappingImplementation._wrap(ptr) : super._wrap(ptr); |
12 | 13 |
13 String get wholeText() => _ptr.wholeText; | 14 String get wholeText() => _ptr.wholeText; |
14 | 15 |
15 Text replaceWholeText([String content = null]) { | 16 Text replaceWholeText([String content = null]) { |
16 if (content === null) { | 17 if (content === null) { |
17 return LevelDom.wrapText(_ptr.replaceWholeText()); | 18 return LevelDom.wrapText(_ptr.replaceWholeText()); |
18 } else { | 19 } else { |
19 return LevelDom.wrapText(_ptr.replaceWholeText(content)); | 20 return LevelDom.wrapText(_ptr.replaceWholeText(content)); |
20 } | 21 } |
21 } | 22 } |
22 | 23 |
23 Text splitText([int offset = null]) { | 24 Text splitText([int offset = null]) { |
24 if (offset === null) { | 25 if (offset === null) { |
25 return LevelDom.wrapText(_ptr.splitText()); | 26 return LevelDom.wrapText(_ptr.splitText()); |
26 } else { | 27 } else { |
27 return LevelDom.wrapText(_ptr.splitText(offset)); | 28 return LevelDom.wrapText(_ptr.splitText(offset)); |
28 } | 29 } |
29 } | 30 } |
30 } | 31 } |
OLD | NEW |