Class PlatformFactory


  • public class PlatformFactory
    extends java.lang.Object
    PlatformFactory creates a Platform instance corresponding with the current platform.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private PlatformFactory()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private Platform createPlatform()
      Tries to determine the platform we're running on based on Java system properties and/or environment variables.
      static PlatformFactory getInstance()
      Returns the Platform instance corresponding with the current platform.
      static Platform getPlatform()
      Returns the Platform instance corresponding with the current platform.
      private java.lang.String getSystemEnv​(java.lang.String propertyName)
      Get system environment variable
      private boolean isGnome()
      Detect gnome environments.
      private boolean isKDE()
      Detect KDE environments.
      static void main​(java.lang.String[] args)
      Main
      • Methods inherited from class java.lang.Object

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

      • platform

        public final Platform platform
      • logger

        private final org.slf4j.Logger logger
    • Constructor Detail

      • PlatformFactory

        private PlatformFactory()
    • Method Detail

      • getInstance

        public static PlatformFactory getInstance()
        Returns the Platform instance corresponding with the current platform.
        Returns:
        factory
      • getPlatform

        public static Platform getPlatform()
        Returns the Platform instance corresponding with the current platform.
      • createPlatform

        private Platform createPlatform()
        Tries to determine the platform we're running on based on Java system properties and/or environment variables. See http://lopica.sourceforge.net/os.html for an overview.
      • isGnome

        private boolean isGnome()
        Detect gnome environments.
        Returns:
        true when Gnome session
      • isKDE

        private boolean isKDE()
        Detect KDE environments.
        Returns:
        true when KDE
      • getSystemEnv

        private java.lang.String getSystemEnv​(java.lang.String propertyName)
        Get system environment variable
        Parameters:
        propertyName -
        Returns:
        system environment variable
      • main

        public static void main​(java.lang.String[] args)
        Main
        Parameters:
        args - arguments