src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java

Print this page
rev 11100 : 8062588: Support java.util.spi.*, java.text.spi.*, java.awt.im.spi loaded from classpath
Reviewed-by:


 242     private synchronized void waitForChangeRequest() {
 243         try {
 244             while (requestComponent == null) {
 245                 wait();
 246             }
 247         } catch (InterruptedException e) {
 248         }
 249     }
 250 
 251     /*
 252      * initializes the input method locator list for all
 253      * installed input method descriptors.
 254      */
 255     private void initializeInputMethodLocatorList() {
 256         synchronized (javaInputMethodLocatorList) {
 257             javaInputMethodLocatorList.clear();
 258             try {
 259                 AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
 260                     public Object run() {
 261                         for (InputMethodDescriptor descriptor :
 262                             ServiceLoader.loadInstalled(InputMethodDescriptor.class)) {
 263                             ClassLoader cl = descriptor.getClass().getClassLoader();
 264                             javaInputMethodLocatorList.add(new InputMethodLocator(descriptor, cl, null));
 265                         }
 266                         return null;
 267                     }
 268                 });
 269             }  catch (PrivilegedActionException e) {
 270                 e.printStackTrace();
 271             }
 272             javaInputMethodCount = javaInputMethodLocatorList.size();
 273         }
 274 
 275         if (hasMultipleInputMethods()) {
 276             // initialize preferences
 277             if (userRoot == null) {
 278                 userRoot = getUserRoot();
 279             }
 280         } else {
 281             // indicate to clients not to offer the menu
 282             triggerMenuString = null;




 242     private synchronized void waitForChangeRequest() {
 243         try {
 244             while (requestComponent == null) {
 245                 wait();
 246             }
 247         } catch (InterruptedException e) {
 248         }
 249     }
 250 
 251     /*
 252      * initializes the input method locator list for all
 253      * installed input method descriptors.
 254      */
 255     private void initializeInputMethodLocatorList() {
 256         synchronized (javaInputMethodLocatorList) {
 257             javaInputMethodLocatorList.clear();
 258             try {
 259                 AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
 260                     public Object run() {
 261                         for (InputMethodDescriptor descriptor :
 262                             ServiceLoader.load(InputMethodDescriptor.class)) {
 263                             ClassLoader cl = descriptor.getClass().getClassLoader();
 264                             javaInputMethodLocatorList.add(new InputMethodLocator(descriptor, cl, null));
 265                         }
 266                         return null;
 267                     }
 268                 });
 269             }  catch (PrivilegedActionException e) {
 270                 e.printStackTrace();
 271             }
 272             javaInputMethodCount = javaInputMethodLocatorList.size();
 273         }
 274 
 275         if (hasMultipleInputMethods()) {
 276             // initialize preferences
 277             if (userRoot == null) {
 278                 userRoot = getUserRoot();
 279             }
 280         } else {
 281             // indicate to clients not to offer the menu
 282             triggerMenuString = null;