public class PlatformHookOsx extends java.lang.Object implements PlatformHook, java.lang.reflect.InvocationHandler
PlatformHook
implementation for Apple Mac OS X systems.PlatformHook.JavaExpirationCallback, PlatformHook.NativeOsCallback
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
oSBuildNumber |
private PlatformHook.NativeOsCallback |
osCallback |
CONSTRUCT_FROM_PLATFORM
Constructor and Description |
---|
PlatformHookOsx() |
Modifier and Type | Method and Description |
---|---|
private static void |
auto(Shortcut sc) |
private java.lang.String |
buildOSBuildNumber() |
boolean |
canFullscreen()
Determines if the platform allows full-screen.
|
static void |
enableOSXFullscreen(java.awt.Window window)
Enables fullscreen support for the given window.
|
protected java.lang.Class<?> |
findHandlerClass(java.lang.String className)
Find Apple handler class in
com.apple.eawt or java.awt.desktop packages. |
java.io.File |
getDefaultCacheDirectory()
Returns the platform-dependent default cache directory.
|
java.io.File |
getDefaultPrefDirectory()
Returns the platform-dependent default preferences directory.
|
java.lang.String |
getDefaultStyle()
Returns the default LAF to be used on this platform to look almost as a native application.
|
java.io.File |
getDefaultUserDataDirectory()
Returns the platform-dependent default user data directory.
|
int |
getMenuShortcutKeyMaskEx()
Returns extended modifier key used as the appropriate accelerator key for menu shortcuts.
|
java.lang.String |
getOSBuildNumber()
Returns OS build number.
|
java.lang.String |
getOSDescription()
Returns a detailed OS description (at least family + version).
|
Platform |
getPlatform()
Get the platform corresponding to this platform hook.
|
java.security.cert.X509Certificate |
getX509Certificate(CertificateAmendment.NativeCertAmend certAmend)
Returns the
X509Certificate matching the given certificate amendment information. |
void |
initSystemShortcuts()
The initSystemShortcuts hook will be called by the
Shortcut class after the modifier groups have been read
from the config, but before any shortcuts are read from
it or registered from within the application.
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args) |
void |
openUrl(java.lang.String url)
The openURL hook will be used to open an URL in the
default web browser.
|
void |
preStartupHook()
The preStartupHook will be called extremely early.
|
protected void |
setHandlers(java.lang.Class<?> appClass,
java.lang.Class<?> quitHandler,
java.lang.Class<?> aboutHandler,
java.lang.Class<?> openFilesHandler,
java.lang.Class<?> preferencesHandler,
java.lang.Object proxy,
java.lang.Object appInstance)
Registers Apple handlers.
|
void |
setNativeOsCallback(PlatformHook.NativeOsCallback callback)
Registers the native OS callback.
|
void |
startupHook(PlatformHook.JavaExpirationCallback callback)
The startupHook will be called early, but after the GUI
setup has started.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterPrefStartupHook, checkExpiredJava, exec, getDefaultProj4NadshiftDirectories, getPossiblePreferenceDirs, isOpenJDK, rename, resolveFileLink, setupHttpsCertificate
private java.lang.String oSBuildNumber
private PlatformHook.NativeOsCallback osCallback
public PlatformHookOsx()
public Platform getPlatform()
PlatformHook
getPlatform
in interface PlatformHook
public void preStartupHook()
PlatformHook
preStartupHook
in interface PlatformHook
public void startupHook(PlatformHook.JavaExpirationCallback callback)
PlatformHook
startupHook
in interface PlatformHook
callback
- Java expiration callback, providing GUI feedbackpublic int getMenuShortcutKeyMaskEx()
PlatformHook
Toolkit.getMenuShortcutKeyMask()
to get the cross-platform modifier, but:
getMenuShortcutKeyMaskEx
in interface PlatformHook
protected void setHandlers(java.lang.Class<?> appClass, java.lang.Class<?> quitHandler, java.lang.Class<?> aboutHandler, java.lang.Class<?> openFilesHandler, java.lang.Class<?> preferencesHandler, java.lang.Object proxy, java.lang.Object appInstance) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
appClass
- application classquitHandler
- quit handler classaboutHandler
- about handler classopenFilesHandler
- open file handler classpreferencesHandler
- preferences handler classproxy
- proxyappInstance
- application instance (instance of appClass
)java.lang.IllegalAccessException
- in case of reflection errorjava.lang.reflect.InvocationTargetException
- in case of reflection errorjava.lang.NoSuchMethodException
- if any set*Handler
method cannot be foundprotected java.lang.Class<?> findHandlerClass(java.lang.String className) throws java.lang.ClassNotFoundException
com.apple.eawt
or java.awt.desktop
packages.className
- simple class namejava.lang.ClassNotFoundException
- if the handler class cannot be foundpublic static void enableOSXFullscreen(java.awt.Window window)
window
- The window for which full screen will be availablepublic void setNativeOsCallback(PlatformHook.NativeOsCallback callback)
PlatformHook
setNativeOsCallback
in interface PlatformHook
callback
- the native OS callbackpublic java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
invoke
in interface java.lang.reflect.InvocationHandler
java.lang.Throwable
public void openUrl(java.lang.String url) throws java.io.IOException
PlatformHook
openUrl
in interface PlatformHook
url
- The URL to openjava.io.IOException
- if any I/O error occurspublic void initSystemShortcuts()
PlatformHook
initSystemShortcuts
in interface PlatformHook
public java.lang.String getDefaultStyle()
PlatformHook
getDefaultStyle
in interface PlatformHook
public boolean canFullscreen()
PlatformHook
canFullscreen
in interface PlatformHook
true
if full screen is allowed, false
otherwisepublic java.lang.String getOSDescription()
PlatformHook
getOSDescription
in interface PlatformHook
private java.lang.String buildOSBuildNumber()
public java.lang.String getOSBuildNumber()
PlatformHook
getOSBuildNumber
in interface PlatformHook
public java.io.File getDefaultCacheDirectory()
PlatformHook
getDefaultCacheDirectory
in interface PlatformHook
public java.io.File getDefaultPrefDirectory()
PlatformHook
getDefaultPrefDirectory
in interface PlatformHook
public java.io.File getDefaultUserDataDirectory()
PlatformHook
getDefaultUserDataDirectory
in interface PlatformHook
public java.security.cert.X509Certificate getX509Certificate(CertificateAmendment.NativeCertAmend certAmend) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.io.IOException
PlatformHook
X509Certificate
matching the given certificate amendment information.getX509Certificate
in interface PlatformHook
certAmend
- certificate amendmentX509Certificate
matching the given certificate amendment information, or null
java.security.KeyStoreException
- in case of errorjava.security.NoSuchAlgorithmException
- in case of errorjava.security.cert.CertificateException
- in case of errorjava.io.IOException
- in case of error