Package esmska.utils
Class RuntimeUtils
- java.lang.Object
-
- esmska.utils.RuntimeUtils
-
public class RuntimeUtils extends java.lang.ObjectMethods for detecting current runtime environment (operating system, java version).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRuntimeUtils.OSTypeEnum of operating system types
-
Constructor Summary
Constructors Constructor Description RuntimeUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RuntimeUtils.OSTypedetectOS()Detect type of current OSstatic java.lang.StringgetSystemInfo()Get basic information about current system.static booleanisAppleJava()Checks whether the current Java implementation is Apple Javastatic booleanisGnome3Desktop()Check whether current desktop environment is Gnome 3.xstatic booleanisGnomeDesktop()Check whether current desktop environment is Gnomestatic booleanisKDEDesktop()Check whether current desktop environment is KDEstatic booleanisLinux()Check whether current OS is Linuxstatic booleanisMac()Check whether current OS is Macstatic booleanisOpenJDK()Checks whether the current Java implementation is OpenJDKstatic booleanisOracleJava()Checks whether the current Java implementation is Oracle Javastatic booleanisSupportedJava()Checks whether the current Java implementation is supported.static booleanisWindows()Check whether current OS is Windowsstatic voidsetDocumentModalDialog(javax.swing.JDialog dialog)Set dialog to be document modal and set property so it will look as native modal dialog on Mac (has no effect on other platforms).static <T> T[]sortDialogOptions(T... options)static <T> T[]sortOptions(T... options)
-
-
-
Method Detail
-
detectOS
public static RuntimeUtils.OSType detectOS()
Detect type of current OS- Returns:
- OS type
-
isLinux
public static boolean isLinux()
Check whether current OS is Linux
-
isMac
public static boolean isMac()
Check whether current OS is Mac
-
isWindows
public static boolean isWindows()
Check whether current OS is Windows
-
isGnomeDesktop
public static boolean isGnomeDesktop()
Check whether current desktop environment is Gnome
-
isKDEDesktop
public static boolean isKDEDesktop()
Check whether current desktop environment is KDE
-
isGnome3Desktop
public static boolean isGnome3Desktop()
Check whether current desktop environment is Gnome 3.x
-
isOracleJava
public static boolean isOracleJava()
Checks whether the current Java implementation is Oracle Java
-
isOpenJDK
public static boolean isOpenJDK()
Checks whether the current Java implementation is OpenJDK
-
isAppleJava
public static boolean isAppleJava()
Checks whether the current Java implementation is Apple Java
-
isSupportedJava
public static boolean isSupportedJava()
Checks whether the current Java implementation is supported. Currently supported and tested are: Oracle Java, OpenJDK, Apple Java
-
getSystemInfo
public static java.lang.String getSystemInfo()
Get basic information about current system. Useful for debugging print-outs.
-
sortDialogOptions
public static <T> T[] sortDialogOptions(T... options)
-
sortOptions
public static <T> T[] sortOptions(T... options)
-
setDocumentModalDialog
public static void setDocumentModalDialog(javax.swing.JDialog dialog)
Set dialog to be document modal and set property so it will look as native modal dialog on Mac (has no effect on other platforms). Also notifies Integration adapter about this event.- Parameters:
dialog- dialog which should be document modal and Mac native looking (only on Mac)
-
-