Package java.awt.im.spi

Examples of java.awt.im.spi.InputMethod


        // input context of the focused component
        InputMethodContext imc = IMManager.getLastActiveIMC();
        if (imc == null) {
            return;
        }
        InputMethod im = imc.getInputMethod();
        if (im instanceof NativeIM) {
            im.setLocale(hkl2Locale(lcid));
        }

    }
View Full Code Here


        if ((inputMethod != null) && inputMethod.setLocale(locale)) {
            return true;
        }
        // first
        // take last user-selected IM for locale           
        InputMethod newIM = localeIM.get(locale);
       
        // if not found search through IM descriptors
        // and take already created instance if exists
        // or create, store new IM instance in descriptor->instance map
        if (newIM == null) {
View Full Code Here

        }
        return null;
    }

    private InputMethod getIMInstance(InputMethodDescriptor imd) throws Exception {
        InputMethod im = imInstances.get(imd);
        if (im == null) {
            im = imd.createInputMethod();
            im.setInputMethodContext(this);
            imInstances.put(imd, im);
        }
        return im;
    }
View Full Code Here

        // input context of the focused component
        InputMethodContext imc = IMManager.getLastActiveIMC();
        if (imc == null) {
            return;
        }
        InputMethod im = imc.getInputMethod();
        if (im instanceof NativeIM) {
            im.setLocale(hkl2Locale(lcid));
        }

    }
View Full Code Here

        if ((inputMethod != null) && inputMethod.setLocale(locale)) {
            return true;
        }
        // first
        // take last user-selected IM for locale           
        InputMethod newIM = localeIM.get(locale);
       
        // if not found search through IM descriptors
        // and take already created instance if exists
        // or create, store new IM instance in descriptor->instance map
        if (newIM == null) {
View Full Code Here

        }
        return null;
    }

    private InputMethod getIMInstance(InputMethodDescriptor imd) throws Exception {
        InputMethod im = imInstances.get(imd);
        if (im == null) {
            im = imd.createInputMethod();
            im.setInputMethodContext(this);
            imInstances.put(imd, im);
        }
        return im;
    }
View Full Code Here

    if (im != null && im.setLocale(locale))
      {
        recent.put(locale, im);
        return true;
      }
    InputMethod next = recent.get(locale);
    if (next != null)
      for (int i = 0, limit = descriptors.size(); i < limit; i++)
        {
          InputMethodDescriptor d = descriptors.get(i);
          Locale[] list;
          try
            {
              list = d.getAvailableLocales();
            }
          catch (AWTException ignored)
            {
              continue;
            }
          for (int j = list.length; --j >= 0; )
            if (locale.equals(list[j]))
              {
                try
                  {
                    next = d.createInputMethod();
                    recent.put(locale, next);
                  }
                catch (Exception ignored)
                  {
                    continue;
                  }
              }
        }
    if (next == null)
      return false;
    // XXX I'm not sure if this does all the necessary steps in the switch.
    if (im != null)
      {
        try
          {
            next.setCompositionEnabled(im.isCompositionEnabled());
          }
        catch (UnsupportedOperationException ignored)
          {
          }
        im.endComposition();
View Full Code Here

TOP

Related Classes of java.awt.im.spi.InputMethod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.