Package davmail.ui.tray
Class SwtGatewayTray
java.lang.Object
davmail.ui.tray.SwtGatewayTray
- All Implemented Interfaces:
DavGatewayTrayInterface
Tray icon handler based on SWT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddisplayMessage(String message, org.apache.log4j.Level level) Log and display balloon message according to log level.voiddispose()destroy framesReturn AWT Image icon for frame title.voidSet tray icon to inactive (network down)voidinit()Create tray icon and register frame listeners.static voidbooleanisActive()Check if current tray status is inactive (network down).static org.eclipse.swt.graphics.ImageloadSwtImage(String fileName) Load image with current class loader.static org.eclipse.swt.graphics.ImageloadSwtImage(String fileName, int targetSize) Load image with current class loader.voidSet tray icon to inactive (network down)protected static voidsetActiveIconImage(org.eclipse.swt.graphics.Image image) protected static voidsetDefaultIconImage(org.eclipse.swt.graphics.Image image) protected static voidsetInactiveIconImage(org.eclipse.swt.graphics.Image image) voidSwitch tray icon between active and standby icon.
-
Constructor Details
-
SwtGatewayTray
protected SwtGatewayTray()
-
-
Method Details
-
initDisplay
public static void initDisplay() -
getFrameIcons
Return AWT Image icon for frame title.- Specified by:
getFrameIconsin interfaceDavGatewayTrayInterface- Returns:
- frame icon
-
switchIcon
public void switchIcon()Switch tray icon between active and standby icon.- Specified by:
switchIconin interfaceDavGatewayTrayInterface
-
resetIcon
public void resetIcon()Set tray icon to inactive (network down)- Specified by:
resetIconin interfaceDavGatewayTrayInterface
-
inactiveIcon
public void inactiveIcon()Set tray icon to inactive (network down)- Specified by:
inactiveIconin interfaceDavGatewayTrayInterface
-
isActive
public boolean isActive()Check if current tray status is inactive (network down).- Specified by:
isActivein interfaceDavGatewayTrayInterface- Returns:
- true if inactive
-
displayMessage
Log and display balloon message according to log level.- Specified by:
displayMessagein interfaceDavGatewayTrayInterface- Parameters:
message- text messagelevel- log level
-
loadSwtImage
Load image with current class loader. No scaling- Parameters:
fileName- image resource file name- Returns:
- image
-
loadSwtImage
Load image with current class loader. Scale to size- Parameters:
fileName- image resource file nametargetSize- 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:
initin interfaceDavGatewayTrayInterface
-
dispose
public void dispose()Description copied from interface:DavGatewayTrayInterfacedestroy frames- Specified by:
disposein interfaceDavGatewayTrayInterface
-