1 Clazz.declarePackage ("java.awt");
2 Clazz.load (["java.lang.Enum", "java.awt.Window"], "java.awt.Dialog", ["java.lang.IllegalArgumentException", "java.awt.Frame", "$.IllegalComponentStateException"], function () {
3 c$ = Clazz.decorateAsClass (function () {
5 this.undecorated = false;
7 this.modalityType = null;
10 this.isInDispose = false;
11 Clazz.instantialize (this, arguments);
12 }, java.awt, "Dialog", java.awt.Window);
13 Clazz.makeConstructor (c$,
15 this.construct (owner, "", false);
17 Clazz.makeConstructor (c$,
18 function (owner, modal) {
19 this.construct (owner, "", modal);
20 }, "java.awt.Frame,~B");
21 Clazz.makeConstructor (c$,
22 function (owner, title) {
23 this.construct (owner, title, false);
24 }, "java.awt.Frame,~S");
25 Clazz.makeConstructor (c$,
26 function (owner, title, modal) {
27 this.construct (owner, title, modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS);
28 }, "java.awt.Frame,~S,~B");
29 Clazz.makeConstructor (c$,
30 function (owner, title, modal, gc) {
31 this.construct (owner, title, modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS, gc);
32 }, "java.awt.Frame,~S,~B,java.awt.GraphicsConfiguration");
33 Clazz.makeConstructor (c$,
35 this.construct (owner, "", false);
36 }, "java.awt.Dialog");
37 Clazz.makeConstructor (c$,
38 function (owner, title) {
39 this.construct (owner, title, false);
40 }, "java.awt.Dialog,~S");
41 Clazz.makeConstructor (c$,
42 function (owner, title, modal) {
43 this.construct (owner, title, modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS);
44 }, "java.awt.Dialog,~S,~B");
45 Clazz.makeConstructor (c$,
46 function (owner, title, modal, gc) {
47 this.construct (owner, title, modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS, gc);
48 }, "java.awt.Dialog,~S,~B,java.awt.GraphicsConfiguration");
49 Clazz.makeConstructor (c$,
51 this.construct (owner, null, java.awt.Dialog.ModalityType.MODELESS);
52 }, "java.awt.Window");
53 Clazz.makeConstructor (c$,
54 function (owner, title) {
55 this.construct (owner, title, java.awt.Dialog.ModalityType.MODELESS);
56 }, "java.awt.Window,~S");
57 Clazz.makeConstructor (c$,
58 function (owner, modalityType) {
59 this.construct (owner, null, modalityType);
60 }, "java.awt.Window,java.awt.Dialog.ModalityType");
61 Clazz.makeConstructor (c$,
62 function (owner, title, modalityType) {
63 Clazz.superConstructor (this, java.awt.Dialog, [owner]);
64 if ((owner != null) && !(Clazz.instanceOf (owner, java.awt.Frame)) && !(Clazz.instanceOf (owner, java.awt.Dialog))) {
65 throw new IllegalArgumentException ("Wrong parent window");
67 this.setModalityType (modalityType);
68 }, "java.awt.Window,~S,java.awt.Dialog.ModalityType");
69 Clazz.makeConstructor (c$,
70 function (owner, title, modalityType, gc) {
71 Clazz.superConstructor (this, java.awt.Dialog, [owner, gc]);
72 if ((owner != null) && !(Clazz.instanceOf (owner, java.awt.Frame)) && !(Clazz.instanceOf (owner, java.awt.Dialog))) {
73 throw new IllegalArgumentException ("wrong owner window");
75 this.setModalityType (modalityType);
76 }, "java.awt.Window,~S,java.awt.Dialog.ModalityType,java.awt.GraphicsConfiguration");
77 Clazz.overrideMethod (c$, "constructComponentName",
80 return "dialog" + java.awt.Dialog.$nameCounter++;
82 Clazz.defineMethod (c$, "addNotify",
85 if (this.parent != null) {
86 this.parent.addNotify ();
87 }Clazz.superCall (this, java.awt.Dialog, "addNotify", []);
89 Clazz.defineMethod (c$, "isModal",
91 return this.isModal_NoClientCode ();
93 Clazz.defineMethod (c$, "isModal_NoClientCode",
95 return this.modalityType !== java.awt.Dialog.ModalityType.MODELESS;
97 Clazz.defineMethod (c$, "setModal",
100 this.setModalityType (modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS);
102 Clazz.defineMethod (c$, "getModalityType",
104 return this.modalityType;
106 Clazz.defineMethod (c$, "setModalityType",
109 type = java.awt.Dialog.ModalityType.MODELESS;
110 }if (this.modalityType === type) {
112 }this.checkModalityPermission (type);
113 this.modalityType = type;
114 this.modal = (this.modalityType !== java.awt.Dialog.ModalityType.MODELESS);
115 }, "java.awt.Dialog.ModalityType");
116 Clazz.defineMethod (c$, "getTitle",
120 Clazz.defineMethod (c$, "setTitle",
122 var oldTitle = this.title;
125 }this.firePropertyChangeObject ("title", oldTitle, title);
127 Clazz.defineMethod (c$, "show",
130 Clazz.defineMethod (c$, "modalityPushed",
133 Clazz.defineMethod (c$, "modalityPopped",
136 Clazz.defineMethod (c$, "interruptBlocking",
138 if (this.isModal ()) {
140 } else if (this.windowClosingException != null) {
141 this.windowClosingException.fillInStackTrace ();
142 this.windowClosingException.printStackTrace ();
143 this.windowClosingException = null;
145 Clazz.defineMethod (c$, "hideAndDisposePreHandler",
147 this.isInHide = true;
149 Clazz.defineMethod (c$, "hideAndDisposeHandler",
151 this.isInHide = false;
153 Clazz.defineMethod (c$, "hide",
155 this.hideAndDisposePreHandler ();
156 Clazz.superCall (this, java.awt.Dialog, "hide", []);
157 if (!this.isInDispose) {
158 this.hideAndDisposeHandler ();
160 Clazz.defineMethod (c$, "doDispose",
162 this.isInDispose = true;
163 Clazz.superCall (this, java.awt.Dialog, "doDispose", []);
164 this.hideAndDisposeHandler ();
165 this.isInDispose = false;
167 Clazz.defineMethod (c$, "isResizable",
169 return this.resizable;
171 Clazz.defineMethod (c$, "setResizable",
172 function (resizable) {
173 var testvalid = false;
175 this.resizable = resizable;
177 this.invalidateIfValid ();
179 Clazz.defineMethod (c$, "setUndecorated",
180 function (undecorated) {
182 if (this.isDisplayable ()) {
183 throw new java.awt.IllegalComponentStateException ("The dialog is displayable.");
184 }this.undecorated = undecorated;
186 Clazz.defineMethod (c$, "isUndecorated",
188 return this.undecorated;
190 Clazz.defineMethod (c$, "paramString",
192 var str = Clazz.superCall (this, java.awt.Dialog, "paramString", []) + "," + this.modalityType;
193 if (this.title != null) {
194 str += ",title=" + this.title;
197 Clazz.defineMethod (c$, "modalShow",
200 Clazz.defineMethod (c$, "modalHide",
203 Clazz.defineMethod (c$, "shouldBlock",
205 if (!this.isVisible_NoClientCode () || (!w.isVisible_NoClientCode () && !w.isInShow) || this.isInHide || (w === this) || !this.isModal_NoClientCode ()) {
207 }if ((Clazz.instanceOf (w, java.awt.Dialog)) && (w).isInHide) {
209 }var blockerToCheck = this;
210 while (blockerToCheck != null) {
212 while ((c != null) && (c !== blockerToCheck)) {
213 c = c.getParent_NoClientCode ();
215 if (c === blockerToCheck) {
217 }blockerToCheck = blockerToCheck.getModalBlocker ();
219 switch (this.modalityType) {
220 case java.awt.Dialog.ModalityType.MODELESS:
222 case java.awt.Dialog.ModalityType.DOCUMENT_MODAL:
223 if (w.isModalExcluded (java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE)) {
225 while ((c != null) && (c !== w)) {
226 c = c.getParent_NoClientCode ();
230 return this.getDocumentRoot () === w.getDocumentRoot ();
231 }case java.awt.Dialog.ModalityType.APPLICATION_MODAL:
232 return !w.isModalExcluded (java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE) && (this.appContext === w.appContext);
233 case java.awt.Dialog.ModalityType.TOOLKIT_MODAL:
234 return !w.isModalExcluded (java.awt.Dialog.ModalExclusionType.TOOLKIT_EXCLUDE);
237 }, "java.awt.Window");
238 Clazz.defineMethod (c$, "checkModalityPermission",
240 }, "java.awt.Dialog.ModalityType");
242 c$ = Clazz.declareType (java.awt.Dialog, "ModalityType", Enum);
243 Clazz.defineEnumConstant (c$, "MODELESS", 0, []);
244 Clazz.defineEnumConstant (c$, "DOCUMENT_MODAL", 1, []);
245 Clazz.defineEnumConstant (c$, "APPLICATION_MODAL", 2, []);
246 Clazz.defineEnumConstant (c$, "TOOLKIT_MODAL", 3, []);
249 c$ = Clazz.declareType (java.awt.Dialog, "ModalExclusionType", Enum);
250 Clazz.defineEnumConstant (c$, "NO_EXCLUDE", 0, []);
251 Clazz.defineEnumConstant (c$, "APPLICATION_EXCLUDE", 1, []);
252 Clazz.defineEnumConstant (c$, "TOOLKIT_EXCLUDE", 2, []);
254 c$.DEFAULT_MODALITY_TYPE = c$.prototype.DEFAULT_MODALITY_TYPE = java.awt.Dialog.ModalityType.APPLICATION_MODAL;
255 Clazz.defineStatics (c$,