微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

java.awt.im.spi.InputMethod的实例源码

项目:cn1    文件InputMethodContext.java   
private void activateIM(InputMethod im) {
    Component c;

    im.activate();
    if ((nativeIM != null) && (im != nativeIM)) {
        // when Java IM is active
        // native input method editor must be
        // explicitly disabled
        nativeIM.disableIME();
    }
    IMManager.setLastActiveIMC(this);

    c = getClient();
    if (c != null) {
       c.getInputMethodRequests();
    }
}
项目:cn1    文件InputMethodContext.java   
@Override
public boolean selectInputMethod(Locale locale) {        

    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) {
        try {
            newIM = getIMInstance(IMManager.getIMDescriptors().iterator(),locale);
        } catch (Exception e) {
            // ignore exceptions - just return false
        }
    }

    return switchToIM(locale,newIM);
}
项目:cn1    文件InputMethodContext.java   
public void enableClientwindowNotification(InputMethod inputMethod,boolean enable) {
    if (enable) {
        notifyIM.add(inputMethod);
        if (client != null) {
            notifyClientwindowChange(IMManager.getwindow(client).getBounds());
        } else {
            pendingClientNotify = true;
        }
    } else {
        notifyIM.remove(inputMethod);
    }



}
项目:freeVM    文件InputMethodContext.java   
@Override
public boolean selectInputMethod(Locale locale) {        

    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,newIM);
}
项目:freeVM    文件InputMethodContext.java   
public void enableClientwindowNotification(InputMethod inputMethod,boolean enable) {
    if (enable) {
        notifyIM.add(inputMethod);
        if (client != null) {
            notifyClientwindowChange(IMManager.getwindow(client).getBounds());
        } else {
            pendingClientNotify = true;
        }
    } else {
        notifyIM.remove(inputMethod);
    }



}
项目:freeVM    文件InputMethodContext.java   
private void activateIM(InputMethod im) {
    Component c;

    im.activate();
    if ((nativeIM != null) && (im != nativeIM)) {
        // when Java IM is active
        // native input method editor must be
        // explicitly disabled
        nativeIM.disableIME();
    }
    IMManager.setLastActiveIMC(this);

    c = getClient();
    if (c != null) {
       c.getInputMethodRequests();
    }
}
项目:Openjsharp    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#reconvert
 * @since 1.3
 * @exception UnsupportedOperationException when input method is null
 */
public synchronized void reconvert() {
    InputMethod inputMethod = getInputMethod();
    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    inputMethod.reconvert();
}
项目:Openjsharp    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#getInputMethodControlObject
 */
public synchronized Object getInputMethodControlObject() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod != null) {
        return inputMethod.getControlObject();
    } else {
        return null;
    }
}
项目:Openjsharp    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#setCompositionEnabled(boolean)
 * @exception UnsupportedOperationException when input method is null
 */
public void setCompositionEnabled(boolean enable) {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    inputMethod.setCompositionEnabled(enable);
}
项目:Openjsharp    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#isCompositionEnabled
 * @exception UnsupportedOperationException when input method is null
 */
public boolean isCompositionEnabled() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    return inputMethod.isCompositionEnabled();
}
项目:Openjsharp    文件InputContext.java   
/**
 * @return a string with @R_197_4045@ion about the current input method.
 * @exception UnsupportedOperationException when input method is null
 */
