Class PlatformHookOsx
- All Implemented Interfaces:
PlatformHook
PlatformHook implementation for Apple macOS (formerly Mac OS X) systems.- Since:
- 1023
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openstreetmap.josm.tools.PlatformHook
PlatformHook.JavaExpirationCallback, PlatformHook.NativeOsCallback, PlatformHook.SanityCheckCallback -
Field Summary
FieldsFields inherited from interface org.openstreetmap.josm.tools.PlatformHook
CONSTRUCT_FROM_PLATFORM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe afterPrefStartupHook will be called early, but after the preferences have been loaded and basic processing of command line arguments is finished.private static voidprivate StringbooleanDetermines if the platform allows full-screen.static voidenableOSXFullscreen(Window window) Enables fullscreen support for the given window.Returns the platform-dependent default cache directory.Returns the platform-dependent default preferences directory.Returns the default LAF to be used on this platform to look almost as a native application.Returns the platform-dependent default user data directory.private static StringgetHome()Returns OS build number.Returns a detailed OS description (at least family + version).Get the platform corresponding to this platform hook.Returns theX509Certificatematching the given certificate amendment information.voidThe 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.booleanDetermines if HTML rendering is supported in menu tooltips.voidThe openURL hook will be used to open a URL in the default web browser.voidThe preStartupHook will be called extremely early.protected voidRegisters Apple handlers.voidRegisters the native OS callback.voidstartupHook(PlatformHook.JavaExpirationCallback javaCallback, PlatformHook.SanityCheckCallback sanityCheckCallback) The startupHook will be called early, but after the GUI setup has started.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.tools.PlatformHook
exec, getDefaultProj4NadshiftDirectories, getJavaUrl, getMenuShortcutKeyMaskEx, getPossiblePreferenceDirs, isOpenJDK, rename, resolveFileLink, startupSanityChecks, warnSoonToBeUnsupportedJava
-
Field Details
-
oSBuildNumber
-
osCallback
-
-
Constructor Details
-
PlatformHookOsx
public PlatformHookOsx()
-
-
Method Details
-
getPlatform
Description copied from interface:PlatformHookGet the platform corresponding to this platform hook.- Specified by:
getPlatformin interfacePlatformHook- Returns:
- the platform corresponding to this platform hook
-
afterPrefStartupHook
Description copied from interface:PlatformHookThe afterPrefStartupHook will be called early, but after the preferences have been loaded and basic processing of command line arguments is finished. It is guaranteed to be called before the GUI setup has started.- Specified by:
afterPrefStartupHookin interfacePlatformHook
-
preStartupHook
Description copied from interface:PlatformHookThe preStartupHook will be called extremely early. It is guaranteed to be called before the GUI setup has started.Reason: On OSX we need to inform the Swing libraries that we want to be integrated with the OS before we setup our GUI.
- Specified by:
preStartupHookin interfacePlatformHook
-
startupHook
public void startupHook(PlatformHook.JavaExpirationCallback javaCallback, PlatformHook.SanityCheckCallback sanityCheckCallback) Description copied from interface:PlatformHookThe startupHook will be called early, but after the GUI setup has started.Reason: On OSX we need to register some callbacks with the OS, so we'll receive events from the system menu.
- Specified by:
startupHookin interfacePlatformHook- Parameters:
javaCallback- Java expiration callback, providing GUI feedbacksanityCheckCallback- Sanity check callback, providing GUI feedback
-
isHtmlSupportedInMenuTooltips
Description copied from interface:PlatformHookDetermines if HTML rendering is supported in menu tooltips.- Specified by:
isHtmlSupportedInMenuTooltipsin interfacePlatformHook- Returns:
trueif HTML rendering is supported in menu tooltips
-
setHandlers
Registers Apple handlers. -
enableOSXFullscreen
Enables fullscreen support for the given window.- Parameters:
window- The window for which full screen will be available- Since:
- 7482
-
setNativeOsCallback
Description copied from interface:PlatformHookRegisters the native OS callback. Currently only needed for macOS.- Specified by:
setNativeOsCallbackin interfacePlatformHook- Parameters:
callback- the native OS callback
-
openUrl
Description copied from interface:PlatformHookThe openURL hook will be used to open a URL in the default web browser.- Specified by:
openUrlin interfacePlatformHook- Parameters:
url- The URL to open- Throws:
IOException- if any I/O error occurs
-
initSystemShortcuts
Description copied from interface:PlatformHookThe 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.Please note that you are not allowed to register any shortcuts from this hook, but only "systemCuts"!
BTW: SystemCuts should be named "system:<whatever>", and it'd be best if you'd recycle the names already used by the Windows and OSX hooks. Especially the latter has really many of them.
You should also register any and all shortcuts that the operating system handles itself to block JOSM from trying to use them---as that would just not work. Call setAutomatic on them to prevent the keyboard preferences from allowing the user to change them.
- Specified by:
initSystemShortcutsin interfacePlatformHook
-
auto
-
getHome
-
getDefaultStyle
Description copied from interface:PlatformHookReturns the default LAF to be used on this platform to look almost as a native application.- Specified by:
getDefaultStylein interfacePlatformHook- Returns:
- The default native LAF for this platform
-
canFullscreen
Description copied from interface:PlatformHookDetermines if the platform allows full-screen.- Specified by:
canFullscreenin interfacePlatformHook- Returns:
trueif full screen is allowed,falseotherwise
-
getOSDescription
Description copied from interface:PlatformHookReturns a detailed OS description (at least family + version).- Specified by:
getOSDescriptionin interfacePlatformHook- Returns:
- A detailed OS description.
-
buildOSBuildNumber
-
getOSBuildNumber
Description copied from interface:PlatformHookReturns OS build number.- Specified by:
getOSBuildNumberin interfacePlatformHook- Returns:
- OS build number.
-
getDefaultCacheDirectory
Description copied from interface:PlatformHookReturns the platform-dependent default cache directory.- Specified by:
getDefaultCacheDirectoryin interfacePlatformHook- Returns:
- the platform-dependent default cache directory
-
getDefaultPrefDirectory
Description copied from interface:PlatformHookReturns the platform-dependent default preferences directory.- Specified by:
getDefaultPrefDirectoryin interfacePlatformHook- Returns:
- the platform-dependent default preferences directory
-
getDefaultUserDataDirectory
Description copied from interface:PlatformHookReturns the platform-dependent default user data directory.- Specified by:
getDefaultUserDataDirectoryin interfacePlatformHook- Returns:
- the platform-dependent default user data directory
-
getX509Certificate
public X509Certificate getX509Certificate(CertificateAmendment.NativeCertAmend certAmend) throws IOException Description copied from interface:PlatformHookReturns theX509Certificatematching the given certificate amendment information.- Specified by:
getX509Certificatein interfacePlatformHook- Parameters:
certAmend- certificate amendment- Returns:
- the
X509Certificatematching the given certificate amendment information, ornull - Throws:
IOException- in case of error
-