502 p.activate();
503 providers.put(name, p);
504 }
505 }
506 } catch (java.util.ServiceConfigurationError | Exception e) {
507 newAWTError(e, "Could not load or activate service provider");
508 }
509 return null;
510 });
511 names.stream()
512 .filter(n -> !providers.containsKey(n))
513 .forEach(Toolkit::fallbackToLoadClassForAT);
514 }
515 }
516
517 /**
518 * Gets the default toolkit.
519 * <p>
520 * If a system property named {@code "java.awt.headless"} is set
521 * to {@code true} then the headless implementation
522 * of {@code Toolkit} is used.
523 * <p>
524 * If there is no {@code "java.awt.headless"} or it is set to
525 * {@code false} and there is a system property named
526 * {@code "awt.toolkit"},
527 * that property is treated as the name of a class that is a subclass
528 * of {@code Toolkit};
529 * otherwise the default platform-specific implementation of
530 * {@code Toolkit} is used.
531 * <p>
532 * If this Toolkit is not a headless implementation and if they exist, service
533 * providers of {@link javax.accessibility.AccessibilityProvider} will be loaded
534 * if specified by the system property
535 * {@code javax.accessibility.assistive_technologies}.
536 * <p>
537 * An example of setting this property is to invoke Java with
538 * {@code -Djavax.accessibility.assistive_technologies=MyServiceProvider}.
539 * In addition to MyServiceProvider other service providers can be specified
540 * using a comma separated list. Service providers are loaded after the AWT
541 * toolkit is created. All errors are handled via an AWTError exception.
542 * <p>
543 * The names specified in the assistive_technologies property are used to query
544 * each service provider implementation. If the requested name matches the
545 * {@linkplain AccessibilityProvider#getName name} of the service provider, the
546 * {@link AccessibilityProvider#activate} method will be invoked to activate the
547 * matching service provider.
548 *
|
502 p.activate();
503 providers.put(name, p);
504 }
505 }
506 } catch (java.util.ServiceConfigurationError | Exception e) {
507 newAWTError(e, "Could not load or activate service provider");
508 }
509 return null;
510 });
511 names.stream()
512 .filter(n -> !providers.containsKey(n))
513 .forEach(Toolkit::fallbackToLoadClassForAT);
514 }
515 }
516
517 /**
518 * Gets the default toolkit.
519 * <p>
520 * If a system property named {@code "java.awt.headless"} is set
521 * to {@code true} then the headless implementation
522 * of {@code Toolkit} is used,
523 * otherwise the default platform-specific implementation of
524 * {@code Toolkit} is used.
525 * <p>
526 * If this Toolkit is not a headless implementation and if they exist, service
527 * providers of {@link javax.accessibility.AccessibilityProvider} will be loaded
528 * if specified by the system property
529 * {@code javax.accessibility.assistive_technologies}.
530 * <p>
531 * An example of setting this property is to invoke Java with
532 * {@code -Djavax.accessibility.assistive_technologies=MyServiceProvider}.
533 * In addition to MyServiceProvider other service providers can be specified
534 * using a comma separated list. Service providers are loaded after the AWT
535 * toolkit is created. All errors are handled via an AWTError exception.
536 * <p>
537 * The names specified in the assistive_technologies property are used to query
538 * each service provider implementation. If the requested name matches the
539 * {@linkplain AccessibilityProvider#getName name} of the service provider, the
540 * {@link AccessibilityProvider#activate} method will be invoked to activate the
541 * matching service provider.
542 *
|