public String getInputMethodInfo() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException("Null input method");
    }

    String inputMethodInfo = null;
    if (inputMethod instanceof InputMethodAdapter) {
        // returns the @R_197_4045@ion about the host native input method.
        inputMethodInfo = ((InputMethodAdapter)inputMethod).
            getNativeInputMethodInfo();
    }

    // extracts the @R_197_4045@ion from the InputMethodDescriptor
    // associated with the current java input method.
    if (inputMethodInfo == null && inputMethodLocator != null) {
        inputMethodInfo = inputMethodLocator.getDescriptor().
            getInputMethoddisplayName(getLocale(),SunToolkit.
                                      getStartupLocale());
    }

    if (inputMethodInfo != null && !inputMethodInfo.equals("")) {
        return inputMethodInfo;
    }

    // do our best to return something useful.
    return inputMethod.toString() + "-" + inputMethod.getLocale().toString();
}
项目:Openjsharp    文件InputContext.java   
private synchronized InputMethod getInputMethod() {
    if (inputMethod != null) {
        return inputMethod;
    }

    if (inputMethodCreationFailed) {
        return null;
    }

    inputMethod = getInputMethodInstance();
    return inputMethod;
}
项目:Openjsharp    文件InputContext.java   
/**
 * @see java.awt.im.spi.InputMethodContext#enableClientwindowNotification
 */
synchronized void enableClientwindowNotification(InputMethod requester,boolean enable) {
    // in case this request is not from the current input method,// store the request and handle it when this requesting input
    // method becomes the current one.
    if (requester != inputMethod) {
        if (perInputMethodState == null) {
            perInputMethodState = new HashMap<>(5);
        }
        perInputMethodState.put(requester,Boolean.valueOf(enable));
        return;
    }

    if (clientwindowNotificationEnabled != enable) {
        clientwindowLocation = null;
        clientwindowNotificationEnabled = enable;
    }
    if (clientwindowNotificationEnabled) {
        if (!addedClientwindowListeners()) {
            addClientwindowListeners();
        }
        if (clientwindowListened != null) {
            clientwindowLocation = null;
            notifyClientwindowChange(clientwindowListened);
        }
    } else {
        if (addedClientwindowListeners()) {
            removeClientwindowListeners();
        }
    }
}
项目:jdk8u-jdk    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#reconvert
 * @since 1.3
 * @exception UnsupportedOperationException when input method is null
 */
public synchronized void reconvert() {
    InputMethod inputMethod = getInputMethod();
    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    inputMethod.reconvert();
}
项目:jdk8u-jdk    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#getInputMethodControlObject
 */
public synchronized Object getInputMethodControlObject() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod != null) {
        return inputMethod.getControlObject();
    } else {
        return null;
    }
}
项目:jdk8u-jdk    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#setCompositionEnabled(boolean)
 * @exception UnsupportedOperationException when input method is null
 */
public void setCompositionEnabled(boolean enable) {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    inputMethod.setCompositionEnabled(enable);
}
项目:jdk8u-jdk    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#isCompositionEnabled
 * @exception UnsupportedOperationException when input method is null
 */
public boolean isCompositionEnabled() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    return inputMethod.isCompositionEnabled();
}
项目:jdk8u-jdk    文件InputContext.java   
/**
 * @return a string with @R_197_4045@ion about the current input method.
 * @exception UnsupportedOperationException when input method is null
 */
public String getInputMethodInfo() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException("Null input method");
    }

    String inputMethodInfo = null;
    if (inputMethod instanceof InputMethodAdapter) {
        // returns the @R_197_4045@ion about the host native input method.
        inputMethodInfo = ((InputMethodAdapter)inputMethod).
            getNativeInputMethodInfo();
    }

    // extracts the @R_197_4045@ion from the InputMethodDescriptor
    // associated with the current java input method.
    if (inputMethodInfo == null && inputMethodLocator != null) {
        inputMethodInfo = inputMethodLocator.getDescriptor().
            getInputMethoddisplayName(getLocale(),SunToolkit.
                                      getStartupLocale());
    }

    if (inputMethodInfo != null && !inputMethodInfo.equals("")) {
        return inputMethodInfo;
    }

    // do our best to return something useful.
    return inputMethod.toString() + "-" + inputMethod.getLocale().toString();
}
项目:jdk8u-jdk    文件InputContext.java   
private synchronized InputMethod getInputMethod() {
    if (inputMethod != null) {
        return inputMethod;
    }

    if (inputMethodCreationFailed) {
        return null;
    }

    inputMethod = getInputMethodInstance();
    return inputMethod;
}
项目:jdk8u-jdk    文件InputContext.java   
/**
 * @see java.awt.im.spi.InputMethodContext#enableClientwindowNotification
 */
