01: package org.uispec4j;
02:
03: import javax.swing.*;
04:
05: /**
06: * Test class for {@link Window}.
07: */
08: public class WindowForInternalFrameTest extends WindowTestCase {
09:
10: public void testIsModal() throws Exception {
11: Window window = new Window(new JInternalFrame());
12: checkIsModal(window, false);
13: }
14:
15: protected Window createWindowWithMenu(JMenuBar jMenuBar) {
16: JInternalFrame frame = new JInternalFrame();
17: frame.setJMenuBar(jMenuBar);
18: return new Window(frame);
19: }
20:
21: protected Window createWindowWithTitle(String title) {
22: return new Window(new JInternalFrame(title));
23: }
24:
25: protected void show(Window window) {
26: JInternalFrame internalFrame = (JInternalFrame) window
27: .getAwtContainer();
28: JDialog dialog = new JDialog();
29: dialog.getContentPane().add(internalFrame);
30: internalFrame.setVisible(true);
31: dialog.setVisible(true);
32: }
33:
34: protected void close(Window window) {
35: JInternalFrame frame = (JInternalFrame) window
36: .getAwtContainer();
37: frame.dispose();
38: }
39: }
|