Class Library

java.lang.Object
org.eclipse.swt.internal.Library

public class Library extends Object
  • Field Details

    • MAJOR_VERSION

      static int MAJOR_VERSION
      SWT Major version number (must be >= 0)
    • MINOR_VERSION

      static int MINOR_VERSION
      SWT Minor version number (must be in the range 0..999)
    • REVISION

      static int REVISION
      SWT revision number (must be >= 0)
    • 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 String USER_HOME
    • SEPARATOR

      static final String SEPARATOR
    • DELIMITER

      static final String DELIMITER
    • JAVA_LIB_PATH

      static final String JAVA_LIB_PATH
      See Also:
    • SWT_LIB_PATH

      static final String SWT_LIB_PATH
      See Also:
    • SUFFIX_64

      static final String SUFFIX_64
      See Also:
    • SWT_LIB_DIR

      static final String SWT_LIB_DIR
  • Constructor Details

    • Library

      public Library()
  • Method Details

    • arch

      static String arch()
    • os

      static String os()
    • chmod

      static void chmod(String permision, String path)
    • longConst

      static long longConst()
    • parseVersion

      static int parseVersion(String version)
    • JAVA_VERSION

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

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

      private static boolean extractResource(String resourceName, File outFile)
    • extract

      static boolean extract(String extractToFilePath, String mappedName)
      Extract file with 'mappedName' into path 'extractToFilePath'. Does not overwrite existing file. Does not leave trash on error.
      Parameters:
      extractToFilePath - full path of where the file is to be extacted to, inc name of file, e.g /home/USER/.swt/lib/linux/x86_64/libswt-MYLIB-gtk-4826.so
      mappedName - file to be searched in jar.
      Returns:
      true upon success, failure if something went wrong.
    • isLoadable

      static boolean isLoadable()
    • load

      static boolean load(String libName, StringBuilder message)
    • loadLibrary

      public static void loadLibrary(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(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
    • mapLibraryName

      static String mapLibraryName(String libName)
    • mapLibraryName

      static String mapLibraryName(String libName, boolean replaceDylib)
    • getVersionString

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