src/solaris/classes/sun/awt/X11InputMethod.java

Print this page


   1 /*
   2  * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 398         }
 399 
 400         /* Delay resetting the XIC focus until activate is called and the newly
 401            focussed component has a different peer as the last focussed component.
 402         */
 403         lastXICFocussedComponent = awtFocussedComponent;
 404         isLastXICActive = isAc;
 405         isLastTemporary = isTemporary;
 406         isActive = false;
 407     }
 408 
 409     /**
 410      * Explicitly disable the native IME. Native IME is not disabled when
 411      * deactivate is called.
 412      */
 413     public void disableInputMethod() {
 414         if (lastXICFocussedComponent != null) {
 415             setXICFocus(getPeer(lastXICFocussedComponent), false, isLastXICActive);
 416             lastXICFocussedComponent = null;
 417             isLastXICActive = false;




 418         }
 419     }
 420 
 421     // implements java.awt.im.spi.InputMethod.hideWindows
 422     public void hideWindows() {
 423         // ??? need real implementation
 424     }
 425 
 426     /**
 427      * @see java.awt.Toolkit#mapInputMethodHighlight
 428      */
 429     public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
 430         int index;
 431         int state = highlight.getState();
 432         if (state == InputMethodHighlight.RAW_TEXT) {
 433             index = 0;
 434         } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
 435             index = 2;
 436         } else {
 437             return null;


   1 /*
   2  * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 398         }
 399 
 400         /* Delay resetting the XIC focus until activate is called and the newly
 401            focussed component has a different peer as the last focussed component.
 402         */
 403         lastXICFocussedComponent = awtFocussedComponent;
 404         isLastXICActive = isAc;
 405         isLastTemporary = isTemporary;
 406         isActive = false;
 407     }
 408 
 409     /**
 410      * Explicitly disable the native IME. Native IME is not disabled when
 411      * deactivate is called.
 412      */
 413     public void disableInputMethod() {
 414         if (lastXICFocussedComponent != null) {
 415             setXICFocus(getPeer(lastXICFocussedComponent), false, isLastXICActive);
 416             lastXICFocussedComponent = null;
 417             isLastXICActive = false;
 418 
 419             resetXIC();
 420             needResetXICClient = null;
 421             needResetXIC = false;
 422         }
 423     }
 424 
 425     // implements java.awt.im.spi.InputMethod.hideWindows
 426     public void hideWindows() {
 427         // ??? need real implementation
 428     }
 429 
 430     /**
 431      * @see java.awt.Toolkit#mapInputMethodHighlight
 432      */
 433     public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
 434         int index;
 435         int state = highlight.getState();
 436         if (state == InputMethodHighlight.RAW_TEXT) {
 437             index = 0;
 438         } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
 439             index = 2;
 440         } else {
 441             return null;