01: /*
02: *******************************************************************************
03: * Copyright (C) 2000-2004, International Business Machines Corporation and *
04: * others. All Rights Reserved. *
05: *******************************************************************************
06: */
07:
08: package com.ibm.icu.dev.tool.ime.indic;
09:
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,
26: IndicInputMethodImpl theImplementation) {
27: locale = theLocale;
28: impl = theImplementation;
29: }
30:
31: public void setInputMethodContext(InputMethodContext context) {
32: impl.setInputMethodContext(context);
33: }
34:
35: public boolean setLocale(Locale locale) {
36: return locale.getLanguage().equals(this .locale.getLanguage());
37: }
38:
39: public Locale getLocale() {
40: return locale;
41: }
42:
43: public void setCharacterSubsets(Subset[] subsets) {
44: }
45:
46: public void setCompositionEnabled(boolean enable) {
47: throw new UnsupportedOperationException();
48: }
49:
50: public boolean isCompositionEnabled() {
51: return true;
52: }
53:
54: public void reconvert() {
55: throw new UnsupportedOperationException(
56: "This input method does not reconvert.");
57: }
58:
59: public void dispatchEvent(AWTEvent event) {
60: if (event instanceof KeyEvent) {
61: KeyEvent keyEvent = (KeyEvent) event;
62: if (event.getID() == KeyEvent.KEY_TYPED) {
63: impl.handleKeyTyped(keyEvent);
64: }
65:
66: }
67: }
68:
69: public void notifyClientWindowChange(Rectangle bounds) {
70: }
71:
72: public void activate() {
73: }
74:
75: public void deactivate(boolean isTemporary) {
76: }
77:
78: public void hideWindows() {
79: }
80:
81: public void removeNotify() {
82: }
83:
84: public void endComposition() {
85: impl.endComposition();
86: }
87:
88: public void dispose() {
89: }
90:
91: public Object getControlObject() {
92: return null;
93: }
94: }
|