Package org.eclipse.swt.internal
Class Library
java.lang.Object
org.eclipse.swt.internal.Library
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The JAVA and SWT versionsstatic final int
The JAVA and SWT versionsstatic final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic File
findResource
(String subDir, String resourceName, boolean mapResourceName) Locates a resource located either in java library path, swt library path, or attempts to extract it from inside swt.jar file.static String
static int
JAVA_VERSION
(int major, int minor, int micro) Returns the Java version number as an integer.static void
loadLibrary
(String name) Loads the shared library that matches the version of the Java code which is currently running.static void
loadLibrary
(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.
-
Field Details
-
JAVA_VERSION
public static final int JAVA_VERSIONThe JAVA and SWT versions -
SWT_VERSION
public static final int SWT_VERSIONThe JAVA and SWT versions -
USER_HOME
-
-
Constructor Details
-
Library
public Library()
-
-
Method Details
-
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
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 withname
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
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 withname
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 loadmapName
- true if the name should be mapped, false otherwise
-
getVersionString
- Returns:
- String Combined SWT version like 4826
-
findResource
Locates a resource located either in java library path, swt library path, or attempts to extract it from inside swt.jar file. This function supports a single level subfolder, e.g SubFolder/resource. Dev note: (17/12/07) This has been developed and throughly tested on GTK. Designed to work on Cocoa/Win as well, but not tested.- Parameters:
subDir
- 'null' or a folder name without slashes. E.g Correct: 'mysubdir', incorrect: '/subdir/'. Platform specific Slashes will be added automatically.resourceName
- e.g swt-webkitgtkmapResourceName
- true if you like platform specific mapping applied to resource name. e.g MyLib -> libMyLib-gtk-4826.so
-