当前位置: 首页>>代码示例>>Java>>正文


Java InputMethodSupport类代码示例

本文整理汇总了Java中sun.awt.InputMethodSupport的典型用法代码示例。如果您正苦于以下问题:Java InputMethodSupport类的具体用法?Java InputMethodSupport怎么用?Java InputMethodSupport使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InputMethodSupport类属于sun.awt包,在下文中一共展示了InputMethodSupport类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createInputMethodWindow

import sun.awt.InputMethodSupport; //导入依赖的package包/类
static Window createInputMethodWindow(String title, InputContext context, boolean isSwing) {
    if (GraphicsEnvironment.isHeadless()) {
        throw new HeadlessException();
    }
    if (isSwing) {
        return new InputMethodJFrame(title, context);
    } else {
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        if (toolkit instanceof InputMethodSupport) {
            return ((InputMethodSupport)toolkit).createInputMethodWindow(
                title, context);
        }
    }
    throw new InternalError("Input methods must be supported");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:InputMethodContext.java

示例2: enableInputMethodsIfNecessary

import sun.awt.InputMethodSupport; //导入依赖的package包/类
private void enableInputMethodsIfNecessary() {
    if (checkForEnableIM) {
        checkForEnableIM = false;
        try {
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            boolean shouldEnable = false;
            if (toolkit instanceof InputMethodSupport) {
                shouldEnable = ((InputMethodSupport)toolkit)
                  .enableInputMethodsForTextComponent();
            }
            enableInputMethods(shouldEnable);
        } catch (Exception e) {
            // if something bad happens, just don't enable input methods
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:TextComponent.java

示例3: ExecutableInputMethodManager

import sun.awt.InputMethodSupport; //导入依赖的package包/类
ExecutableInputMethodManager() {

        // set up host adapter locator
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        try {
            if (toolkit instanceof InputMethodSupport) {
                InputMethodDescriptor hostAdapterDescriptor =
                    ((InputMethodSupport)toolkit)
                    .getInputMethodAdapterDescriptor();
                if (hostAdapterDescriptor != null) {
                    hostAdapterLocator = new InputMethodLocator(hostAdapterDescriptor, null, null);
                }
            }
        } catch (AWTException e) {
            // if we can't get a descriptor, we'll just have to do without native input methods
        }

        javaInputMethodLocatorList = new Vector<InputMethodLocator>();
        initializeInputMethodLocatorList();
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:ExecutableInputMethodManager.java

示例4: enableInputMethodsIfNecessary

import sun.awt.InputMethodSupport; //导入依赖的package包/类
private void enableInputMethodsIfNecessary() {
if (checkForEnableIM) {
           checkForEnableIM = false;
   	    try {
               Toolkit toolkit = Toolkit.getDefaultToolkit();
               boolean shouldEnable = false;            
               if (toolkit instanceof InputMethodSupport) {
                   shouldEnable = ((InputMethodSupport)toolkit)
                     .enableInputMethodsForTextComponent();
               }
               enableInputMethods(shouldEnable);
           } catch (Exception e) {
               // if something bad happens, just don't enable input methods
    }
       }
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:17,代码来源:TextComponent.java

示例5: getDefaultKeyboardLocale

import sun.awt.InputMethodSupport; //导入依赖的package包/类
Locale getDefaultKeyboardLocale() {
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    if (toolkit instanceof InputMethodSupport) {
        return ((InputMethodSupport)toolkit).getDefaultKeyboardLocale();
    } else {
        return Locale.getDefault();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ExecutableInputMethodManager.java


注:本文中的sun.awt.InputMethodSupport类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。