mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-05 18:58:02 -05:00
Java 7 fixed tray icon support => drop SWT on Java 7
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1995 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
711c621113
commit
1890dcdbfd
@ -225,16 +225,18 @@ public final class DavGatewayTray {
|
||||
*/
|
||||
public static void init() {
|
||||
if (!Settings.getBooleanProperty("davmail.server")) {
|
||||
// first try to load SWT before with Java
|
||||
ClassLoader classloader = DavGatewayTray.class.getClassLoader();
|
||||
try {
|
||||
// trigger ClassNotFoundException
|
||||
classloader.loadClass("org.eclipse.swt.SWT");
|
||||
// SWT available, create tray
|
||||
davGatewayTray = new SwtGatewayTray();
|
||||
davGatewayTray.init();
|
||||
} catch (ClassNotFoundException e) {
|
||||
DavGatewayTray.info(new BundleMessage("LOG_SWT_NOT_AVAILABLE"));
|
||||
// first try to load SWT before with Java, except on 1.7
|
||||
if (System.getProperty("java.version").compareTo("1.7") < 0) {
|
||||
ClassLoader classloader = DavGatewayTray.class.getClassLoader();
|
||||
try {
|
||||
// trigger ClassNotFoundException
|
||||
classloader.loadClass("org.eclipse.swt.SWT");
|
||||
// SWT available, create tray
|
||||
davGatewayTray = new SwtGatewayTray();
|
||||
davGatewayTray.init();
|
||||
} catch (ClassNotFoundException e) {
|
||||
DavGatewayTray.info(new BundleMessage("LOG_SWT_NOT_AVAILABLE"));
|
||||
}
|
||||
}
|
||||
// try java6 tray support
|
||||
if (davGatewayTray == null) {
|
||||
|
@ -35,6 +35,7 @@ import java.awt.image.RenderedImage;
|
||||
/**
|
||||
* Extended Awt tray with OSX extensions.
|
||||
*/
|
||||
@SuppressWarnings("Since15")
|
||||
public class OSXAwtGatewayTray extends AwtGatewayTray {
|
||||
protected static final String OSX_TRAY_ACTIVE_PNG = "osxtray2.png";
|
||||
protected static final String OSX_TRAY_PNG = "osxtray.png";
|
||||
|
Loading…
Reference in New Issue
Block a user