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