Package ae.java.awt.im.spi

Examples of ae.java.awt.im.spi.InputMethod


     * @see ae.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();
    }
View Full Code Here


                (opposite.getInputContext() == this)) {
                return;
            }
        }

        InputMethod inputMethod = getInputMethod();
        int id = event.getID();

        switch (id) {
        case FocusEvent.FOCUS_GAINED:
            focusGained((Component) event.getSource());
            break;

        case FocusEvent.FOCUS_LOST:
            focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary());
            break;

        case KeyEvent.KEY_PRESSED:
            if (checkInputMethodSelectionKey((KeyEvent)event)) {
                // pop up the input method selection menu
                InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource());
                break;
            }

            // fall through

        default:
            if ((inputMethod != null) && (event instanceof InputEvent)) {
                inputMethod.dispatchEvent(event);
            }
        }
    }
View Full Code Here

    /**
     * @see ae.java.awt.im.InputContext#getInputMethodControlObject
     */
    public synchronized Object getInputMethodControlObject() {
        InputMethod inputMethod = getInputMethod();

        if (inputMethod != null) {
            return inputMethod.getControlObject();
        } else {
            return null;
        }
    }
View Full Code Here

    /**
     * @see ae.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);
    }
View Full Code Here

    /**
     * @see ae.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();
    }
View Full Code Here

    /**
     * @return a string with information 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 information about the host native input method.
            inputMethodInfo = ((InputMethodAdapter)inputMethod).
                getNativeInputMethodInfo();
        }

        // extracts the information 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();
    }
View Full Code Here

     * delayed until the active method is called on a different
     * peer component. This method is provided to explicitly disable
     * the native IM.
     */
    public void disableNativeIM() {
        InputMethod inputMethod = getInputMethod();
        if (inputMethod != null && inputMethod instanceof InputMethodAdapter) {
            ((InputMethodAdapter)inputMethod).disableInputMethod();
        }
    }
View Full Code Here

            inputMethodCreationFailed = true;
            return null;
        }

        Locale locale = locator.getLocale();
        InputMethod inputMethodInstance = null;

        // see whether we have a previously used input method
        if (usedInputMethods != null) {
            inputMethodInstance = (InputMethod) usedInputMethods.remove(locator.deriveLocator(null));
            if (inputMethodInstance != null) {
                if (locale != null) {
                    inputMethodInstance.setLocale(locale);
                }
                inputMethodInstance.setCharacterSubsets(characterSubsets);
                Boolean state = (Boolean) perInputMethodState.remove(inputMethodInstance);
                if (state != null) {
                    enableClientWindowNotification(inputMethodInstance, state.booleanValue());
                }
                ((InputMethodContext) this).setInputMethodSupportsBelowTheSpot(
                        (!(inputMethodInstance instanceof InputMethodAdapter)) ||
                        ((InputMethodAdapter) inputMethodInstance).supportsBelowTheSpot());
                return inputMethodInstance;
            }
        }

        // need to create new instance
        try {
            inputMethodInstance = locator.getDescriptor().createInputMethod();

            if (locale != null) {
                inputMethodInstance.setLocale(locale);
            }
            inputMethodInstance.setInputMethodContext((InputMethodContext) this);
            inputMethodInstance.setCharacterSubsets(characterSubsets);

        } catch (Exception e) {
            logCreationFailed(e);

            // there are a number of bad things that can happen while creating
View Full Code Here

TOP

Related Classes of ae.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.