JDK-4126630 : An alternative to isPopupTrigger() functionality
  • Type: Enhancement
  • Component: docs
  • Sub-Component: guides
  • Affected Version: 1.1.6,1.3.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_2.5,windows_nt
  • CPU: generic,x86
  • Submitted: 1998-04-07
  • Updated: 2000-12-20
  • Resolved: 2000-12-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0 betaFixed
Related Reports
Relates :  
Description
For context look at bug number 4119064 and 4126592 and 4029723 and
4063318. This reenforces my point that many people are doing the
same mistake and it either needs to be handled by a strong documentation
or alternate implementation like I have proposed.

sandip.chitale@Eng 1998-04-20

It has been a common mistake made by a lot of people including
myself to check for isPopupTrigger() in either mousePressed or
mouseReleased and not both. The code seems to work on either
CDE/Motif or WindowsOne and not both. One can argue that the programmer
was stupid and should should check for isPopupTrigger()
in both mousePressed and mouseReleased, however if many people
are doing the same mistake (as indicated by the code in the
original bug and code in the workaround) may be it should 
implemented in a different way. Here goes ...

May be a new Event type PopupMenuTriggerEvent needs to be created
and the Component class fires it in its processMouseEvent()
method. The PopupMenuTriggerEvent may contain the original
event (Mouse or Keyboard) that caused the trigger.

This will ofcourse also require -

public void addPopupMenuTriggerListener(PopupMenuTriggerListener pmtl);
public void removePopupMenuTriggerListener(PopupMenuTriggerListener pmtl);

and corresponding PopupMenuTriggerListener class.

This will also allow keyboard mnemonics to be used to pop the
popup menu (for Accesibility).


sandip.chitale@Eng 1998-04-07


Name: krT82822			Date: 02/15/2000


java version "1.3.0rc1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-T)
Java HotSpot(TM) Client VM (build 1.3.0rc1-S, mixed mode)

My program needs NEEDS to know whether a popup ocured during a MOUSE_PRESSED
message; by the time a MOUSE_RELEASED message comes, it is too late, as my
program performs specific tasks during a MOUSE_PRESSED, that it would not if a
popup is in progress. As a workaround, I must check to see if the left mouse
button is down during a MOUSE_PRESSED message. This is not portable.

Instead of documenting  the fact that popup triggers can't be detected during a
MOUSE_PRESSED, I suggest instead that you enable detection of popup triggers
durring a MOUSE_PRESSED. Perhaps there are portability issues constraining you
from doing this, but as it stands, it I cannot write a portable Java program
that depends on the detection of a popup during a MOUSE_PRESSED message.
(Review ID: 101197)
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin FIXED IN: merlin-beta INTEGRATED IN: merlin-beta
14-06-2004

PUBLIC COMMENTS .
10-06-2004

EVALUATION This is definitely a major hole in the documentation. As the evaluations of 4119064, 4126592 and 4029723 describe, the isPopupTrigger() method works well WHEN USED PROPERLY. I think the problem is that most client programmers don't realize that isPopupTrigger() should be checked in both mousePressed() and mouseReleased() for proper cross-platform functionality. This detail should be made abundantly clear in the isPopupTrigger() documentation. brent.christian@eng 2000-01-04 Fixed for merlin. sharon.zakhour@eng 2000-12-18
04-01-2000