本文整理汇总了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");
}
示例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
}
}
}
示例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();
}
示例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
}
}
}
示例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();
}
}