/** * Outputs a printable representation of this exception's * stack trace on the standard error stream. * <p> * Note: printStackTrace(PrintStream) and printStackTrace(PrintWriter) * are not provided in order to maintain compatibility with CLDC. * </p> */ public void printStackTrace () { super.printStackTrace (); if (Library.JAVA_VERSION < Library.JAVA_VERSION(1, 4, 0) && throwable != null) { System.err.println ("*** Stack trace of contained exception ***"); //$NON-NLS-1$ throwable.printStackTrace (); } }
public static boolean isLoadable () { return Library.isLoadable (); }
/** * 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 * <code>name</code> is used to load the library. If this fails, * <code>name</code> is used in another attempt to load the library, * this time ignoring the SWT version encoding scheme. * * @param name the name of the library to load */ public static void loadLibrary (String name) { loadLibrary (name, true); }
mappedName1 = mapLibraryName (libName1); mappedName2 = mapLibraryName (libName2); } else { libName1 = libName2 = mappedName1 = mappedName2 = name; if (path != null) { path = new File (path).getAbsolutePath (); if (load (path + SEPARATOR + mappedName1, message)) return; if (mapName && load (path + SEPARATOR + mappedName2, message)) return; if (load (libName1, message)) return; if (mapName && load (libName2, message)) return; fileName1 = mapLibraryName (libName1 + SUFFIX_64); fileName2 = mapLibraryName (libName2 + SUFFIX_64); if (load (path + SEPARATOR + fileName1, message)) return; if (mapName && load (path + SEPARATOR + fileName2, message)) return; if (extract (path + SEPARATOR + fileName1, mappedName1, message)) return; if (mapName && extract (path + SEPARATOR + fileName2, mappedName2, message)) return;
mappedName1 = mapLibraryName (libName1); mappedName2 = mapLibraryName (libName2); } else { libName1 = libName2 = mappedName1 = mappedName2 = name; if (path != null) { path = new File (path).getAbsolutePath (); if (load (path + SEPARATOR + mappedName1, message)) return; if (mapName && load (path + SEPARATOR + mappedName2, message)) return; if (load (libName1, message)) return; if (mapName && load (libName2, message)) return; fileName1 = mapLibraryName (libName1 + SUFFIX_64); fileName2 = mapLibraryName (libName2 + SUFFIX_64); if (load (path + SEPARATOR + fileName1, message)) return; if (mapName && load (path + SEPARATOR + fileName2, message)) return; if (extract (path + SEPARATOR + fileName1, mappedName1, message)) return; if (mapName && extract (path + SEPARATOR + fileName2, mappedName2, message)) return;
mappedName1 = mapLibraryName (libName1); mappedName2 = mapLibraryName (libName2); } else { libName1 = libName2 = mappedName1 = mappedName2 = name; if (path != null) { path = new File (path).getAbsolutePath (); if (load (path + SEPARATOR + mappedName1, message)) return; if (mapName && load (path + SEPARATOR + mappedName2, message)) return; if (load (libName1, message)) return; if (mapName && load (libName2, message)) return; fileName1 = mapLibraryName (libName1 + SUFFIX_64); fileName2 = mapLibraryName (libName2 + SUFFIX_64); if (load (path + SEPARATOR + fileName1, message)) return; if (mapName && load (path + SEPARATOR + fileName2, message)) return; if (extract (path + SEPARATOR + fileName1, mappedName1, message)) return; if (mapName && extract (path + SEPARATOR + fileName2, mappedName2, message)) return;
/** * 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 * <code>name</code> is used to load the library. If this fails, * <code>name</code> is used in another attempt to load the library, * this time ignoring the SWT version encoding scheme. * * @param name the name of the library to load */ public static void loadLibrary (String name) { loadLibrary (name, true); }
/** * Outputs a printable representation of this error's * stack trace on the standard error stream. * <p> * Note: printStackTrace(PrintStream) and printStackTrace(PrintWriter) * are not provided in order to maintain compatibility with CLDC. * </p> */ public void printStackTrace () { super.printStackTrace (); if (Library.JAVA_VERSION < Library.JAVA_VERSION(1, 4, 0) && throwable != null) { System.err.println ("*** Stack trace of contained error ***"); //$NON-NLS-1$ throwable.printStackTrace (); } }
public static boolean isLoadable () { return Library.isLoadable (); }
mappedName1 = mapLibraryName (libName1); mappedName2 = mapLibraryName (libName2); } else { libName1 = libName2 = mappedName1 = mappedName2 = name; if (path != null) { path = new File (path).getAbsolutePath (); if (load (path + SEPARATOR + mappedName1, message)) return; if (mapName && load (path + SEPARATOR + mappedName2, message)) return; if (load (libName1, message)) return; if (mapName && load (libName2, message)) return; fileName1 = mapLibraryName (libName1 + SUFFIX_64); fileName2 = mapLibraryName (libName2 + SUFFIX_64); if (load (path + SEPARATOR + fileName1, message)) return; if (mapName && load (path + SEPARATOR + fileName2, message)) return; if (extract (path + SEPARATOR + fileName1, mappedName1, message)) return; if (mapName && extract (path + SEPARATOR + fileName2, mappedName2, message)) return;
/** * 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 * <code>name</code> is used to load the library. If this fails, * <code>name</code> is used in another attempt to load the library, * this time ignoring the SWT version encoding scheme. * * @param name the name of the library to load */ public static void loadLibrary (String name) { loadLibrary (name, true); }
static int parseVersion(String version) { if (version == null) return 0; int major = 0, minor = 0, micro = 0; int length = version.length(), index = 0, start = 0; while (index < length && Character.isDigit(version.charAt(index))) index++; try { if (start < length) major = Integer.parseInt(version.substring(start, index)); } catch (NumberFormatException e) {} start = ++index; while (index < length && Character.isDigit(version.charAt(index))) index++; try { if (start < length) minor = Integer.parseInt(version.substring(start, index)); } catch (NumberFormatException e) {} start = ++index; while (index < length && Character.isDigit(version.charAt(index))) index++; try { if (start < length) micro = Integer.parseInt(version.substring(start, index)); } catch (NumberFormatException e) {} return JAVA_VERSION(major, minor, micro); }