From 3927d4e8b76eeda78258188ef3aa286bb80a3050 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Tue, 20 Nov 2018 11:58:52 -0500 Subject: [PATCH] Remove Apple JDK 1.6 support. --- .../masterpassword/gui/util/Platform.java | 3 - .../gui/util/platform/ApplePlatform.java | 92 ------------------- 2 files changed, 95 deletions(-) delete mode 100644 platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/platform/ApplePlatform.java diff --git a/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/Platform.java b/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/Platform.java index 5a7b8029..a6ccd1d9 100644 --- a/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/Platform.java +++ b/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/Platform.java @@ -22,9 +22,6 @@ public final class Platform { if (null != (tryPlatform = construct( "com.lyndir.masterpassword.gui.util.platform.JDK9Platform" ))) activePlatform = tryPlatform; - else if (null != (tryPlatform = construct( "com.lyndir.masterpassword.gui.util.platform.ApplePlatform" ))) - activePlatform = tryPlatform; - else activePlatform = new BasePlatform(); } diff --git a/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/platform/ApplePlatform.java b/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/platform/ApplePlatform.java deleted file mode 100644 index acfb458f..00000000 --- a/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/platform/ApplePlatform.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.lyndir.masterpassword.gui.util.platform; - -import com.apple.eawt.*; -import com.apple.eio.FileManager; -import com.google.common.base.Preconditions; -import com.lyndir.lhunath.opal.system.logging.Logger; -import java.io.*; -import java.net.URI; - - -/** - * @author lhunath, 2018-07-29 - */ -public class ApplePlatform implements IPlatform { - - private static final Logger logger = Logger.get( ApplePlatform.class ); - private static final Application application = Preconditions.checkNotNull( - Application.getApplication(), "Not an Apple Java application." ); - - private AppForegroundListener appForegroundHandler; - private AppReOpenedListener appReopenHandler; - - @Override - public boolean installAppForegroundHandler(final Runnable handler) { - if (appForegroundHandler == null) - application.addAppEventListener( appForegroundHandler = new AppForegroundListener() { - @Override - public void appMovedToBackground(final AppEvent.AppForegroundEvent e) { - } - - @Override - public void appRaisedToForeground(final AppEvent.AppForegroundEvent e) { - handler.run(); - } - } ); - - return true; - } - - @Override - public boolean removeAppForegroundHandler() { - if (appForegroundHandler == null) - return false; - - application.removeAppEventListener( appForegroundHandler ); - return true; - } - - @Override - public boolean installAppReopenHandler(final Runnable handler) { - application.addAppEventListener( appReopenHandler = e -> handler.run() ); - return true; - } - - @Override - public boolean removeAppReopenHandler() { - if (appReopenHandler == null) - return false; - - application.removeAppEventListener( appReopenHandler ); - return true; - } - - @Override - public boolean requestForeground() { - application.requestForeground( true ); - return true; - } - - @Override - public boolean show(final File file) { - try { - return FileManager.revealInFinder( file ); - } - catch (final FileNotFoundException e) { - logger.err( e, "While showing: %s", file ); - return false; - } - } - - @Override - public boolean open(final URI url) { - try { - FileManager.openURL( url.toString() ); - return true; - } - catch (final IOException e) { - logger.err( e, "While opening: %s", url ); - return false; - } - } -}