1 Clazz.declarePackage ("javax.swing.text");
2 Clazz.load (["javax.swing.event.DocumentEvent", "javax.swing.text.DocumentFilter", "$.Element", "$.JSMinimalAbstractDocument", "$.MutableAttributeSet", "javax.swing.tree.TreeNode", "javax.swing.undo.AbstractUndoableEdit", "$.CompoundEdit", "javax.swing.event.EventListenerList"], "javax.swing.text.AbstractDocument", ["java.lang.Boolean", "java.util.Hashtable", "$.Vector", "javax.swing.UIManager", "javax.swing.event.DocumentEvent.ElementChange", "javax.swing.event.DocumentListener", "$.UndoableEditEvent", "$.UndoableEditListener", "javax.swing.text.BadLocationException", "$.SegmentCache", "$.StateInvariantError", "$.StyleConstants", "$.StyleContext", "$.Utilities"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.documentProperties = null;
5 this.listenerList = null;
9 this.documentFilter = null;
10 this.filterBypass = null;
11 if (!Clazz.isClassDefined ("javax.swing.text.AbstractDocument.AbstractElement")) {
12 javax.swing.text.AbstractDocument.$AbstractDocument$AbstractElement$ ();
14 if (!Clazz.isClassDefined ("javax.swing.text.AbstractDocument.BranchElement")) {
15 javax.swing.text.AbstractDocument.$AbstractDocument$BranchElement$ ();
17 if (!Clazz.isClassDefined ("javax.swing.text.AbstractDocument.LeafElement")) {
18 javax.swing.text.AbstractDocument.$AbstractDocument$LeafElement$ ();
20 if (!Clazz.isClassDefined ("javax.swing.text.AbstractDocument.DefaultDocumentEvent")) {
21 javax.swing.text.AbstractDocument.$AbstractDocument$DefaultDocumentEvent$ ();
23 if (!Clazz.isClassDefined ("javax.swing.text.AbstractDocument.UndoRedoDocumentEvent")) {
24 javax.swing.text.AbstractDocument.$AbstractDocument$UndoRedoDocumentEvent$ ();
26 if (!Clazz.isClassDefined ("javax.swing.text.AbstractDocument.DefaultFilterBypass")) {
27 javax.swing.text.AbstractDocument.$AbstractDocument$DefaultFilterBypass$ ();
29 Clazz.instantialize (this, arguments);
30 }, javax.swing.text, "AbstractDocument", null, javax.swing.text.JSMinimalAbstractDocument);
31 Clazz.prepareFields (c$, function () {
32 this.listenerList = new javax.swing.event.EventListenerList ();
34 Clazz.makeConstructor (c$,
36 this.construct (data, javax.swing.text.StyleContext.getDefaultStyleContext ());
37 }, "javax.swing.text.AbstractDocument.Content");
38 Clazz.makeConstructor (c$,
39 function (data, context) {
41 this.context = context;
42 }, "javax.swing.text.AbstractDocument.Content,javax.swing.text.AbstractDocument.AttributeContext");
43 Clazz.defineMethod (c$, "getDocumentProperties",
45 if (this.documentProperties == null) {
46 this.documentProperties = new java.util.Hashtable (2);
47 }return this.documentProperties;
49 Clazz.defineMethod (c$, "setDocumentProperties",
51 this.documentProperties = x;
52 }, "java.util.Dictionary");
53 Clazz.defineMethod (c$, "fireInsertUpdate",
56 var listeners = this.listenerList.getListenerList ();
57 for (var i = listeners.length - 2; i >= 0; i -= 2) {
58 if (listeners[i] === javax.swing.event.DocumentListener) {
59 (listeners[i + 1]).insertUpdate (e);
63 }, "javax.swing.event.DocumentEvent");
64 Clazz.defineMethod (c$, "fireChangedUpdate",
67 var listeners = this.listenerList.getListenerList ();
68 for (var i = listeners.length - 2; i >= 0; i -= 2) {
69 if (listeners[i] === javax.swing.event.DocumentListener) {
70 (listeners[i + 1]).changedUpdate (e);
74 }, "javax.swing.event.DocumentEvent");
75 Clazz.defineMethod (c$, "fireRemoveUpdate",
78 var listeners = this.listenerList.getListenerList ();
79 for (var i = listeners.length - 2; i >= 0; i -= 2) {
80 if (listeners[i] === javax.swing.event.DocumentListener) {
81 (listeners[i + 1]).removeUpdate (e);
85 }, "javax.swing.event.DocumentEvent");
86 Clazz.defineMethod (c$, "fireUndoableEditUpdate",
88 var listeners = this.listenerList.getListenerList ();
89 for (var i = listeners.length - 2; i >= 0; i -= 2) {
90 if (listeners[i] === javax.swing.event.UndoableEditListener) {
91 (listeners[i + 1]).undoableEditHappened (e);
93 }, "javax.swing.event.UndoableEditEvent");
94 Clazz.defineMethod (c$, "getListeners",
95 function (listenerType) {
96 return this.listenerList.getListeners (listenerType);
98 Clazz.overrideMethod (c$, "getAsynchronousLoadPriority",
100 var loadPriority = this.getProperty ("load priority");
101 if (loadPriority != null) {
102 return loadPriority.intValue ();
105 Clazz.defineMethod (c$, "setAsynchronousLoadPriority",
107 var loadPriority = (p >= 0) ? new Integer (p) : null;
108 this.putProperty ("load priority", loadPriority);
110 Clazz.overrideMethod (c$, "setDocumentFilter",
112 this.documentFilter = filter;
113 }, "javax.swing.text.DocumentFilter");
114 Clazz.defineMethod (c$, "getDocumentFilter",
116 return this.documentFilter;
118 Clazz.overrideMethod (c$, "getLength",
120 return this.data.length () - 1;
122 Clazz.overrideMethod (c$, "addDocumentListener",
123 function (listener) {
124 this.listenerList.add (javax.swing.event.DocumentListener, listener);
125 }, "javax.swing.event.DocumentListener");
126 Clazz.overrideMethod (c$, "removeDocumentListener",
127 function (listener) {
128 this.listenerList.remove (javax.swing.event.DocumentListener, listener);
129 }, "javax.swing.event.DocumentListener");
130 Clazz.defineMethod (c$, "getDocumentListeners",
132 return this.listenerList.getListeners (javax.swing.event.DocumentListener);
134 Clazz.overrideMethod (c$, "addUndoableEditListener",
135 function (listener) {
136 this.listenerList.add (javax.swing.event.UndoableEditListener, listener);
137 }, "javax.swing.event.UndoableEditListener");
138 Clazz.overrideMethod (c$, "removeUndoableEditListener",
139 function (listener) {
140 this.listenerList.remove (javax.swing.event.UndoableEditListener, listener);
141 }, "javax.swing.event.UndoableEditListener");
142 Clazz.defineMethod (c$, "getUndoableEditListeners",
144 return this.listenerList.getListeners (javax.swing.event.UndoableEditListener);
146 Clazz.overrideMethod (c$, "getProperty",
148 return this.getDocumentProperties ().get (key);
150 Clazz.overrideMethod (c$, "putProperty",
151 function (key, value) {
153 this.getDocumentProperties ().put (key, value);
155 this.getDocumentProperties ().remove (key);
157 Clazz.overrideMethod (c$, "remove",
158 function (offs, len) {
159 var filter = this.getDocumentFilter ();
162 if (filter != null) {
163 filter.remove (this.getFilterBypass (), offs, len);
165 this.handleRemove (offs, len);
170 Clazz.defineMethod (c$, "handleRemove",
171 function (offs, len) {
173 if (offs < 0 || (offs + len) > this.getLength ()) {
174 throw new javax.swing.text.BadLocationException ("Invalid remove", this.getLength () + 1);
175 }var chng = Clazz.innerTypeInstance (javax.swing.text.AbstractDocument.DefaultDocumentEvent, this, null, offs, len, javax.swing.event.DocumentEvent.EventType.REMOVE);
176 var isComposedTextElement = false;
177 isComposedTextElement = javax.swing.text.Utilities.isComposedTextElement (this, offs);
178 this.removeUpdate (chng);
179 var u = this.data.remove (offs, len);
182 }this.postRemoveUpdate (chng);
184 this.fireRemoveUpdate (chng);
185 if ((u != null) && !isComposedTextElement) {
186 this.fireUndoableEditUpdate ( new javax.swing.event.UndoableEditEvent (this, chng));
188 Clazz.overrideMethod (c$, "replace",
189 function (offset, length, text, attrs) {
190 if (length == 0 && (text == null || text.length == 0)) {
192 }var filter = this.getDocumentFilter ();
195 if (filter != null) {
196 filter.replace (this.getFilterBypass (), offset, length, text, attrs);
199 this.remove (offset, length);
200 }if (text != null && text.length > 0) {
201 this.insertString (offset, text, attrs);
205 }, "~N,~N,~S,javax.swing.text.AttributeSet");
206 Clazz.overrideMethod (c$, "insertString",
207 function (offs, str, a) {
208 if ((str == null) || (str.length == 0)) {
210 }var filter = this.getDocumentFilter ();
213 if (filter != null) {
214 filter.insertString (this.getFilterBypass (), offs, str, a);
216 this.handleInsertString (offs, str, a);
220 }, "~N,~S,javax.swing.text.AttributeSet");
221 Clazz.defineMethod (c$, "handleInsertString",
222 function (offs, str, a) {
223 if ((str == null) || (str.length == 0)) {
225 }var u = this.data.insertString (offs, str);
226 var e = Clazz.innerTypeInstance (javax.swing.text.AbstractDocument.DefaultDocumentEvent, this, null, offs, str.length, javax.swing.event.DocumentEvent.EventType.INSERT);
229 }if (this.getProperty ("i18n").equals (Boolean.FALSE)) {
230 }this.insertUpdate (e, a);
232 this.fireInsertUpdate (e);
233 if (u != null && (a == null || !a.isDefined (javax.swing.text.StyleConstants.ComposedTextAttribute))) {
234 this.fireUndoableEditUpdate ( new javax.swing.event.UndoableEditEvent (this, e));
235 }}, "~N,~S,javax.swing.text.AttributeSet");
236 Clazz.defineMethod (c$, "getText",
237 function (offset, length) {
239 throw new javax.swing.text.BadLocationException ("Length must be positive", length);
240 }var str = this.data.getString (offset, length);
243 Clazz.defineMethod (c$, "getText",
244 function (offset, length, txt) {
246 throw new javax.swing.text.BadLocationException ("Length must be positive", length);
247 }this.data.getChars (offset, length, txt);
248 }, "~N,~N,javax.swing.text.Segment");
249 Clazz.overrideMethod (c$, "createPosition",
251 return this.data.createPosition (offs);
253 Clazz.overrideMethod (c$, "getStartPosition",
257 p = this.createPosition (0);
259 if (Clazz.exceptionOf (bl, javax.swing.text.BadLocationException)) {
267 Clazz.overrideMethod (c$, "getEndPosition",
271 p = this.createPosition (this.data.length ());
273 if (Clazz.exceptionOf (bl, javax.swing.text.BadLocationException)) {
281 Clazz.overrideMethod (c$, "getRootElements",
283 var elems = new Array (2);
284 elems[0] = this.getDefaultRootElement ();
285 elems[1] = this.getBidiRootElement ();
288 Clazz.defineMethod (c$, "getFilterBypass",
290 if (this.filterBypass == null) {
291 this.filterBypass = Clazz.innerTypeInstance (javax.swing.text.AbstractDocument.DefaultFilterBypass, this, null);
292 }return this.filterBypass;
294 Clazz.defineMethod (c$, "getBidiRootElement",
296 return this.bidiRoot;
298 Clazz.defineMethod (c$, "isLeftToRight",
300 if (!this.getProperty ("i18n").equals (Boolean.TRUE)) {
302 }var bidiRoot = this.getBidiRootElement ();
303 var index = bidiRoot.getElementIndex (p0);
304 var bidiElem = bidiRoot.getElement (index);
305 if (bidiElem.getEndOffset () >= p1) {
306 var bidiAttrs = bidiElem.getAttributes ();
307 return ((javax.swing.text.StyleConstants.getBidiLevel (bidiAttrs) % 2) == 0);
310 Clazz.defineMethod (c$, "getAttributeContext",
314 Clazz.defineMethod (c$, "insertUpdate",
315 function (chng, attr) {
316 if (chng.type === javax.swing.event.DocumentEvent.EventType.INSERT && chng.getLength () > 0 && !Boolean.TRUE.equals (this.getProperty (javax.swing.text.AbstractDocument.MultiByteProperty))) {
317 var segment = javax.swing.text.SegmentCache.getSharedSegment ();
319 this.getText (chng.getOffset (), chng.getLength (), segment);
322 if ((segment.current ()).charCodeAt (0) > 255) {
323 this.putProperty (javax.swing.text.AbstractDocument.MultiByteProperty, Boolean.TRUE);
325 }} while (segment.next () != '\uffff');
327 if (Clazz.exceptionOf (ble, javax.swing.text.BadLocationException)) {
332 javax.swing.text.SegmentCache.releaseSharedSegment (segment);
333 }}, "javax.swing.text.AbstractDocument.DefaultDocumentEvent,javax.swing.text.AttributeSet");
334 Clazz.defineMethod (c$, "removeUpdate",
336 }, "javax.swing.text.AbstractDocument.DefaultDocumentEvent");
337 Clazz.defineMethod (c$, "postRemoveUpdate",
339 }, "javax.swing.text.AbstractDocument.DefaultDocumentEvent");
340 Clazz.defineMethod (c$, "getContent",
344 Clazz.defineMethod (c$, "createLeafElement",
345 function (parent, a, p0, p1) {
346 return Clazz.innerTypeInstance (javax.swing.text.AbstractDocument.LeafElement, this, null, parent, a, p0, p1);
347 }, "javax.swing.text.Element,javax.swing.text.AttributeSet,~N,~N");
348 Clazz.defineMethod (c$, "createBranchElement",
349 function (parent, a) {
350 return Clazz.innerTypeInstance (javax.swing.text.AbstractDocument.BranchElement, this, null, parent, a);
351 }, "javax.swing.text.Element,javax.swing.text.AttributeSet");
352 Clazz.defineMethod (c$, "writeLock",
355 Clazz.defineMethod (c$, "writeUnlock",
358 Clazz.defineMethod (c$, "readLock",
361 Clazz.defineMethod (c$, "readUnlock",
364 c$.$AbstractDocument$AbstractElement$ = function () {
366 c$ = Clazz.decorateAsClass (function () {
367 Clazz.prepareCallback (this, arguments);
369 this.attributes = null;
370 Clazz.instantialize (this, arguments);
371 }, javax.swing.text.AbstractDocument, "AbstractElement", null, [javax.swing.text.Element, javax.swing.text.MutableAttributeSet, javax.swing.tree.TreeNode]);
372 Clazz.makeConstructor (c$,
375 this.attributes = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ().getEmptySet ();
377 this.addAttributes (b);
378 }}, "javax.swing.text.Element,javax.swing.text.AttributeSet");
379 Clazz.defineMethod (c$, "getAttributeCount",
381 return this.attributes.getAttributeCount ();
383 Clazz.defineMethod (c$, "isDefined",
385 return this.attributes.isDefined (a);
387 Clazz.defineMethod (c$, "isEqual",
389 return this.attributes.isEqual (a);
390 }, "javax.swing.text.AttributeSet");
391 Clazz.defineMethod (c$, "copyAttributes",
393 return this.attributes.copyAttributes ();
395 Clazz.defineMethod (c$, "getAttribute",
397 var b = this.attributes.getAttribute (a);
399 var c = (this.parent != null) ? this.parent.getAttributes () : null;
401 b = c.getAttribute (a);
404 Clazz.defineMethod (c$, "getAttributeNames",
406 return this.attributes.getAttributeNames ();
408 Clazz.defineMethod (c$, "containsAttribute",
410 return this.attributes.containsAttribute (a, b);
412 Clazz.defineMethod (c$, "containsAttributes",
414 return this.attributes.containsAttributes (a);
415 }, "javax.swing.text.AttributeSet");
416 Clazz.defineMethod (c$, "getResolveParent",
418 var a = this.attributes.getResolveParent ();
419 if ((a == null) && (this.parent != null)) {
420 a = this.parent.getAttributes ();
423 Clazz.overrideMethod (c$, "addAttribute",
425 this.checkForIllegalCast ();
426 var c = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
427 this.attributes = c.addAttribute (this.attributes, a, b);
429 Clazz.overrideMethod (c$, "addAttributes",
431 this.checkForIllegalCast ();
432 var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
433 this.attributes = b.addAttributes (this.attributes, a);
434 }, "javax.swing.text.AttributeSet");
435 Clazz.overrideMethod (c$, "removeAttribute",
437 this.checkForIllegalCast ();
438 var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
439 this.attributes = b.removeAttribute (this.attributes, a);
441 Clazz.defineMethod (c$, "removeAttributes",
443 this.checkForIllegalCast ();
444 var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
445 this.attributes = b.removeAttributes (this.attributes, a);
446 }, "java.util.Enumeration");
447 Clazz.defineMethod (c$, "removeAttributes",
449 this.checkForIllegalCast ();
450 var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
452 this.attributes = b.getEmptySet ();
454 this.attributes = b.removeAttributes (this.attributes, a);
455 }}, "javax.swing.text.AttributeSet");
456 Clazz.overrideMethod (c$, "setResolveParent",
458 this.checkForIllegalCast ();
459 var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
461 this.attributes = b.addAttribute (this.attributes, javax.swing.text.StyleConstants.ResolveAttribute, a);
463 this.attributes = b.removeAttribute (this.attributes, javax.swing.text.StyleConstants.ResolveAttribute);
464 }}, "javax.swing.text.AttributeSet");
465 Clazz.defineMethod (c$, "checkForIllegalCast",
468 Clazz.overrideMethod (c$, "getDocument",
470 return this.b$["javax.swing.text.AbstractDocument"];
472 Clazz.overrideMethod (c$, "getParentElement",
476 Clazz.defineMethod (c$, "getAttributes",
480 Clazz.overrideMethod (c$, "getName",
482 if (this.attributes.isDefined ("$ename")) {
483 return this.attributes.getAttribute ("$ename");
486 Clazz.overrideMethod (c$, "getChildAt",
488 return this.getElement (a);
490 Clazz.overrideMethod (c$, "getChildCount",
492 return this.getElementCount ();
494 Clazz.overrideMethod (c$, "getParent",
496 return this.getParentElement ();
498 Clazz.overrideMethod (c$, "getIndex",
500 for (var b = this.getChildCount () - 1; b >= 0; b--) if (this.getChildAt (b) === a) return b;
503 }, "javax.swing.tree.TreeNode");
506 c$.$AbstractDocument$BranchElement$ = function () {
508 c$ = Clazz.decorateAsClass (function () {
509 Clazz.prepareCallback (this, arguments);
510 this.$children = null;
513 Clazz.instantialize (this, arguments);
514 }, javax.swing.text.AbstractDocument, "BranchElement", javax.swing.text.AbstractDocument.AbstractElement, null, Clazz.innerTypeInstance (javax.swing.text.AbstractDocument.AbstractElement, this, null, Clazz.inheritArgs));
515 Clazz.makeConstructor (c$,
517 Clazz.superConstructor (this, javax.swing.text.AbstractDocument.BranchElement, [a, b]);
518 this.$children = new Array (1);
521 }, "javax.swing.text.Element,javax.swing.text.AttributeSet");
522 Clazz.defineMethod (c$, "positionToElement",
524 var b = this.getElementIndex (a);
525 var c = this.$children[b];
526 var d = c.getStartOffset ();
527 var e = c.getEndOffset ();
528 if ((a >= d) && (a < e)) {
532 Clazz.defineMethod (c$, "replace",
534 var d = c.length - b;
536 var f = this.nchildren - e;
538 if ((this.nchildren + d) >= this.$children.length) {
539 var h = Math.max (2 * this.$children.length, this.nchildren + d);
540 var i = new Array (h);
541 System.arraycopy (this.$children, 0, i, 0, a);
542 System.arraycopy (c, 0, i, a, c.length);
543 System.arraycopy (this.$children, e, i, g, f);
546 System.arraycopy (this.$children, e, this.$children, g, f);
547 System.arraycopy (c, 0, this.$children, a, c.length);
548 }this.nchildren = this.nchildren + d;
550 Clazz.overrideMethod (c$, "toString",
552 return "BranchElement(" + this.getName () + ") " + this.getStartOffset () + "," + this.getEndOffset () + "\n";
554 Clazz.defineMethod (c$, "getName",
556 var a = Clazz.superCall (this, javax.swing.text.AbstractDocument.BranchElement, "getName", []);
561 Clazz.defineMethod (c$, "getStartOffset",
563 return this.$children[0].getStartOffset ();
565 Clazz.overrideMethod (c$, "getEndOffset",
567 var a = (this.nchildren > 0) ? this.$children[this.nchildren - 1] : this.$children[0];
568 return a.getEndOffset ();
570 Clazz.overrideMethod (c$, "getElement",
572 if (a < this.nchildren) {
573 return this.$children[a];
576 Clazz.overrideMethod (c$, "getElementCount",
578 return this.nchildren;
580 Clazz.overrideMethod (c$, "getElementIndex",
584 var d = this.nchildren - 1;
586 var f = this.getStartOffset ();
588 if (this.nchildren == 0) {
590 }if (a >= this.getEndOffset ()) {
591 return this.nchildren - 1;
592 }if ((this.lastIndex >= c) && (this.lastIndex <= d)) {
593 var h = this.$children[this.lastIndex];
594 f = h.getStartOffset ();
595 g = h.getEndOffset ();
596 if ((a >= f) && (a < g)) {
597 return this.lastIndex;
603 e = c + (Clazz.doubleToInt ((d - c) / 2));
604 var h = this.$children[e];
605 f = h.getStartOffset ();
606 g = h.getEndOffset ();
607 if ((a >= f) && (a < g)) {
623 Clazz.overrideMethod (c$, "isLeaf",
627 Clazz.overrideMethod (c$, "getAllowsChildren",
631 Clazz.overrideMethod (c$, "children",
633 if (this.nchildren == 0) return null;
634 var a = new java.util.Vector (this.nchildren);
635 for (var b = 0; b < this.nchildren; b++) a.addElement (this.$children[b]);
637 return a.elements ();
641 c$.$AbstractDocument$LeafElement$ = function () {
643 c$ = Clazz.decorateAsClass (function () {
644 Clazz.prepareCallback (this, arguments);
647 Clazz.instantialize (this, arguments);
648 }, javax.swing.text.AbstractDocument, "LeafElement", javax.swing.text.AbstractDocument.AbstractElement, null, Clazz.innerTypeInstance (javax.swing.text.AbstractDocument.AbstractElement, this, null, Clazz.inheritArgs));
649 Clazz.makeConstructor (c$,
650 function (a, b, c, d) {
651 Clazz.superConstructor (this, javax.swing.text.AbstractDocument.LeafElement, [a, b]);
653 this.p0 = this.b$["javax.swing.text.AbstractDocument"].createPosition (c);
654 this.p1 = this.b$["javax.swing.text.AbstractDocument"].createPosition (d);
656 if (Clazz.exceptionOf (e, javax.swing.text.BadLocationException)) {
659 throw new javax.swing.text.StateInvariantError ("Can't create Position references");
664 }, "javax.swing.text.Element,javax.swing.text.AttributeSet,~N,~N");
665 Clazz.overrideMethod (c$, "toString",
667 return "LeafElement(" + this.getName () + ") " + this.p0 + "," + this.p1 + "\n";
669 Clazz.overrideMethod (c$, "getStartOffset",
671 return this.p0.getOffset ();
673 Clazz.overrideMethod (c$, "getEndOffset",
675 return this.p1.getOffset ();
677 Clazz.defineMethod (c$, "getName",
679 var a = Clazz.superCall (this, javax.swing.text.AbstractDocument.LeafElement, "getName", []);
684 Clazz.overrideMethod (c$, "getElementIndex",
688 Clazz.overrideMethod (c$, "getElement",
692 Clazz.overrideMethod (c$, "getElementCount",
696 Clazz.overrideMethod (c$, "isLeaf",
700 Clazz.overrideMethod (c$, "getAllowsChildren",
704 Clazz.overrideMethod (c$, "children",
710 c$.$AbstractDocument$DefaultDocumentEvent$ = function () {
712 c$ = Clazz.decorateAsClass (function () {
713 Clazz.prepareCallback (this, arguments);
716 this.changeLookup = null;
718 Clazz.instantialize (this, arguments);
719 }, javax.swing.text.AbstractDocument, "DefaultDocumentEvent", javax.swing.undo.CompoundEdit, javax.swing.event.DocumentEvent);
720 Clazz.makeConstructor (c$,
722 Clazz.superConstructor (this, javax.swing.text.AbstractDocument.DefaultDocumentEvent);
726 }, "~N,~N,javax.swing.event.DocumentEvent.EventType");
727 Clazz.overrideMethod (c$, "toString",
729 return this.edits.toString ();
731 Clazz.defineMethod (c$, "addEdit",
733 if ((this.changeLookup == null) && (this.edits.size () > 10)) {
734 this.changeLookup = new java.util.Hashtable ();
735 var b = this.edits.size ();
736 for (var c = 0; c < b; c++) {
737 var d = this.edits.elementAt (c);
738 if (Clazz.instanceOf (d, javax.swing.event.DocumentEvent.ElementChange)) {
740 this.changeLookup.put (e.getElement (), e);
742 }if ((this.changeLookup != null) && (Clazz.instanceOf (a, javax.swing.event.DocumentEvent.ElementChange))) {
744 this.changeLookup.put (b.getElement (), b);
745 }return Clazz.superCall (this, javax.swing.text.AbstractDocument.DefaultDocumentEvent, "addEdit", [a]);
746 }, "javax.swing.undo.UndoableEdit");
747 Clazz.defineMethod (c$, "redo",
749 this.b$["javax.swing.text.AbstractDocument"].writeLock ();
751 Clazz.superCall (this, javax.swing.text.AbstractDocument.DefaultDocumentEvent, "redo", []);
752 var a = Clazz.innerTypeInstance (javax.swing.text.AbstractDocument.UndoRedoDocumentEvent, this, null, this, false);
753 if (this.type === javax.swing.event.DocumentEvent.EventType.INSERT) {
754 this.b$["javax.swing.text.AbstractDocument"].fireInsertUpdate (a);
755 } else if (this.type === javax.swing.event.DocumentEvent.EventType.REMOVE) {
756 this.b$["javax.swing.text.AbstractDocument"].fireRemoveUpdate (a);
758 this.b$["javax.swing.text.AbstractDocument"].fireChangedUpdate (a);
760 this.b$["javax.swing.text.AbstractDocument"].writeUnlock ();
763 Clazz.defineMethod (c$, "undo",
765 this.b$["javax.swing.text.AbstractDocument"].writeLock ();
767 Clazz.superCall (this, javax.swing.text.AbstractDocument.DefaultDocumentEvent, "undo", []);
768 var a = Clazz.innerTypeInstance (javax.swing.text.AbstractDocument.UndoRedoDocumentEvent, this, null, this, true);
769 if (this.type === javax.swing.event.DocumentEvent.EventType.REMOVE) {
770 this.b$["javax.swing.text.AbstractDocument"].fireInsertUpdate (a);
771 } else if (this.type === javax.swing.event.DocumentEvent.EventType.INSERT) {
772 this.b$["javax.swing.text.AbstractDocument"].fireRemoveUpdate (a);
774 this.b$["javax.swing.text.AbstractDocument"].fireChangedUpdate (a);
776 this.b$["javax.swing.text.AbstractDocument"].writeUnlock ();
779 Clazz.overrideMethod (c$, "isSignificant",
783 Clazz.overrideMethod (c$, "getPresentationName",
785 var a = this.getType ();
786 if (a === javax.swing.event.DocumentEvent.EventType.INSERT) return javax.swing.UIManager.getString ("AbstractDocument.additionText");
787 if (a === javax.swing.event.DocumentEvent.EventType.REMOVE) return javax.swing.UIManager.getString ("AbstractDocument.deletionText");
788 return javax.swing.UIManager.getString ("AbstractDocument.styleChangeText");
790 Clazz.overrideMethod (c$, "getUndoPresentationName",
792 return javax.swing.UIManager.getString ("AbstractDocument.undoText") + " " + this.getPresentationName ();
794 Clazz.overrideMethod (c$, "getRedoPresentationName",
796 return javax.swing.UIManager.getString ("AbstractDocument.redoText") + " " + this.getPresentationName ();
798 Clazz.overrideMethod (c$, "getType",
802 Clazz.overrideMethod (c$, "getOffset",
806 Clazz.overrideMethod (c$, "getLength",
810 Clazz.overrideMethod (c$, "getDocument",
812 return this.b$["javax.swing.text.AbstractDocument"];
814 Clazz.overrideMethod (c$, "getChange",
816 if (this.changeLookup != null) {
817 return this.changeLookup.get (a);
818 }var b = this.edits.size ();
819 for (var c = 0; c < b; c++) {
820 var d = this.edits.elementAt (c);
821 if (Clazz.instanceOf (d, javax.swing.event.DocumentEvent.ElementChange)) {
823 if (a.equals (e.getElement ())) {
827 }, "javax.swing.text.Element");
830 c$.$AbstractDocument$UndoRedoDocumentEvent$ = function () {
832 c$ = Clazz.decorateAsClass (function () {
833 Clazz.prepareCallback (this, arguments);
836 Clazz.instantialize (this, arguments);
837 }, javax.swing.text.AbstractDocument, "UndoRedoDocumentEvent", null, javax.swing.event.DocumentEvent);
838 Clazz.makeConstructor (c$,
842 if (a.getType ().equals (javax.swing.event.DocumentEvent.EventType.INSERT)) {
843 this.type = javax.swing.event.DocumentEvent.EventType.REMOVE;
844 } else if (a.getType ().equals (javax.swing.event.DocumentEvent.EventType.REMOVE)) {
845 this.type = javax.swing.event.DocumentEvent.EventType.INSERT;
847 this.type = a.getType ();
849 this.type = a.getType ();
850 }}, "javax.swing.text.AbstractDocument.DefaultDocumentEvent,~B");
851 Clazz.defineMethod (c$, "getSource",
855 Clazz.overrideMethod (c$, "getOffset",
857 return this.src.getOffset ();
859 Clazz.overrideMethod (c$, "getLength",
861 return this.src.getLength ();
863 Clazz.overrideMethod (c$, "getDocument",
865 return this.src.getDocument ();
867 Clazz.overrideMethod (c$, "getType",
871 Clazz.overrideMethod (c$, "getChange",
873 return this.src.getChange (a);
874 }, "javax.swing.text.Element");
877 c$.$AbstractDocument$DefaultFilterBypass$ = function () {
879 c$ = Clazz.decorateAsClass (function () {
880 Clazz.prepareCallback (this, arguments);
881 Clazz.instantialize (this, arguments);
882 }, javax.swing.text.AbstractDocument, "DefaultFilterBypass", javax.swing.text.DocumentFilter.FilterBypass);
883 Clazz.overrideMethod (c$, "getDocument",
885 return this.b$["javax.swing.text.AbstractDocument"];
887 Clazz.overrideMethod (c$, "remove",
889 this.b$["javax.swing.text.AbstractDocument"].handleRemove (a, b);
891 Clazz.overrideMethod (c$, "insertString",
893 this.b$["javax.swing.text.AbstractDocument"].handleInsertString (a, b, c);
894 }, "~N,~S,javax.swing.text.AttributeSet");
895 Clazz.overrideMethod (c$, "replace",
896 function (a, b, c, d) {
897 this.b$["javax.swing.text.AbstractDocument"].handleRemove (a, b);
898 this.b$["javax.swing.text.AbstractDocument"].handleInsertString (a, c, d);
899 }, "~N,~N,~S,javax.swing.text.AttributeSet");
902 Clazz.declareInterface (javax.swing.text.AbstractDocument, "Content");
903 Clazz.declareInterface (javax.swing.text.AbstractDocument, "AttributeContext");
905 c$ = Clazz.decorateAsClass (function () {
910 Clazz.instantialize (this, arguments);
911 }, javax.swing.text.AbstractDocument, "ElementEdit", javax.swing.undo.AbstractUndoableEdit, javax.swing.event.DocumentEvent.ElementChange);
912 Clazz.makeConstructor (c$,
913 function (a, b, c, d) {
914 Clazz.superConstructor (this, javax.swing.text.AbstractDocument.ElementEdit);
919 }, "javax.swing.text.Element,~N,~A,~A");
920 Clazz.overrideMethod (c$, "getElement",
924 Clazz.overrideMethod (c$, "getIndex",
928 Clazz.overrideMethod (c$, "getChildrenRemoved",
932 Clazz.overrideMethod (c$, "getChildrenAdded",
936 Clazz.defineMethod (c$, "redo",
938 Clazz.superCall (this, javax.swing.text.AbstractDocument.ElementEdit, "redo", []);
939 var a = this.removed;
940 this.removed = this.added;
942 (this.e).replace (this.index, this.removed.length, this.added);
944 Clazz.defineMethod (c$, "undo",
946 Clazz.superCall (this, javax.swing.text.AbstractDocument.ElementEdit, "undo", []);
947 (this.e).replace (this.index, this.added.length, this.removed);
948 var a = this.removed;
949 this.removed = this.added;
953 Clazz.defineStatics (c$,
954 "BAD_LOCATION", "document location failure",
955 "ParagraphElementName", "paragraph",
956 "ContentElementName", "content",
957 "SectionElementName", "section",
958 "BidiElementName", "bidi level",
959 "ElementNameAttribute", "$ename",
960 "I18NProperty", "i18n",
961 "MultiByteProperty", "multiByte",
962 "AsyncLoadPriority", "load priority");