431 // Get the names of any assistive technologies to load. First
432 // check the system property and then check the properties
433 // file.
434 String classNames = System.getProperty("javax.accessibility.assistive_technologies");
435 if (classNames == null) {
436 classNames = properties.getProperty("assistive_technologies", null);
437 if (classNames != null) {
438 System.setProperty("javax.accessibility.assistive_technologies", classNames);
439 }
440 }
441 return classNames;
442 }
443 });
444 }
445
446 /**
447 * Rethrow the AWTError but include the cause.
448 *
449 * @param s the error message
450 * @param e the original exception
451 * @throw the new AWTError including the cause (the original exception)
452 */
453 private static void newAWTError(Throwable e, String s) {
454 AWTError newAWTError = new AWTError(s);
455 newAWTError.initCause(e);
456 throw newAWTError;
457 }
458
459 /**
460 * When a service provider for Assistive Technology is not found look for a
461 * supporting class on the class path and instantiate it.
462 *
463 * @param atName the name of the class to be loaded
464 */
465 private static void fallbackToLoadClassForAT(String atName) {
466 try {
467 Class.forName(atName, false, ClassLoader.getSystemClassLoader()).newInstance();
468 } catch (ClassNotFoundException e) {
469 newAWTError(e, "Assistive Technology not found: " + atName);
470 } catch (InstantiationException e) {
471 newAWTError(e, "Could not instantiate Assistive Technology: " + atName);
|
431 // Get the names of any assistive technologies to load. First
432 // check the system property and then check the properties
433 // file.
434 String classNames = System.getProperty("javax.accessibility.assistive_technologies");
435 if (classNames == null) {
436 classNames = properties.getProperty("assistive_technologies", null);
437 if (classNames != null) {
438 System.setProperty("javax.accessibility.assistive_technologies", classNames);
439 }
440 }
441 return classNames;
442 }
443 });
444 }
445
446 /**
447 * Rethrow the AWTError but include the cause.
448 *
449 * @param s the error message
450 * @param e the original exception
451 * @throws the new AWTError including the cause (the original exception)
452 */
453 private static void newAWTError(Throwable e, String s) {
454 AWTError newAWTError = new AWTError(s);
455 newAWTError.initCause(e);
456 throw newAWTError;
457 }
458
459 /**
460 * When a service provider for Assistive Technology is not found look for a
461 * supporting class on the class path and instantiate it.
462 *
463 * @param atName the name of the class to be loaded
464 */
465 private static void fallbackToLoadClassForAT(String atName) {
466 try {
467 Class.forName(atName, false, ClassLoader.getSystemClassLoader()).newInstance();
468 } catch (ClassNotFoundException e) {
469 newAWTError(e, "Assistive Technology not found: " + atName);
470 } catch (InstantiationException e) {
471 newAWTError(e, "Could not instantiate Assistive Technology: " + atName);
|