Class PlatformHookUnixoid
- All Implemented Interfaces:
PlatformHook
PlatformHook implementation for Unix systems.- Since:
- 1023
-
Nested Class Summary
Nested ClassesNested 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 TypeMethodDescriptionprivate StringGet the Gnome ATK wrapper package name including detailed version.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.Returns desktop environment based on the environment variableXDG_CURRENT_DESKTOP.private static FileGet the dot directory~/.josm.Get the Java package name including detailed version.Returns a detailed OS description (at least family + version).static StringgetPackageDetails(String... packageNames) Get the package name including detailed version.Get the platform corresponding to this platform hook.Returns a set of possible platform specific directories where resources could be stored.Get the Web Start package name including detailed version.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.static booleanDetermines if the distribution is Debian or Ubuntu, or a derivative.voidThe openURL hook will be used to open a URL in the default web browser.voidThe preStartupHook will be called extremely early.voidstartupHook(PlatformHook.JavaExpirationCallback javaCallback, PlatformHook.SanityCheckCallback sanityCheckCallback) The startupHook will be called early, but after the GUI setup has started.private static booleanReturns true if the dot directory should be used for storing preferences, cache and user data.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
afterPrefStartupHook, canFullscreen, exec, getDefaultProj4NadshiftDirectories, getJavaUrl, getMenuShortcutKeyMaskEx, getOSBuildNumber, isHtmlSupportedInMenuTooltips, isOpenJDK, rename, resolveFileLink, setNativeOsCallback, startupSanityChecks, warnSoonToBeUnsupportedJava
-
Field Details
-
osDescription
-
-
Constructor Details
-
PlatformHookUnixoid
public PlatformHookUnixoid()
-
-
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
-
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
-
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
-
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
-
getDesktopEnvironment
Returns desktop environment based on the environment variableXDG_CURRENT_DESKTOP.- Returns:
- desktop environment.
-
isDebianOrUbuntu
Determines if the distribution is Debian or Ubuntu, or a derivative.- Returns:
trueif the distribution is Debian, Ubuntu or Mint,falseotherwise
-
getPackageDetails
Get the package name including detailed version.- Parameters:
packageNames- The possible package names (when a package can have different names on different distributions)- Returns:
- The package name and package version if it can be identified, null otherwise
- Since:
- 7314
-
getJavaPackageDetails
Get the Java package name including detailed version.Some Java bugs are specific to a certain security update, so in addition to the Java version, we also need the exact package version.
- Returns:
- The package name and package version if it can be identified, null otherwise
-
getWebStartPackageDetails
Get the Web Start package name including detailed version.OpenJDK packages are shipped with icedtea-web package, but its version generally does not match main java package version.
Simply return
nullif there's no separate package for Java WebStart.- Returns:
- The package name and package version if it can be identified, null otherwise
-
getAtkWrapperPackageDetails
Get the Gnome ATK wrapper package name including detailed version.Debian and Ubuntu derivatives come with a pre-enabled accessibility software completely buggy that makes Swing crash in a lot of different ways.
Simply return
nullif it's not found.- Returns:
- The package name and package version if it can be identified, null otherwise
-
buildOSDescription
-
getOSDescription
Description copied from interface:PlatformHookReturns a detailed OS description (at least family + version).- Specified by:
getOSDescriptionin interfacePlatformHook- Returns:
- A detailed OS description.
-
getDotDirectory
Get the dot directory~/.josm.- Returns:
- the dot directory
-
useDotDirectory
Returns true if the dot directory should be used for storing preferences, cache and user data. Currently this is the case, if the dot directory already exists.- Returns:
- true if the dot directory should be used
-
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 KeyStoreException, NoSuchAlgorithmException, CertificateException, 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:
KeyStoreException- in case of errorNoSuchAlgorithmException- in case of errorCertificateException- in case of errorIOException- in case of error
-
getPossiblePreferenceDirs
Description copied from interface:PlatformHookReturns a set of possible platform specific directories where resources could be stored.- Specified by:
getPossiblePreferenceDirsin interfacePlatformHook- Returns:
- A set of possible platform specific directories where resources could be stored.
-