synchronized void enableClientwindowNotification(InputMethod requester,Boolean.valueOf(enable));
        return;
    }

    if (clientwindowNotificationEnabled != enable) {
        clientwindowLocation = null;
        clientwindowNotificationEnabled = enable;
    }
    if (clientwindowNotificationEnabled) {
        if (!addedClientwindowListeners()) {
            addClientwindowListeners();
        }
        if (clientwindowListened != null) {
            clientwindowLocation = null;
            notifyClientwindowChange(clientwindowListened);
        }
    } else {
        if (addedClientwindowListeners()) {
            removeClientwindowListeners();
        }
    }
}
项目:openjdk-jdk10    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#reconvert
 * @since 1.3
 * @exception UnsupportedOperationException when input method is null
 */
public synchronized void reconvert() {
    InputMethod inputMethod = getInputMethod();
    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    inputMethod.reconvert();
}
项目:openjdk-jdk10    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#getInputMethodControlObject
 */
public synchronized Object getInputMethodControlObject() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod != null) {
        return inputMethod.getControlObject();
    } else {
        return null;
    }
}
项目:openjdk-jdk10    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#setCompositionEnabled(boolean)
 * @exception UnsupportedOperationException when input method is null
 */
public void setCompositionEnabled(boolean enable) {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    inputMethod.setCompositionEnabled(enable);
}
项目:openjdk-jdk10    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#isCompositionEnabled
 * @exception UnsupportedOperationException when input method is null
 */
public boolean isCompositionEnabled() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    return inputMethod.isCompositionEnabled();
}
项目:openjdk-jdk10    文件InputContext.java   
/**
 * @return a string with @R_197_4045@ion about the current input method.
 * @exception UnsupportedOperationException when input method is null
 */
public String getInputMethodInfo() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException("Null input method");
    }

    String inputMethodInfo = null;
    if (inputMethod instanceof InputMethodAdapter) {
        // returns the @R_197_4045@ion about the host native input method.
        inputMethodInfo = ((InputMethodAdapter)inputMethod).
            getNativeInputMethodInfo();
    }

    // extracts the @R_197_4045@ion from the InputMethodDescriptor
    // associated with the current java input method.
    if (inputMethodInfo == null && inputMethodLocator != null) {
        inputMethodInfo = inputMethodLocator.getDescriptor().
            getInputMethoddisplayName(getLocale(),SunToolkit.
                                      getStartupLocale());
    }

    if (inputMethodInfo != null && !inputMethodInfo.equals("")) {
        return inputMethodInfo;
    }

    // do our best to return something useful.
    return inputMethod.toString() + "-" + inputMethod.getLocale().toString();
}
项目:openjdk-jdk10    文件InputContext.java   
private synchronized InputMethod getInputMethod() {
    if (inputMethod != null) {
        return inputMethod;
    }

    if (inputMethodCreationFailed) {
        return null;
    }

    inputMethod = getInputMethodInstance();
    return inputMethod;
}
项目:openjdk-jdk10    文件InputContext.java   
/**
 * @see java.awt.im.spi.InputMethodContext#enableClientwindowNotification
 */
synchronized void enableClientwindowNotification(InputMethod requester,Boolean.valueOf(enable));
        return;
    }

    if (clientwindowNotificationEnabled != enable) {
        clientwindowLocation = null;
        clientwindowNotificationEnabled = enable;
    }
    if (clientwindowNotificationEnabled) {
        if (!addedClientwindowListeners()) {
            addClientwindowListeners();
        }
        if (clientwindowListened != null) {
            clientwindowLocation = null;
            notifyClientwindowChange(clientwindowListened);
        }
    } else {
        if (addedClientwindowListeners()) {
            removeClientwindowListeners();
        }
    }
}
项目:openjdk9    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#reconvert
 * @since 1.3
 * @exception UnsupportedOperationException when input method is null
 */
