Class SysTray.Java6SysTray

  • Enclosing class:
    SysTray

    private static class SysTray.Java6SysTray
    extends SysTray
    Implementation which provides system tray access using J2SE 1.6 classes by reflection.
    • Constructor Summary

      Constructors 
      Constructor Description
      Java6SysTray()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object addIcon​(java.awt.Image im, java.lang.String tooltip, java.awt.PopupMenu popup, java.awt.event.ActionListener iconListener)
      Adds an icon to the system tray.
      boolean isSupported()
      Indicates whether system tray functionality is available.
      void removeIcon​(java.lang.Object trayIcon)
      Removes a previously-added icon from the tray.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • systemTrayClass_

        private final java.lang.Class systemTrayClass_
      • addMethod_

        private final java.lang.reflect.Method addMethod_
      • removeMethod_

        private final java.lang.reflect.Method removeMethod_
      • trayIconClass_

        private final java.lang.Class trayIconClass_
      • trayIconConstructor_

        private final java.lang.reflect.Constructor trayIconConstructor_
      • setImageAutoSizeMethod_

        private final java.lang.reflect.Method setImageAutoSizeMethod_
      • addActionListenerMethod_

        private final java.lang.reflect.Method addActionListenerMethod_
      • systemTrayInstance_

        private final java.lang.Object systemTrayInstance_
    • Constructor Detail

      • Java6SysTray

        Java6SysTray()
              throws java.lang.ClassNotFoundException,
                     java.lang.IllegalAccessException,
                     java.lang.NoSuchMethodException,
                     java.lang.reflect.InvocationTargetException
        Constructor.
        Throws:
        java.lang.ClassNotFoundException
        java.lang.IllegalAccessException
        java.lang.NoSuchMethodException
        java.lang.reflect.InvocationTargetException
    • Method Detail

      • isSupported

        public boolean isSupported()
        Description copied from class: SysTray
        Indicates whether system tray functionality is available.
        Specified by:
        isSupported in class SysTray
        Returns:
        true iff the addIcon/removeIcon methods are expected to work
      • addIcon

        public java.lang.Object addIcon​(java.awt.Image im,
                                        java.lang.String tooltip,
                                        java.awt.PopupMenu popup,
                                        java.awt.event.ActionListener iconListener)
                                 throws java.awt.AWTException
        Description copied from class: SysTray
        Adds an icon to the system tray.
        Specified by:
        addIcon in class SysTray
        Parameters:
        im - image for display
        tooltip - tooltip text, or null
        popup - popup menu, or null
        iconListener - listener triggered when icon is activated, or null
        Returns:
        tray icon object, may be used for later removal
        Throws:
        java.awt.AWTException
      • removeIcon

        public void removeIcon​(java.lang.Object trayIcon)
                        throws java.awt.AWTException
        Description copied from class: SysTray
        Removes a previously-added icon from the tray.
        Specified by:
        removeIcon in class SysTray
        Parameters:
        trayIcon - object obtained from a previous invocation of addIcon
        Throws:
        java.awt.AWTException