Class Library


  • public class Library
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int JAVA_VERSION
      The JAVA and SWT versions
      static int SWT_VERSION
      The JAVA and SWT versions
      static java.lang.String USER_HOME  
    • Constructor Summary

      Constructors 
      Constructor Description
      Library()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getVersionString()  
      static int JAVA_VERSION​(int major, int minor, int micro)
      Returns the Java version number as an integer.
      static void loadLibrary​(java.lang.String name)
      Loads the shared library that matches the version of the Java code which is currently running.
      static void loadLibrary​(java.lang.String name, boolean mapName)
      Loads the shared library that matches the version of the Java code which is currently running.
      static int SWT_VERSION​(int major, int minor)
      Returns the SWT version number as an integer.
      • Methods inherited from class java.lang.Object

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

      • JAVA_VERSION

        public static final int JAVA_VERSION
        The JAVA and SWT versions
      • SWT_VERSION

        public static final int SWT_VERSION
        The JAVA and SWT versions
      • USER_HOME

        public static final java.lang.String USER_HOME
    • Constructor Detail

      • Library

        public Library()
    • Method Detail

      • JAVA_VERSION

        public static int JAVA_VERSION​(int major,
                                       int minor,
                                       int micro)
        Returns the Java version number as an integer.
        Parameters:
        major -
        minor -
        micro -
        Returns:
        the version
      • SWT_VERSION

        public static int SWT_VERSION​(int major,
                                      int minor)
        Returns the SWT version number as an integer.
        Parameters:
        major -
        minor -
        Returns:
        the version
      • loadLibrary

        public static void loadLibrary​(java.lang.String name)
        Loads the shared library that matches the version of the Java code which is currently running. SWT shared libraries follow an encoding scheme where the major, minor and revision numbers are embedded in the library name and this along with name is used to load the library. If this fails, name is used in another attempt to load the library, this time ignoring the SWT version encoding scheme.
        Parameters:
        name - the name of the library to load
      • loadLibrary

        public static void loadLibrary​(java.lang.String name,
                                       boolean mapName)
        Loads the shared library that matches the version of the Java code which is currently running. SWT shared libraries follow an encoding scheme where the major, minor and revision numbers are embedded in the library name and this along with name is used to load the library. If this fails, name is used in another attempt to load the library, this time ignoring the SWT version encoding scheme.
        Parameters:
        name - the name of the library to load
        mapName - true if the name should be mapped, false otherwise
      • getVersionString

        public static java.lang.String getVersionString()
        Returns:
        String Combined SWT version like 4826