< prev index next >

test/jdk/java/awt/TrayIcon/TrayIconEventModifiers/TrayIconEventModifiersTest.java

Print this page
rev 59106 : imported patch client


  92 
  93     static int[] keyMasks = {
  94         KeyEvent.SHIFT_DOWN_MASK,
  95         KeyEvent.CTRL_DOWN_MASK
  96     };
  97 
  98     public static void main(String[] args) throws Exception {
  99         if (! SystemTray.isSupported()) {
 100             System.out.println("SystemTray not supported on the platform under test. " +
 101                     "Marking the test passed");
 102         } else {
 103             if (System.getProperty("os.name").toLowerCase().startsWith("win"))
 104                 System.err.println("Test can fail if the icon hides to a tray icons pool" +
 105                         "in Windows 7, which is behavior by default.\n" +
 106                         "Set \"Right mouse click\" -> \"Customize notification icons\" -> " +
 107                         "\"Always show all icons and notifications on the taskbar\" true " +
 108                         "to avoid this problem. Or change behavior only for Java SE tray " +
 109                         "icon and rerun test.");
 110 
 111             System.out.println(System.getProperty("os.arch"));
 112             if (System.getProperty("os.name").indexOf("Sun") != -1 &&
 113                     System.getProperty("os.arch").indexOf("sparc") != -1) {
 114                 keyTypes = new int[]{
 115                         KeyEvent.VK_SHIFT,
 116                         KeyEvent.VK_CONTROL,
 117                         KeyEvent.VK_META
 118                 };
 119 
 120                 keyNames = new String[]{
 121                         "SHIFT",
 122                         "CONTROL",
 123                         "META"
 124                 };
 125                 keyMasks = new int[]{
 126                         KeyEvent.SHIFT_DOWN_MASK,
 127                         KeyEvent.CTRL_DOWN_MASK,
 128                         KeyEvent.META_DOWN_MASK
 129                 };
 130             }
 131 
 132             if (SystemTrayIconHelper.isOel7()) {
 133                 System.out.println("OEL 7 doesn't support click modifiers in " +
 134                         "systray. Skipped");
 135                 return;
 136             }
 137 
 138             new TrayIconEventModifiersTest().doTest();
 139         }
 140     }
 141 
 142     public TrayIconEventModifiersTest() throws Exception {
 143         robot = new ExtendedRobot();
 144         EventQueue.invokeAndWait(this::initializeGUI);
 145     }
 146 
 147     private void initializeGUI() {
 148 
 149         SystemTray tray = SystemTray.getSystemTray();
 150         icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), caption);




  92 
  93     static int[] keyMasks = {
  94         KeyEvent.SHIFT_DOWN_MASK,
  95         KeyEvent.CTRL_DOWN_MASK
  96     };
  97 
  98     public static void main(String[] args) throws Exception {
  99         if (! SystemTray.isSupported()) {
 100             System.out.println("SystemTray not supported on the platform under test. " +
 101                     "Marking the test passed");
 102         } else {
 103             if (System.getProperty("os.name").toLowerCase().startsWith("win"))
 104                 System.err.println("Test can fail if the icon hides to a tray icons pool" +
 105                         "in Windows 7, which is behavior by default.\n" +
 106                         "Set \"Right mouse click\" -> \"Customize notification icons\" -> " +
 107                         "\"Always show all icons and notifications on the taskbar\" true " +
 108                         "to avoid this problem. Or change behavior only for Java SE tray " +
 109                         "icon and rerun test.");
 110 
 111             System.out.println(System.getProperty("os.arch"));



















 112 
 113             if (SystemTrayIconHelper.isOel7()) {
 114                 System.out.println("OEL 7 doesn't support click modifiers in " +
 115                         "systray. Skipped");
 116                 return;
 117             }
 118 
 119             new TrayIconEventModifiersTest().doTest();
 120         }
 121     }
 122 
 123     public TrayIconEventModifiersTest() throws Exception {
 124         robot = new ExtendedRobot();
 125         EventQueue.invokeAndWait(this::initializeGUI);
 126     }
 127 
 128     private void initializeGUI() {
 129 
 130         SystemTray tray = SystemTray.getSystemTray();
 131         icon = new TrayIcon(new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB), caption);


< prev index next >