Class SwtGatewayTray

java.lang.Object
davmail.ui.tray.SwtGatewayTray
All Implemented Interfaces:
DavGatewayTrayInterface

public class SwtGatewayTray extends Object implements DavGatewayTrayInterface
Tray icon handler based on SWT
  • Constructor Details

    • SwtGatewayTray

      protected SwtGatewayTray()
  • Method Details

    • initDisplay

      public static void initDisplay()
    • getFrameIcons

      public List<Image> getFrameIcons()
      Return AWT Image icon for frame title.
      Specified by:
      getFrameIcons in interface DavGatewayTrayInterface
      Returns:
      frame icon
    • switchIcon

      public void switchIcon()
      Switch tray icon between active and standby icon.
      Specified by:
      switchIcon in interface DavGatewayTrayInterface
    • resetIcon

      public void resetIcon()
      Set tray icon to inactive (network down)
      Specified by:
      resetIcon in interface DavGatewayTrayInterface
    • inactiveIcon

      public void inactiveIcon()
      Set tray icon to inactive (network down)
      Specified by:
      inactiveIcon in interface DavGatewayTrayInterface
    • isActive

      public boolean isActive()
      Check if current tray status is inactive (network down).
      Specified by:
      isActive in interface DavGatewayTrayInterface
      Returns:
      true if inactive
    • displayMessage

      public void displayMessage(String message, org.apache.log4j.Level level)
      Log and display balloon message according to log level.
      Specified by:
      displayMessage in interface DavGatewayTrayInterface
      Parameters:
      message - text message
      level - log level
    • loadSwtImage

      public static org.eclipse.swt.graphics.Image loadSwtImage(String fileName)
      Load image with current class loader. No scaling
      Parameters:
      fileName - image resource file name
      Returns:
      image
    • loadSwtImage

      public static org.eclipse.swt.graphics.Image loadSwtImage(String fileName, int targetSize)
      Load image with current class loader. Scale to size
      Parameters:
      fileName - image resource file name
      targetSize - target image size
      Returns:
      image
    • setDefaultIconImage

      protected static void setDefaultIconImage(org.eclipse.swt.graphics.Image image)
    • setActiveIconImage

      protected static void setActiveIconImage(org.eclipse.swt.graphics.Image image)
    • setInactiveIconImage

      protected static void setInactiveIconImage(org.eclipse.swt.graphics.Image image)
    • init

      public void init()
      Create tray icon and register frame listeners.
      Specified by:
      init in interface DavGatewayTrayInterface
    • dispose

      public void dispose()
      Description copied from interface: DavGatewayTrayInterface
      destroy frames
      Specified by:
      dispose in interface DavGatewayTrayInterface