JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / javax / swing / undo / AbstractUndoableEdit.js
1 Clazz.declarePackage ("javax.swing.undo");\r
2 Clazz.load (["javax.swing.undo.UndoableEdit"], "javax.swing.undo.AbstractUndoableEdit", ["javax.swing.UIManager", "javax.swing.undo.CannotRedoException", "$.CannotUndoException"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.hasBeenDone = false;\r
5 this.alive = false;\r
6 Clazz.instantialize (this, arguments);\r
7 }, javax.swing.undo, "AbstractUndoableEdit", null, javax.swing.undo.UndoableEdit);\r
8 Clazz.makeConstructor (c$, \r
9 function () {\r
10 this.hasBeenDone = true;\r
11 this.alive = true;\r
12 });\r
13 Clazz.overrideMethod (c$, "die", \r
14 function () {\r
15 this.alive = false;\r
16 });\r
17 Clazz.overrideMethod (c$, "undo", \r
18 function () {\r
19 if (!this.canUndo ()) {\r
20 throw  new javax.swing.undo.CannotUndoException ();\r
21 }this.hasBeenDone = false;\r
22 });\r
23 Clazz.overrideMethod (c$, "canUndo", \r
24 function () {\r
25 return this.alive && this.hasBeenDone;\r
26 });\r
27 Clazz.overrideMethod (c$, "redo", \r
28 function () {\r
29 if (!this.canRedo ()) {\r
30 throw  new javax.swing.undo.CannotRedoException ();\r
31 }this.hasBeenDone = true;\r
32 });\r
33 Clazz.overrideMethod (c$, "canRedo", \r
34 function () {\r
35 return this.alive && !this.hasBeenDone;\r
36 });\r
37 Clazz.overrideMethod (c$, "addEdit", \r
38 function (anEdit) {\r
39 return false;\r
40 }, "javax.swing.undo.UndoableEdit");\r
41 Clazz.overrideMethod (c$, "replaceEdit", \r
42 function (anEdit) {\r
43 return false;\r
44 }, "javax.swing.undo.UndoableEdit");\r
45 Clazz.overrideMethod (c$, "isSignificant", \r
46 function () {\r
47 return true;\r
48 });\r
49 Clazz.overrideMethod (c$, "getPresentationName", \r
50 function () {\r
51 return "";\r
52 });\r
53 Clazz.overrideMethod (c$, "getUndoPresentationName", \r
54 function () {\r
55 var name = this.getPresentationName ();\r
56 if (!"".equals (name)) {\r
57 name = javax.swing.UIManager.getString ("AbstractUndoableEdit.undoText") + " " + name;\r
58 } else {\r
59 name = javax.swing.UIManager.getString ("AbstractUndoableEdit.undoText");\r
60 }return name;\r
61 });\r
62 Clazz.overrideMethod (c$, "getRedoPresentationName", \r
63 function () {\r
64 var name = this.getPresentationName ();\r
65 if (!"".equals (name)) {\r
66 name = javax.swing.UIManager.getString ("AbstractUndoableEdit.redoText") + " " + name;\r
67 } else {\r
68 name = javax.swing.UIManager.getString ("AbstractUndoableEdit.redoText");\r
69 }return name;\r
70 });\r
71 Clazz.defineMethod (c$, "toString", \r
72 function () {\r
73 return Clazz.superCall (this, javax.swing.undo.AbstractUndoableEdit, "toString", []) + " hasBeenDone: " + this.hasBeenDone + " alive: " + this.alive;\r
74 });\r
75 Clazz.defineStatics (c$,\r
76 "UndoName", "Undo",\r
77 "RedoName", "Redo");\r
78 });\r