1 Clazz.declarePackage ("swingjs");
2 Clazz.load (["swingjs.JSAbstractDocument"], "swingjs.JSPlainDocument", ["java.util.Hashtable", "JU.SB", "swingjs.JSPosition"], function () {
3 c$ = Clazz.declareType (swingjs, "JSPlainDocument", swingjs.JSAbstractDocument);
4 Clazz.makeConstructor (c$,
6 Clazz.superConstructor (this, swingjs.JSPlainDocument);
7 this.sb = new JU.SB ();
8 this.root = Clazz.innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null);
10 Clazz.overrideMethod (c$, "getLength",
12 return this.sb.length ();
14 Clazz.defineMethod (c$, "getText",
15 function (offset, length) {
16 this.checkLoc (offset, offset + length);
17 return this.sb.substring2 (offset, offset + length);
19 Clazz.defineMethod (c$, "getText",
20 function (offset, length, chars) {
21 this.checkLoc (offset, offset + length);
22 if (this.tempChar == null) {
23 this.tempChar = Clazz.newCharArray (this.sb.length (), '\0');
24 for (var i = this.tempChar.length; --i >= 0; ) this.tempChar[i] = this.sb.charAt (i);
26 }chars.array = this.tempChar;
27 chars.offset = offset;
29 }, "~N,~N,javax.swing.text.Segment");
30 Clazz.overrideMethod (c$, "getStartPosition",
32 return new swingjs.JSPosition (0);
34 Clazz.overrideMethod (c$, "getEndPosition",
36 return new swingjs.JSPosition (this.sb.length ());
38 Clazz.overrideMethod (c$, "createPosition",
40 this.checkLoc (offs, offs);
41 var i = Integer.$valueOf (offs);
42 if (this.positions == null) this.positions = new java.util.Hashtable ();
43 var p = this.positions.get (i);
44 if (p == null) this.positions.put (i, p = new swingjs.JSPosition (offs));
47 Clazz.overrideMethod (c$, "getDefaultRootElement",
51 Clazz.overrideMethod (c$, "render",
54 Clazz.defineStatics (c$,
55 "tabSizeAttribute", "tabSize",
56 "lineLimitAttribute", "lineLimit");