ModalBlockedStealsFocusTest.java revision 0
0N/A * Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A @summary Modal blocked window shouldn't steal focus when shown, or brought to front. 0N/A @author anton.tarasov@...: area=awt.focus 0N/A // Create instructions for the user here, as well as set up 0N/A // the environment -- set the layout manager, add buttons, 0N/A {
"This is an automatic test. Simply wait until it is done." 0N/A // Test 1. Show a modal blocked frame, check that it doesn't steal focus. 0N/A // Test 2. Brought a modal blocked frame to front, check that it doesn't steal focus. 0N/A/**************************************************** 0N/A Standard Test Machinery 0N/A DO NOT modify anything below -- it's a standard 0N/A chunk of code whose purpose is to make user 0N/A interaction uniform, and thereby make it simpler 0N/A to read and understand someone else's test. 0N/A ****************************************************/ 0N/A This is part of the standard test machinery. 0N/A It creates a dialog (with the instructions), and is the interface 0N/A for sending text messages to the user. 0N/A To print the instructions, send an array of strings to Sysout.createDialog 0N/A WithInstructions method. Put one line of instructions per array entry. 0N/A To display a message for the tester to see, simply call Sysout.println 0N/A with the string to be displayed. 0N/A This mimics System.out.println but works within the test harness as well 0N/A println(
"Any messages for the tester will display here." );
0N/A println(
"Any messages for the tester will display here." );
0N/A This is part of the standard test machinery. It provides a place for the 0N/A test instructions to be displayed, and a place for interactive messages 0N/A to the user to be displayed. 0N/A To have the test instructions displayed, see Sysout. 0N/A To have a message to the user be displayed, see Sysout. 0N/A Do not call anything in this dialog directly. 0N/A //DO NOT call this directly, go through Sysout 0N/A //DO NOT call this directly, go through Sysout 0N/A //Clear out any current instructions 0N/A //Go down array of instruction strings 0N/A //chop up each into pieces maxSringLength long 0N/A //if longer than max then chop off first max chars to print 0N/A //Try to chop on a word boundary 0N/A }
//printInstructions() 0N/A //DO NOT call this directly, go through Sysout