jdk/src/share/classes/sun/awt/im/InputContext.java
changeset 3938 ef327bd847c0
parent 1311 2b1552286d23
child 5506 202f599c92aa
equal deleted inserted replaced
3934:487e1aa949c4 3938:ef327bd847c0
    48 import java.security.PrivilegedAction;
    48 import java.security.PrivilegedAction;
    49 import java.text.MessageFormat;
    49 import java.text.MessageFormat;
    50 import java.util.HashMap;
    50 import java.util.HashMap;
    51 import java.util.Iterator;
    51 import java.util.Iterator;
    52 import java.util.Locale;
    52 import java.util.Locale;
    53 import java.util.logging.*;
       
    54 import java.util.prefs.BackingStoreException;
    53 import java.util.prefs.BackingStoreException;
    55 import java.util.prefs.Preferences;
    54 import java.util.prefs.Preferences;
       
    55 import sun.util.logging.PlatformLogger;
    56 import sun.awt.SunToolkit;
    56 import sun.awt.SunToolkit;
    57 
    57 
    58 /**
    58 /**
    59  * This InputContext class contains parts of the implementation of
    59  * This InputContext class contains parts of the implementation of
    60  * java.text.im.InputContext. These parts have been moved
    60  * java.text.im.InputContext. These parts have been moved
    65  * @author JavaSoft Asia/Pacific
    65  * @author JavaSoft Asia/Pacific
    66  */
    66  */
    67 
    67 
    68 public class InputContext extends java.awt.im.InputContext
    68 public class InputContext extends java.awt.im.InputContext
    69                           implements ComponentListener, WindowListener {
    69                           implements ComponentListener, WindowListener {
    70     private static final Logger log = Logger.getLogger("sun.awt.im.InputContext");
    70     private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.im.InputContext");
    71     // The current input method is represented by two objects:
    71     // The current input method is represented by two objects:
    72     // a locator is used to keep information about the selected
    72     // a locator is used to keep information about the selected
    73     // input method and locale until we actually need a real input
    73     // input method and locale until we actually need a real input
    74     // method; only then the input method itself is created.
    74     // method; only then the input method itself is created.
    75     // Once there is an input method, the input method's locale
    75     // Once there is an input method, the input method's locale
   384                 // new input method
   384                 // new input method
   385                 ((InputMethodAdapter) previousInputMethod).stopListening();
   385                 ((InputMethodAdapter) previousInputMethod).stopListening();
   386             }
   386             }
   387             previousInputMethod = null;
   387             previousInputMethod = null;
   388 
   388 
   389             if (log.isLoggable(Level.FINE)) log.fine("Current client component " + currentClientComponent);
   389             if (log.isLoggable(PlatformLogger.FINE)) log.fine("Current client component " + currentClientComponent);
   390             if (inputMethod instanceof InputMethodAdapter) {
   390             if (inputMethod instanceof InputMethodAdapter) {
   391                 ((InputMethodAdapter) inputMethod).setClientComponent(currentClientComponent);
   391                 ((InputMethodAdapter) inputMethod).setClientComponent(currentClientComponent);
   392             }
   392             }
   393             inputMethod.activate();
   393             inputMethod.activate();
   394             isInputMethodActive = true;
   394             isInputMethodActive = true;
   887                                                      "Could not create {0}. Reason: {1}");
   887                                                      "Could not create {0}. Reason: {1}");
   888         Object[] args =
   888         Object[] args =
   889             {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
   889             {inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
   890              throwable.getLocalizedMessage()};
   890              throwable.getLocalizedMessage()};
   891         MessageFormat mf = new MessageFormat(errorTextFormat);
   891         MessageFormat mf = new MessageFormat(errorTextFormat);
   892         Logger logger = Logger.getLogger("sun.awt.im");
   892         PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im");
   893         logger.config(mf.format(args));
   893         logger.config(mf.format(args));
   894     }
   894     }
   895 
   895 
   896     InputMethodLocator getInputMethodLocator() {
   896     InputMethodLocator getInputMethodLocator() {
   897         if (inputMethod != null) {
   897         if (inputMethod != null) {