Package esmska.utils

Class RuntimeUtils


  • public class RuntimeUtils
    extends java.lang.Object
    Methods for detecting current runtime environment (operating system, java version).
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  RuntimeUtils.OSType
      Enum 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.OSType detectOS()
      Detect type of current OS
      static java.lang.String getSystemInfo()
      Get basic information about current system.
      static boolean isAppleJava()
      Checks whether the current Java implementation is Apple Java
      static boolean isGnome3Desktop()
      Check whether current desktop environment is Gnome 3.x
      static boolean isGnomeDesktop()
      Check whether current desktop environment is Gnome
      static boolean isKDEDesktop()
      Check whether current desktop environment is KDE
      static boolean isLinux()
      Check whether current OS is Linux
      static boolean isMac()
      Check whether current OS is Mac
      static boolean isOpenJDK()
      Checks whether the current Java implementation is OpenJDK
      static boolean isOracleJava()
      Checks whether the current Java implementation is Oracle Java
      static boolean isSupportedJava()
      Checks whether the current Java implementation is supported.
      static boolean isWindows()
      Check whether current OS is Windows
      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).
      static <T> T[] sortDialogOptions​(T... options)  
      static <T> T[] sortOptions​(T... options)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RuntimeUtils

        public RuntimeUtils()
    • 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)