public synchronized void reconvert() {
    InputMethod inputMethod = getInputMethod();
    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    inputMethod.reconvert();
}
项目:openjdk9    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#getInputMethodControlObject
 */
public synchronized Object getInputMethodControlObject() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod != null) {
        return inputMethod.getControlObject();
    } else {
        return null;
    }
}
项目:openjdk9    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#setCompositionEnabled(boolean)
 * @exception UnsupportedOperationException when input method is null
 */
public void setCompositionEnabled(boolean enable) {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    inputMethod.setCompositionEnabled(enable);
}
项目:openjdk9    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#isCompositionEnabled
 * @exception UnsupportedOperationException when input method is null
 */
public boolean isCompositionEnabled() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    return inputMethod.isCompositionEnabled();
}
项目:openjdk9    文件InputContext.java   
/**
 * @return a string with @R_197_4045@ion about the current input method.
 * @exception UnsupportedOperationException when input method is null
 */
public String getInputMethodInfo() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException("Null input method");
    }

    String inputMethodInfo = null;
    if (inputMethod instanceof InputMethodAdapter) {
        // returns the @R_197_4045@ion about the host native input method.
        inputMethodInfo = ((InputMethodAdapter)inputMethod).
            getNativeInputMethodInfo();
    }

    // extracts the @R_197_4045@ion from the InputMethodDescriptor
    // associated with the current java input method.
    if (inputMethodInfo == null && inputMethodLocator != null) {
        inputMethodInfo = inputMethodLocator.getDescriptor().
            getInputMethoddisplayName(getLocale(),SunToolkit.
                                      getStartupLocale());
    }

    if (inputMethodInfo != null && !inputMethodInfo.equals("")) {
        return inputMethodInfo;
    }

    // do our best to return something useful.
    return inputMethod.toString() + "-" + inputMethod.getLocale().toString();
}
项目:openjdk9    文件InputContext.java   
private synchronized InputMethod getInputMethod() {
    if (inputMethod != null) {
        return inputMethod;
    }

    if (inputMethodCreationFailed) {
        return null;
    }

    inputMethod = getInputMethodInstance();
    return inputMethod;
}
项目:openjdk9    文件InputContext.java   
/**
 * @see java.awt.im.spi.InputMethodContext#enableClientwindowNotification
 */
synchronized void enableClientwindowNotification(InputMethod requester,Boolean.valueOf(enable));
        return;
    }

    if (clientwindowNotificationEnabled != enable) {
        clientwindowLocation = null;
        clientwindowNotificationEnabled = enable;
    }
    if (clientwindowNotificationEnabled) {
        if (!addedClientwindowListeners()) {
            addClientwindowListeners();
        }
        if (clientwindowListened != null) {
            clientwindowLocation = null;
            notifyClientwindowChange(clientwindowListened);
        }
    } else {
        if (addedClientwindowListeners()) {
            removeClientwindowListeners();
        }
    }
}
项目:jdk8u_jdk    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#reconvert
 * @since 1.3
 * @exception UnsupportedOperationException when input method is null
 */
public synchronized void reconvert() {
    InputMethod inputMethod = getInputMethod();
    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    inputMethod.reconvert();
}
项目:jdk8u_jdk    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#getInputMethodControlObject
 */
public synchronized Object getInputMethodControlObject() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod != null) {
        return inputMethod.getControlObject();
    } else {
        return null;
    }
}
项目:jdk8u_jdk    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#setCompositionEnabled(boolean)
 * @exception UnsupportedOperationException when input method is null
 */
public void setCompositionEnabled(boolean enable) {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    inputMethod.setCompositionEnabled(enable);
}
项目:jdk8u_jdk    文件InputContext.java   
/**
 * @see java.awt.im.InputContext#isCompositionEnabled
 * @exception UnsupportedOperationException when input method is null
 */
public boolean isCompositionEnabled() {
    InputMethod inputMethod = getInputMethod();

    if (inputMethod == null) {
        throw new UnsupportedOperationException();
    }
    return inputMethod.isCompositionEnabled();
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。