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 117720 - [60cat]overlap on context memu
Summary: [60cat]overlap on context memu
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Milan Kubec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-04 02:01 UTC by tetsu
Modified: 2008-04-09 10:43 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot of overlap (30.95 KB, image/png)
2007-10-04 02:02 UTC, tetsu
Details
Example to show incorrect submenu placing (5.98 KB, text/plain)
2007-10-16 10:43 UTC, mslama
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tetsu 2007-10-04 02:01:30 UTC
1) Maximum netbeans window.
2) relocate the "Projects" view form left side to right side.
3) Right-click on one project to open context menu in the "Projects" view.
4) Point mouse on "New" item to open sub-menu.
5) At this time, you can see the sub-menu is displayed on the right side and overlap with the super-menu. 
However, if you point mouse on "Set configuration", "CVS" or any other items which also will open sub-menu, the sub-menu
will display on the left side of super-menu and won't overlap.

I attached a screen shot. Please check it out.
Comment 1 tetsu 2007-10-04 02:02:34 UTC
Created attachment 50150 [details]
screenshot of overlap
Comment 2 Jaromir Uhrik 2007-10-04 10:52:23 UTC
I can reproduce it on Mac OS => changing Platform and OS to All.
Comment 3 Jiri Prox 2007-10-05 15:37:30 UTC
I'm not sure if this is the right component, feel free to reassign
Comment 4 mslama 2007-10-08 11:04:25 UTC
It is Swing behavior. I assume it is by design. Simply context submenu is expected to be on right side of arrow in
parent menu. But when there is no space on right side where would you put submenu? If you put it on left side there is
usability issue with mouse - user would have to move mouse to the left to select desired item. Showing submenu on left
side is worse IMO than opening as now over parent menu. I could file issue against Swing but: 1.I do not think it is
*bug*. 2.I expect the same evaluation from Swing team. 3.Do you know *better* solution?

I know similar situation when there is not enough space below so submenu is shifted (in most cases) up. But this is only
similar not the same situation.

I tried on JDK 7 b21 on Linux both Metal and GTK L&F.
Comment 5 tetsu 2007-10-09 02:19:20 UTC
IMHO, if there is no space on right side, the submenu should be placed on the left, at least on the Windows Platform.
Because that how windows handle this problem. Maybe not perfect, but windows users are used to it.

In fact, the issue I filed, only happens with the *New* submenu. Other submenus are just placed on the left when no
space on the right side, why *New* is placed on the right? 
Comment 6 mslama 2007-10-09 07:51:04 UTC
I see. The way how submenu is displayed is controlled by Swing. I will investigate why New submenu is opened differently.
Comment 7 mslama 2007-10-16 10:41:47 UTC
Reason is that New submenu is populated lazily in PopupMenuListener.popupMenuWillBecomeVisible but Swing computes
location of submenu from present submenu items before. I did not find any workaround to this issue. I filed issue
#6617411 against Swing. Passing this to projects/ui as it is code where New submenu is created. Probably WONTFIX.
Example to demostrate this problem will be attached. Maximize app window and invoke popup menu on right side of app
window so that there will be no available space for submenu on right side of popup menu.
Comment 8 mslama 2007-10-16 10:43:41 UTC
Created attachment 51009 [details]
Example to show incorrect submenu placing
Comment 9 Milan Kubec 2007-10-16 11:07:21 UTC
I don't see how we could fix it if swing app behaves exactly the same way.
Comment 10 Milan Kubec 2008-04-01 15:18:34 UTC
I'm not able to reproduce on Ubuntu 7.10, JDK 1.5.0_15, Metal L&F. The menu is "correctly" placed to the left. Closing
as won't fix as it's swing problem and probably already fixed.
Comment 11 mslama 2008-04-08 17:23:29 UTC
No this is NOT fixed in Swing. Just NewFile class does not fill menu in PopupMenuListener.popupMenuWillBecomeVisible. So
it is 'fixed' in this case in NB. But still there is a lot of places where PopupMenuListener.popupMenuWillBecomeVisible
is used. I did not check what is done in those occurrences and if the same problem might happen.
Comment 12 Milan Kubec 2008-04-09 09:10:56 UTC
OK then, should we open the issue?
Comment 13 mslama 2008-04-09 10:21:05 UTC
This issue can stay closed. Swing issue is opened. If there will be another case in IDE new issue will be opened and
then it can be fixed as here or depend on Swing issue and closed as WONTFIX.
Comment 14 mslama 2008-04-09 10:43:02 UTC
Original Swing issue is http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4743225