01: /*
02: * CONFIDENTIAL AND PROPRIETARY SOURCE CODE OF
03: * NETSCAPE COMMUNICATIONS CORPORATION
04: *
05: * Copyright (c) 1996 Netscape Communications Corporation.
06: * All Rights Reserved.
07: * Use of this Source Code is subject to the terms of the applicable
08: * license agreement from Netscape Communications Corporation.
09: */
10:
11: package graphical;
12:
13: import netscape.application.KeyEvent;
14: import netscape.application.Rect;
15: import netscape.application.Target;
16: import netscape.application.TextField;
17:
18: /**
19: * SGP: Hack. Revisit in B2.
20: */
21: public class HyperTextField extends TextField {
22: public static final String KEYDOWN = "KEYDOWN";
23:
24: private Target keyDownTarget;
25:
26: public HyperTextField() {
27: super ();
28: }
29:
30: public HyperTextField(int x, int y, int width, int height) {
31: super (x, y, width, height);
32: }
33:
34: public HyperTextField(Rect rect) {
35: super (rect);
36: }
37:
38: public void setKeyDownTarget(Target target) {
39: keyDownTarget = target;
40: }
41:
42: public void keyDown(KeyEvent keyEvent) {
43: super.keyDown(keyEvent);
44: if (keyDownTarget != null) {
45: keyDownTarget.performCommand(KEYDOWN, null);
46: }
47: }
48: }
|