1 /* 2 ******************************************************************************* 3 * Copyright (C) 2000-2004, International Business Machines Corporation and * 4 * others. All Rights Reserved. * 5 ******************************************************************************* 6 */ 7 8 package com.ibm.icu.dev.tool.ime.indic; 9 10 import java.awt.AWTEvent; 11 import java.awt.Rectangle; 12 import java.awt.event.KeyEvent; 13 import java.awt.im.spi.InputMethod; 14 import java.awt.im.spi.InputMethodContext; 15 import java.lang.Character.Subset; 16 import java.util.Locale; 17 18 /** 19 * This stub delegates to the simpler IndicInputMethodImpl. 20 */ 21 class IndicInputMethod implements InputMethod { 22 private IndicInputMethodImpl impl; 23 private Locale locale; 24 25 IndicInputMethod(Locale theLocale, IndicInputMethodImpl theImplementation) { 26 locale = theLocale; 27 impl = theImplementation; 28 } 29 30 public void setInputMethodContext(InputMethodContext context) { 31 impl.setInputMethodContext(context); 32 } 33 34 public boolean setLocale(Locale locale) { 35 return locale.getLanguage().equals(this.locale.getLanguage()); 36 } 37 38 public Locale getLocale() { 39 return locale; 40 } 41 42 public void setCharacterSubsets(Subset[] subsets) { 43 } 44 45 public void setCompositionEnabled(boolean enable) { 46 throw new UnsupportedOperationException(); 47 } 48 49 public boolean isCompositionEnabled() { 50 return true; 51 } 52 53 public void reconvert() { 54 throw new UnsupportedOperationException("This input method does not reconvert."); 55 } 56 57 public void dispatchEvent(AWTEvent event) { 58 if (event instanceof KeyEvent) { 59 KeyEvent keyEvent = (KeyEvent) event; 60 if (event.getID() == KeyEvent.KEY_TYPED) { 61 impl.handleKeyTyped(keyEvent); 62 } 63 64 } 65 } 66 67 public void notifyClientWindowChange(Rectangle bounds) { 68 } 69 70 public void activate() { 71 } 72 73 public void deactivate(boolean isTemporary) { 74 } 75 76 public void hideWindows() { 77 } 78 79 public void removeNotify() { 80 } 81 82 public void endComposition() { 83 impl.endComposition(); 84 } 85 86 public void dispose() { 87 } 88 89 public Object getControlObject() { 90 return null; 91 } 92 } 93