01: /*
02: * (C) Copyright IBM Corp. 1998-2004. All Rights Reserved.
03: *
04: * The program is provided "as is" without any warranty express or
05: * implied, including the warranty of non-infringement and the implied
06: * warranties of merchantibility and fitness for a particular purpose.
07: * IBM will not be liable for any damages suffered by you as a result
08: * of using the Program. In no event will IBM be liable for any
09: * special, indirect or consequential damages or lost profits even if
10: * IBM has been advised of the possibility of their occurrence. IBM
11: * will not be liable for any third party claims against you.
12: */
13: package com.ibm.richtext.textpanel;
14:
15: import java.awt.event.KeyEvent;
16:
17: /**
18: * This class forwards key events to a TextPanel component for
19: * testing purposes.
20: * Its sole reason for existence is to prevent the key-event
21: * API from being public on MTextPanel, and being mistaken for
22: * standard API. This class is only for testing! It may be
23: * removed from public API at any time. Do not depend on this
24: * class.
25: */
26: public final class KeyEventForwarder {
27:
28: private ATextPanelImpl fPanelImpl;
29:
30: public KeyEventForwarder(TextPanel textPanel) {
31:
32: fPanelImpl = textPanel.getImpl();
33: }
34:
35: public KeyEventForwarder(JTextPanel textPanel) {
36:
37: fPanelImpl = textPanel.getImpl();
38: }
39:
40: public void handleKeyEvent(KeyEvent keyEvent) {
41:
42: fPanelImpl.handleKeyEvent(keyEvent);
43: }
44: }
|