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: * ==> MCW 07/97 <==
11: */
12: package graphical;
13:
14: import netscape.application.*;
15: import netscape.util.*;
16:
17: /**
18: * MouseOverTextField extends TextField to implement popup dismissal.
19: */
20:
21: public class MouseOverTextField extends TextField {
22: private String m_command = null;
23: private Target m_target = null;
24:
25: public MouseOverTextField(String command, Target target) {
26: super ();
27: m_command = command;
28: m_target = target;
29: }
30:
31: /**
32: * mouseDown - Mouse down event handler, destroy any popup window
33: */
34:
35: public boolean mouseDown(MouseEvent mouseEvent) {
36: if (m_target != null) {
37: m_target.performCommand(m_command, null);
38: return false;
39: }
40:
41: return super.mouseDown(mouseEvent);
42: }
43: }
|