/*
test
@bug 6680988
@summary verify that various shortcuts and accelerators work
@author yuri.nesterenko : area=awt.keyboard
@run applet/manual=yesno AcceleratorTest.html
*/
/**
*
* summary:
*/
//import java.applet.Applet;
{
//Declare things used in the test, like buttons and labels here
"\u042E, keep me in focus",
"Item Cyrl Be",
"Item English Period",
"Item English N",
"\u0436"
};
public void init()
{
//Create instructions for the user here, as well as set up
// the environment -- set the layout manager, add buttons,
// etc.
this.setLayout (new BorderLayout ());
String[] instructions =
{
" Ensure you have Russian keyboard layout as a currently active.",
"(1) Press Ctrl+\u0411 (a key with \",<\" on it) ",
"(2) Find a . (period) in this layout (perhaps \"/?\" or \"7&\" key).",
"Press Ctrl+.",
"(3) Press Crtl+ regular English . (period) key (on \".>\" )",
"(4) Press Ctrl+ key with English N.",
"(5) Press Alt+\u042E (key with \".>\")",
"(6) Press Alt+\u0436 (key with \";:\")",
"If all expected commands will be fired, look for message",
"\"All tests passed\""
};
}
menuItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.getExtendedKeyCodeForChar('\u0431'),
ks = KeyStroke.getKeyStroke(KeyEvent.getExtendedKeyCodeForChar('\u0436'), java.awt.event.InputEvent.ALT_DOWN_MASK);
new AbstractAction("pushAction") {
}
boolean notYet = false;
}
if( !notYet ) {
}
}
}
);
jfr.setVisible(true);
}//End init()
public void start ()
{
//Get things going. Request focus, set size, et cetera
setVisible(true);
validate();
}// start()
expectedCmd = eCmd;
}
}
boolean notYet = false;
//Sysout.println(CMD[i]+":"+cmdHash.get(CMD[i]));
}
if( !notYet ) {
}
}
}
}// class AcceleratorTest
/* Place other classes related to the test after this line */
/****************************************************
Standard Test Machinery
DO NOT modify anything below -- it's a standard
chunk of code whose purpose is to make user
interaction uniform, and thereby make it simpler
to read and understand someone else's test.
****************************************************/
/**
This is part of the standard test machinery.
It creates a dialog (with the instructions), and is the interface
for sending text messages to the user.
To print the instructions, send an array of strings to Sysout.createDialog
WithInstructions method. Put one line of instructions per array entry.
To display a message for the tester to see, simply call Sysout.println
with the string to be displayed.
This mimics System.out.println but works within the test harness as well
as standalone.
*/
class Sysout
{
private static boolean numbering = false;
{
dialog.setVisible(true);
println( "Any messages for the tester will display here." );
}
public static void createDialog( )
{
dialog.setVisible(true);
println( "Any messages for the tester will display here." );
}
/* Enables message counting for the tester. */
}
{
}
{
if (numbering) {
}
}
}// Sysout class
/**
This is part of the standard test machinery. It provides a place for the
test instructions to be displayed, and a place for interactive messages
to the user to be displayed.
To have the test instructions displayed, see Sysout.
To have a message to the user be displayed, see Sysout.
Do not call anything in this dialog directly.
*/
{
//DO NOT call this directly, go through Sysout
{
pack();
setVisible(true);
}// TestDialog()
//DO NOT call this directly, go through Sysout
{
//Clear out any current instructions
//Go down array of instruction strings
{
//chop up each into pieces maxSringLength long
remainingStr = instructions[ i ];
{
//if longer than max then chop off first max chars to print
{
//Try to chop on a word boundary
int posOfSpace = remainingStr.
}
//else just print
else
{
remainingStr = "";
}
}// while
}// for
}//printInstructions()
//DO NOT call this directly, go through Sysout
{
}
}// TestDialog class