author | chegar |
Thu, 17 Oct 2019 20:54:25 +0100 | |
branch | datagramsocketimpl-branch |
changeset 58679 | 9c3209ff7550 |
parent 58678 | 9cf78a70fa4f |
parent 58595 | fa9f28a0e175 |
permissions | -rw-r--r-- |
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
1 |
<!doctype html> |
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
2 |
<html lang="en"> |
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
3 |
<head> |
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
4 |
<meta charset="utf-8"/> |
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
5 |
<title>The AWT Modality</title> |
52831
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
6 |
<style> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
7 |
td {text-align: center;} |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
8 |
tr {text-align: center;} |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
9 |
</style> |
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
10 |
</head> |
2 | 11 |
<!-- |
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
12 |
Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. |
2 | 13 |
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
14 |
||
15 |
This code is free software; you can redistribute it and/or modify it |
|
16 |
under the terms of the GNU General Public License version 2 only, as |
|
5506 | 17 |
published by the Free Software Foundation. Oracle designates this |
2 | 18 |
particular file as subject to the "Classpath" exception as provided |
5506 | 19 |
by Oracle in the LICENSE file that accompanied this code. |
2 | 20 |
|
21 |
This code is distributed in the hope that it will be useful, but WITHOUT |
|
22 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
23 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
24 |
version 2 for more details (a copy is included in the LICENSE file that |
|
25 |
accompanied this code). |
|
26 |
||
27 |
You should have received a copy of the GNU General Public License version |
|
28 |
2 along with this work; if not, write to the Free Software Foundation, |
|
29 |
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
30 |
||
5506 | 31 |
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
32 |
or visit www.oracle.com if you need additional information or have any |
|
33 |
questions. |
|
2 | 34 |
--> |
35 |
||
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
36 |
<body> |
50358 | 37 |
<main role="main"> |
58595
fa9f28a0e175
8231144: Wrap contents of plain HTML files into contentContainer
aivanov
parents:
58325
diff
changeset
|
38 |
<div class="contentContainer"> |
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
39 |
<h1>The AWT Modality</h1> |
2 | 40 |
|
41 |
<p> |
|
42 |
This document, together with the API documentation for modality-related |
|
43 |
classes (such as <code>java.awt.Dialog</code>), briefly describes the new |
|
44 |
modality features and how to use them. It contains the following sections: |
|
45 |
</p><ul> |
|
46 |
<li><a href="#Definitions">Definitions</a></li> |
|
21254
f6d36ee3f269
8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents:
5506
diff
changeset
|
47 |
<li><a href="#ModalityTypes">Modality types</a></li> |
2 | 48 |
<li><a href="#ShowHideBlocking">Show/hide blocking</a></li> |
49 |
<li><a href="#ModalExclusion">Modal exclusion</a></li> |
|
50 |
<li><a href="#Related">Related AWT features</a></li> |
|
51 |
<li><a href="#Security">Security</a></li> |
|
52 |
<li><a href="#PlatformSupport">Platform support</a></li> |
|
53 |
<li><a href="#Compatibility">Compatibility</a></li> |
|
54 |
<li><a href="#Examples">Examples</a></li> |
|
55 |
</ul> |
|
56 |
||
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
57 |
<a id="Definitions"></a> |
50358 | 58 |
<h2>Definitions</h2> |
2 | 59 |
|
60 |
<p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
61 |
Document - a window without an owner that, together with |
2 | 62 |
all its child hierarchy, may be operated on as a single self-contained |
63 |
document. |
|
21254
f6d36ee3f269
8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents:
5506
diff
changeset
|
64 |
Every window belongs to some document — its root can be found as |
2 | 65 |
the closest ancestor window without an owner. |
66 |
</p><p> |
|
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
67 |
<a id="ModalBlocked"></a> |
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
68 |
Modal blocked window - a window, that: |
2 | 69 |
</p><ul> |
70 |
<li>doesn't receive any user input events |
|
71 |
</li><li>doesn't receive input focus |
|
72 |
</li><li>keeps its Z-order below the modal dialog that blocks it |
|
73 |
</li></ul> |
|
74 |
<blockquote> |
|
75 |
<hr> |
|
76 |
<b>Warning!</b> Some window managers allow users to change the window |
|
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
77 |
Z-order in an arbitrary way — in that case the last requirement |
2 | 78 |
may not be met. |
79 |
<hr> |
|
80 |
</blockquote> |
|
81 |
<p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
82 |
Modal dialog - a dialog that blocks some windows while it is |
2 | 83 |
visible. The blocked windows are determined according to the dialog's |
84 |
scope of blocking. |
|
85 |
</p><p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
86 |
Modal excluded window - a window that stays unblocked |
2 | 87 |
while the modal dialog is visible. If a window is modal excluded |
88 |
then all its owned windows and child components are also excluded. |
|
89 |
</p><p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
90 |
Scope of blocking (SB) - the set of windows (instances of |
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
91 |
<code>java.awt.Window</code> and all derived classes) that are blocked by |
2 | 92 |
the modal dialog while it is visible. |
93 |
<blockquote><hr> |
|
94 |
<b>Note</b>: Everywhere in this document the notion of "window" is equal |
|
21254
f6d36ee3f269
8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents:
5506
diff
changeset
|
95 |
to a top-level window in the Java programming language — in other words |
2 | 96 |
an instance of <code>java.awt.Window</code> or any descendant class. |
97 |
<hr></blockquote> |
|
98 |
||
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
99 |
<a id="ModalityTypes"></a> |
50358 | 100 |
<h2>Modality types</h2> |
2 | 101 |
|
102 |
<p> |
|
103 |
There are four supported modality types : |
|
104 |
</p><ul> |
|
105 |
<li>toolkit |
|
106 |
</li><li>application |
|
107 |
</li><li>document |
|
108 |
</li><li>modeless |
|
109 |
</li></ul> |
|
110 |
A dialog is, by default, modeless. A modal dialog is, by default, |
|
111 |
application-modal. |
|
29882 | 112 |
<ol> |
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
113 |
<li>Modeless dialogs<br> |
2 | 114 |
A modeless dialog doesn't block any windows while visible. |
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
115 |
</li><li>Document-modal dialogs<br> |
2 | 116 |
A document-modal dialog blocks all windows from the same |
117 |
document except those from its child hierarchy. The document root |
|
118 |
is determined as the closest ancestor window without an |
|
119 |
owner. |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
120 |
</li><li>Application-modal dialogs<br> |
2 | 121 |
An application-modal dialog blocks all windows from the same |
122 |
application except for those from its child hierarchy. |
|
123 |
If there are several applets launched in a browser, they can be |
|
124 |
treated either as separate applications or a single application. |
|
125 |
This behavior is implementation-dependent. |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
126 |
</li><li>Toolkit-modal dialogs<br> |
2 | 127 |
A toolkit-modal dialog blocks all windows that run in the same |
128 |
toolkit except those from its child hierarchy. If there |
|
129 |
are several applets launched all of them run with the same toolkit, |
|
130 |
so a toolkit-modal dialog shown from an applet may affect other |
|
131 |
applets and all windows of the browser instance which embeds the |
|
132 |
Java runtime environment for this toolkit. |
|
133 |
See the security section below. |
|
134 |
</li></ol> |
|
135 |
<p> |
|
136 |
Modality priority is arranged by the strength of blocking: modeless, |
|
137 |
document-modal, application-modal and toolkit-modal. This arrangement |
|
138 |
is used when determining what dialog should remain unblocked if two |
|
139 |
are visible and block each other. It naturally reflects the nesting |
|
140 |
of a dialog's scope of blocking (SB): a modeless dialog has an empty SB, |
|
141 |
a document-modal dialog's SB is complete in some applications, |
|
142 |
and all the applications are run in one toolkit. </p><p> |
|
143 |
Notes about owners: |
|
144 |
</p><ul> |
|
145 |
<li>Creating a document-modal dialog without an owner:<br> |
|
146 |
Since <code>Dialog</code> is a class derived from |
|
147 |
<code>Window</code>, a <code>Dialog</code> instance automatically |
|
148 |
becomes the root of the document if it has no owner. Thus, if |
|
149 |
such a dialog is document-modal, its scope of blocking is empty |
|
150 |
and it behaves the same way as a modeless dialog. |
|
151 |
</li><li>Creating an application-modal or toolkit-modal dialog with an |
|
152 |
owner:<br> |
|
153 |
The scope of blocking for an application- or toolkit-modal |
|
154 |
dialog, as opposed to a document-modal dialog, doesn't depend on |
|
155 |
its owner. Thus, in this case the only thing that the owner |
|
156 |
affects is the Z-order: the dialog always stays on top of its owner. |
|
157 |
</li></ul> |
|
158 |
<blockquote><hr> |
|
159 |
<b>Implementation note</b>: Changing the modality type for a visible |
|
160 |
dialog may have no effect until it is hidden and then shown again. |
|
161 |
<hr></blockquote> |
|
162 |
||
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
163 |
<a id="ShowHideBlocking"></a> |
50358 | 164 |
<h2>Show/hide blocking</h2> |
2 | 165 |
|
166 |
<p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
167 |
Showing the window or modeless dialog: "F"<br> |
21254
f6d36ee3f269
8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents:
5506
diff
changeset
|
168 |
All the visible modal dialogs are looked through — if F is from the SB |
2 | 169 |
of one of them, it becomes blocked by it. If there are several such |
170 |
dialogs, the first shown is used. If no such dialogs exist, F remains |
|
171 |
unblocked. |
|
172 |
</p><p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
173 |
Showing the modal dialog: "M"<br> |
2 | 174 |
When modal dialog M is shown, all the visible windows fall into one of |
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
175 |
three distinct groups: |
2 | 176 |
<ul> |
177 |
<li>Blockers of M (modal dialogs that block M and |
|
178 |
either are in M's child hierarchy, or are not blocked by M, or have |
|
179 |
a greater mode of modality, or block some other blocker of M) |
|
180 |
<li>Blocked by M (windows from M's SB that are not blockers and are |
|
181 |
not in child hierarchy of any blocker) |
|
182 |
<li>All other windows (windows or modeless |
|
183 |
dialogs outside M's SB and modal dialogs outside M's SB that do not |
|
184 |
block M). |
|
185 |
</ul> |
|
21254
f6d36ee3f269
8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents:
5506
diff
changeset
|
186 |
<p> |
2 | 187 |
After the modal dialog M is shown, it becomes blocked by the first shown |
188 |
dialog from the first group (if there are any), all the windows from the |
|
189 |
second one become blocked by M, and all the windows from the third group |
|
190 |
remain untouched. |
|
191 |
</p><p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
192 |
In typical cases, when no child dialogs are shown before their owners, |
2 | 193 |
this rule can be simplified. (The following, simplified case, may |
194 |
leave out some details). |
|
195 |
</p><p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
196 |
Showing the document-modal dialog: "M"<br> |
2 | 197 |
All the visible application- and toolkit-modal dialogs are looked |
21254
f6d36ee3f269
8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents:
5506
diff
changeset
|
198 |
through — if M is from the SB of one of them, |
2 | 199 |
it becomes blocked by it. If there are several such dialogs, |
200 |
the first shown is used. If no such dialogs exist, M remains unblocked. |
|
201 |
</p><p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
202 |
Showing the application-modal dialog: "M"<br> |
21254
f6d36ee3f269
8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents:
5506
diff
changeset
|
203 |
All the visible toolkit-modal dialogs are looked through — |
2 | 204 |
if M is from the SB of one of them, it becomes blocked by it. |
205 |
If there are several such dialogs, the first shown is used. |
|
206 |
If no such dialogs exist, M remains unblocked. |
|
207 |
</p><p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
208 |
Showing the toolkit-modal dialog: "M"<br> |
2 | 209 |
M remains unblocked. |
52831
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
210 |
|
21254
f6d36ee3f269
8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents:
5506
diff
changeset
|
211 |
<table border="1"> |
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
212 |
<caption>The Standard Blocking Matrix</caption> |
52831
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
213 |
<tbody><tr> |
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
214 |
<th scope="col">current/shown</th> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
215 |
<th scope="col">frame & modeless</th> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
216 |
<th scope="col">document</th> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
217 |
<th scope="col">application</th> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
218 |
<th scope="col">toolkit</th> |
2 | 219 |
</tr> |
52831
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
220 |
<tr> |
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
221 |
<th scope="row">-</th> |
52831
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
222 |
<td>-</td> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
223 |
<td>-</td> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
224 |
<td>-</td> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
225 |
<td>-</td> |
2 | 226 |
</tr> |
52831
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
227 |
<tr> |
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
228 |
<th scope="row">document</th> |
52831
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
229 |
<td>blocked</td> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
230 |
<td>-</td> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
231 |
<td>-</td> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
232 |
<td>-</td> |
2 | 233 |
</tr> |
52831
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
234 |
<tr> |
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
235 |
<th scope="row">application</th> |
52831
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
236 |
<td>blocked</td> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
237 |
<td>blocked</td> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
238 |
<td>-</td> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
239 |
<td>-</td> |
2 | 240 |
</tr> |
52831
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
241 |
<tr> |
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
242 |
<th scope="row">toolkit</th> |
52831
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
243 |
<td>blocked</td> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
244 |
<td>blocked</td> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
245 |
<td>blocked</td> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
246 |
<td>-</td> |
2 | 247 |
</tr> |
52831
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
248 |
</tbody> |
4e9739110cf1
8213048: Invalid use of HTML5 in java.awt files
kaddepalli
parents:
50358
diff
changeset
|
249 |
</table> |
2 | 250 |
<p> |
251 |
After the modal dialog is shown, all the windows from its SB are blocked, |
|
252 |
except those that block this modal dialog. |
|
253 |
</p><p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
254 |
Hiding the window or modeless dialog: "F"<br> |
2 | 255 |
If F was blocked by any modal dialog M, it becomes unblocked and is |
256 |
removed from M's blocked windows list. |
|
257 |
</p><p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
258 |
Hiding the modal dialog: "M"<br> |
2 | 259 |
If M was blocked by any other modal dialog, for example, "N", |
260 |
it becomes unblocked and |
|
261 |
is removed from N's blocked windows list. Then, all the windows and dialogs |
|
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
262 |
blocked by M become unblocked, and after that the same checks |
2 | 263 |
(as in Showing the modal dialog: "M") |
264 |
are performed for each of them in the order they were initially shown. |
|
265 |
||
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
266 |
<a id="ModalExclusion"></a> |
50358 | 267 |
</p><h2>Modal exclusion</h2> |
2 | 268 |
|
269 |
<p> |
|
270 |
There are two modal exclusion types introduced as of JDK 6 |
|
271 |
</p><ul> |
|
272 |
<li>Exclusion from blocking of toolkit-modal dialogs |
|
273 |
</li><li>Exclusion from blocking of application-modal dialogs |
|
274 |
</li></ul> |
|
275 |
By default, a window's modal exclusion property is turned off. |
|
29882 | 276 |
<ol> |
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
277 |
<li>Application-modal exclusion<br> |
2 | 278 |
If a window is application-modal excluded, it is not blocked by any |
279 |
application-modal dialogs. Also, it is not blocked by document-modal |
|
280 |
dialogs from outside of its child hierarchy. |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
281 |
</li><li>Toolkit-modal exclusion<br> |
2 | 282 |
If a window is toolkit-modal excluded, it is not blocked |
283 |
by any application- or toolkit-modal dialogs. Also, it is not |
|
284 |
blocked by document-modal dialogs from outside of their child hierarchy. |
|
285 |
</li></ol> |
|
286 |
<blockquote> |
|
287 |
<hr> |
|
288 |
<b>Implementation note</b>: Changing the modal exclusion type for a visible window |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
289 |
may have no effect until it is hidden and then shown again.<hr> |
2 | 290 |
</blockquote> |
291 |
||
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
292 |
<a id="Related"></a> |
50358 | 293 |
<h2>Related AWT features</h2> |
2 | 294 |
|
295 |
<p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
296 |
Always-On-Top<br> |
2 | 297 |
When a modal dialog that is not always-on-top blocks an always-on-top window, |
298 |
their relative Z-order is unspecified and platform-dependent. |
|
299 |
</p> |
|
300 |
<p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
301 |
The <code>toFront()</code> and <code>toBack()</code> methods<br> |
2 | 302 |
A modal dialog should always be above all its blocked windows. Thus, if a blocked |
303 |
window is brought to the front, its blocking dialog, if any, is also brought to the |
|
304 |
front and remains above the blocked window. Likewise, if a modal dialog is sent to |
|
305 |
the back, all of its blocked windows are sent to the back to keep them below the |
|
306 |
blocking dialog. |
|
307 |
</p> |
|
308 |
<p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
309 |
Minimizing, maximizing and closing blocked windows<br> |
2 | 310 |
When a modal dialog blocks a window, the user may not be able to maximize or |
21254
f6d36ee3f269
8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents:
5506
diff
changeset
|
311 |
minimize the blocked window— however, the actual behavior is unspecified |
2 | 312 |
and platform-dependent. In any case, the user can't close the blocked window |
21254
f6d36ee3f269
8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents:
5506
diff
changeset
|
313 |
interactively— but it can be closed programmatically by calling the |
2 | 314 |
<code>setVisible(false)</code> or <code>dispose()</code> methods on the blocked |
315 |
window. |
|
316 |
</p> |
|
317 |
<p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
318 |
Blocked windows activations<br> |
2 | 319 |
When the user selects a blocked window, it may be brought to the front, along |
21254
f6d36ee3f269
8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents:
5506
diff
changeset
|
320 |
with the blocking modal dialog which would then become the active window— |
2 | 321 |
however, the actual behavior is unspecified and platform-dependent. |
322 |
</p> |
|
323 |
<p> |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
324 |
Hiding a modal dialog<br> |
2 | 325 |
When the modal dialog that currently has focus is hidden, it is unspecified |
326 |
and platform-dependent, which other window will become the active window. |
|
327 |
Any of the following may become the active window: |
|
328 |
<ol> |
|
329 |
<li>The owner of the modal dialog - if the owner is unblocked. |
|
330 |
</li><li>The <code>Window</code>, which was active before this modal dialog gained |
|
331 |
focus - if the owner of the modal dialog is absent or is blocked. |
|
332 |
</li></ol> |
|
333 |
If the modal dialog to be hidden does not have focus, the active window remains |
|
334 |
unchanged. |
|
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
335 |
|
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
336 |
<a id="Security"></a> |
50358 | 337 |
<h2>Security</h2> |
2 | 338 |
|
339 |
<p> |
|
340 |
A special <code>AWTPermission</code>, <code>"toolkitModality"</code>, |
|
341 |
is required to show toolkit-modal |
|
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
342 |
dialogs. This would prevent, for example, blocking a browser or |
2 | 343 |
Java Web Start (JWS) by modal dialogs shown from applets. |
344 |
</p><p> |
|
345 |
The same permission is required to exclude a window from toolkit modality. |
|
346 |
This would prevent, for example, a dialog shown from an applet not to be |
|
347 |
blocked by a browser's or JWS's modal dialog. |
|
348 |
||
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
349 |
<a id="PlatformSupport"></a> |
50358 | 350 |
</p><h2>Platform support</h2> |
2 | 351 |
|
352 |
<p> |
|
353 |
Two <code>java.awt.Toolkit</code> methods allow you to check whether |
|
354 |
the current platform supports specific modality features: |
|
355 |
</p><ul> |
|
356 |
<li><code>isModalityTypeSupported(modalityType)</code><br> |
|
357 |
Returns whether the specified modality type is supported on |
|
358 |
the current platform. |
|
359 |
If mode "M" is not supported and a dialog is set to M-modal, |
|
360 |
it behaves as modeless. |
|
361 |
</li> |
|
362 |
<li><code>isModalExclusionTypeSupported(modalExclusionType)</code><br> |
|
363 |
Returns whether the given modal exclusion type is supported on |
|
364 |
the current platform. If exclusion type "E" is not supported |
|
365 |
and a window is marked as E-excluded, this has no effect. |
|
366 |
</li></ul> |
|
367 |
||
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
368 |
<a id="Compatibility"></a> |
50358 | 369 |
<h2>Compatibility</h2> |
2 | 370 |
|
371 |
<p> |
|
372 |
The default modality type is application-modal. It is used by the API |
|
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
373 |
calls: <code>Dialog.setModal(true)</code>, |
2 | 374 |
<code>Dialog(owner, true)</code>, etc. Prior to JDK 6 |
375 |
the default type was toolkit-modal, |
|
376 |
but the only distinction between application- and toolkit-modality is for |
|
377 |
applets and applications launched from Java Web Start. |
|
378 |
||
48264
efda6932a433
8182410: missing 'title' in api/javax/swing/plaf/synth/doc-files/componentProperties.html
serb
parents:
47216
diff
changeset
|
379 |
<a id="Examples"></a> |
50358 | 380 |
</p><h2>Examples</h2> |
2 | 381 |
|
58325
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
382 |
<h3>Example 1</h3> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
383 |
<ol style="float: left"> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
384 |
<li>Frame F is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
385 |
<li>Document-modal dialog D<sub>i</sub> is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
386 |
<li>F becomes blocked by D<sub>i</sub> — it's in the same document<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
387 |
<li>Document-modal dialog D<sub>ii</sub> is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
388 |
<li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> — it's in the |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
389 |
same document<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
390 |
</ol> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
391 |
<p style="float: left; margin-left: 1em"> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
392 |
<img src="modal-example1.gif" alt="Example 1"> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
393 |
</p> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
394 |
|
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
395 |
<h3 style="clear: left">Example 2</h3> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
396 |
<ol style="float: left"> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
397 |
<li>Frame F is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
398 |
<li>Document-modal dialog D<sub>i</sub> is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
399 |
<li>F becomes blocked by D<sub>i</sub> — it's in the same document<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
400 |
<li>Document-modal dialog D<sub>ii</sub> is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
401 |
<li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> — it's in the |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
402 |
same document<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
403 |
</ol> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
404 |
<p style="float: left; margin-left: 1em"> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
405 |
<img src="modal-example2.gif" alt="Example 2"> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
406 |
</p> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
407 |
|
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
408 |
<h3 style="clear: left">Example 3</h3> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
409 |
<ol style="float: left"> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
410 |
<li>Frame F is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
411 |
<li>Toolkit-modal dialog D<sub>i</sub> is created, but not shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
412 |
<li>Document-modal dialog D<sub>ii</sub> is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
413 |
<li>F becomes blocked by D<sub>ii</sub> — it's in the same document<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
414 |
<li>Application-modal dialog D<sub>iii</sub> is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
415 |
<li>D<sub>ii</sub> becomes blocked by D<sub>iii</sub> — |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
416 |
it's in the same application<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
417 |
<li>D<sub>i</sub> is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
418 |
<li>D<sub>i</sub> becomes blocked by D<sub>ii</sub> — it's its owner<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
419 |
<li>D<sub>iii</sub> remains unblocked — it blocks D<sub>ii</sub> and |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
420 |
D<sub>ii</sub> blocks D<sub>i</sub><br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
421 |
</ol> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
422 |
<p style="float: left; margin-left: 1em"> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
423 |
<img src="modal-example3.gif" alt="Example 3"> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
424 |
</p> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
425 |
|
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
426 |
<h3 style="clear: left">Example 4</h3> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
427 |
<ol style="float: left"> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
428 |
<li>Frame F is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
429 |
<li>Toolkit-modal dialog D<sub>i</sub> is created, but not shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
430 |
<li>Document-modal dialog D<sub>ii</sub> is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
431 |
<li>F becomes blocked by D<sub>ii</sub> — it's in the same document<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
432 |
<li>Application-modal dialog D<sub>iii</sub> is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
433 |
<li>D<sub>ii</sub> becomes blocked by D<sub>iii</sub> — it's in the |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
434 |
same application<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
435 |
<li>D<sub>i</sub> is shown<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
436 |
<li>D<sub>iii</sub> becomes blocked by D<sub>i</sub> — D<sub>i</sub> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
437 |
is not blocked<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
438 |
<li>D<sub>i</sub> remains unblocked<br> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
439 |
</ol> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
440 |
<p style="float: left; margin-left: 1em"> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
441 |
<img src="modal-example4.gif" alt="Example 4"> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
442 |
</p> |
d32a3b1ca84a
8225372: accessibility errors in tables in java.desktop files
serb
parents:
52831
diff
changeset
|
443 |
<br style="clear:both;"> |
58595
fa9f28a0e175
8231144: Wrap contents of plain HTML files into contentContainer
aivanov
parents:
58325
diff
changeset
|
444 |
</div> |
50358 | 445 |
</main> |
2 | 446 |
</body></html> |