01: package org.uispec4j;
02:
03: import javax.swing.*;
04:
05: public class WindowForDialogTest extends WindowTestCase {
06:
07: public void testIsModalWithNonModalDialog() throws Exception {
08: Window window = new Window(new JDialog());
09: checkIsModal(window, false);
10: }
11:
12: public void testIsModalWithModalDialog() throws Exception {
13: JFrame frame = new JFrame();
14: Window window = new Window(new JDialog(frame, true));
15: checkIsModal(window, true);
16: }
17:
18: protected Window createWindowWithMenu(JMenuBar jMenuBar) {
19: JDialog dialog = new JDialog();
20: dialog.setJMenuBar(jMenuBar);
21: return new Window(dialog);
22: }
23:
24: protected Window createWindowWithTitle(String title) {
25: JDialog dialog = new JDialog();
26: dialog.setTitle(title);
27: return new Window(dialog);
28: }
29:
30: protected void close(Window window) {
31: JDialog dialog = (JDialog) window.getAwtContainer();
32: dialog.dispose();
33: }
34: }
|