This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 51971 - Popup in ButtonPopupSwitcher does not have parent
Summary: Popup in ButtonPopupSwitcher does not have parent
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords: T9Y
Depends on:
Blocks:
 
Reported: 2004-12-01 14:30 UTC by Jiri Skrivanek
Modified: 2008-12-22 23:51 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ButtonPopupSwitcher patch (1.87 KB, patch)
2004-12-06 14:08 UTC, Jiri Skrivanek
Details | Diff
TabListPopupAction patch (823 bytes, text/plain)
2004-12-06 14:09 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2004-12-01 14:30:36 UTC
In UI automated tests it is a problem to find
popup window and JTable in it when "down" button
in editor mode is pressed. It is caused by changes
in org.netbeans.swing.tabcontrol package.
Previously popup was constructed in
org.netbeans.swing.tabcontrol.plaf.TabListPopup
(line 435, release40). Now it is constructed in
org.netbeans.swing.tabcontrol.ButtonPopupSwitcher
(line 106) but it has no parent. It should be
fixed.  KeyboardSwitcher might be a similar case.

To run affected tests:

cd nb_all/jellytools/test
ant
-Dxtest.run.singletest=org/netbeans/jellytools/EditorWindowOperatorTest.class
Comment 1 Martin Krauskopf 2004-12-03 01:28:55 UTC
I hope it's fixed. But not sure if this was the reason why test
failed. Test on my machine is still failing but I hope the reason is
that I'm running them wrong. Pls, try it yourself Jirko (since you
know much more about jelly then me) and let me know how is the result.
I tried my simple tests and JTable you talked about has parent and I
think the current code for ButtonSwitcher is OK. I haven't found any
differencies between previous popup and current (after this patch).
Thanks for the help and reopen if you still think the problem is with
ButtonPopupSwitcher.

Checking in
core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/ButtonPopupSwitcher.java;
/cvs/core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/ButtonPopupSwitcher.java,v
 <--  ButtonPopupSwitcher.java
new revision: 1.4; previous revision: 1.3
done
Comment 2 Jiri Skrivanek 2004-12-06 14:08:01 UTC
It is better but not completely fixed. The problem is that in method
ButtonPopupSwitcher.doSelect is called EventQueue.getCurrentEvent()
and source is used as upcoming parent. But that event doesn't need to
be the action event. In my case it is
HierarchyEvent[HIERARCHY_CHANGED] and then parent is set incorrectly.
IMHO, you need to pass parent component from
TabListPopupAction.actionPerformed to ButtonPopupSwitcher.doSelect as
parameter. I tested the patch I will include and it worked.
Comment 3 Jiri Skrivanek 2004-12-06 14:08:39 UTC
Created attachment 19156 [details]
ButtonPopupSwitcher patch
Comment 4 Jiri Skrivanek 2004-12-06 14:09:10 UTC
Created attachment 19157 [details]
TabListPopupAction patch
Comment 5 Martin Krauskopf 2004-12-06 15:08:18 UTC
Ok, I didn't count with such a case. Thanks for your time. The patch
was applied.

Checking in
core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/ButtonPopupSwitcher.java;
Checking in
core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/TabListPopupAction.java;
Checking in
core/swing/tabcontrol/test/unit/src/org/netbeans/swing/tabcontrol/ButtonPopupSwitcherTestHid.java;
Comment 6 Jiri Skrivanek 2004-12-07 10:09:37 UTC
Thanks. Verified in build 20041206-1914.