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 123450

Summary: Make editor menus consistent cross different file types
Product: ide Reporter: jrojcek <jrojcek>
Component: UIAssignee: issues@ide <issues>
Status: NEW ---    
Severity: blocker CC: anebuzelsky, lbarnard, mmetelka, olangr
Priority: P3 Keywords: PLAN, UI
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 138358, 138360, 138364    
Bug Blocks: 133913    

Description jrojcek 2007-12-05 12:28:53 UTC
Problem description and solution:

Contextual menus cross different file types are inconsistent. For NetBeans 6.0 we created a UI spec to improve consistency, but we didn't implement it. The spec:


Note that even though I'm filing this issue as part of the 6.1 planning, the real intention is to address this issue either in 6.1 or in one of the upcoming releases.
Comment 1 Jan Becicka 2008-05-21 09:51:18 UTC
Please review the spec and fix things related to java and reassign to "next" language. Thanks

Comment 2 Jan Becicka 2008-05-26 15:06:19 UTC
Milo, please take a look at it. Thanks.
Comment 3 Miloslav Metelka 2008-06-05 23:12:59 UTC
The java context menu should mostly adhere to the spec except the first separator being above Find Usages at the top and
two extra items "Fix Imports" and "Select In" submenu. There is "Goto Test" in Navigate submenu. More refactorings.
"Insert Code ..." followed by a popup instead of "Insert" submenu. Jano/Ondro could you pls look at a recent dev build
and confirm whether it requires further changes? Thanks.
Comment 4 jrojcek 2008-06-09 16:52:38 UTC
I've updated the spec with the Goto Test and Fix Imports actions and Select In menu. I also replaced the Insert submenu with the Insert Code... action.

Here's the list of remaining items that should be fixed in implementation:

1. The very first separator should be _below_ the Find Usages action
2. The order of Insert, Fix Imports and remaining actions in the second section of the menu should be fixed.
3. The Reverse Engineer action should be removed from the submenu. I expect there's a better way of updating the model than manual refresh from contextual menu. 
If it's not the case, we need to discuss it.
4. The Run and Debug actions should _not_ show the file name when they are enabled.
5. The EJB Methods item should be moved inside the Insert Code menu.
6. The Enterprise Resources items should be moved into the Insert Code menu.
7. The Web Service Client Resources should be moved into the Insert Code menu.

I'm not sure who should fix those issues.
Comment 5 Jan Becicka 2008-06-09 18:17:10 UTC
Milo, please fix issues related to Java & Editor and pass this issue to next module. Thanks
Comment 6 Miloslav Metelka 2008-06-13 17:10:27 UTC
Fixed 1. and 2.

changeset:   84163:90c89c64a54a
tag:         tip
user:        Miloslav Metelka <>
date:        Fri Jun 13 17:38:51 2008 +0200
summary:     #123450 - Make editor menus consistent cross different file types - items 1. and 2.

I have attempted to fix 4. by changing "LBL_RunSingleAction_Name" in org.netbeans.modules.project.ui.actions.Bundle to
LBL_RunSingleAction_Name=&Run File
Although it works for editor's context menu it also changes main menu from Run->Run File->Run "" to Run->Run
File->Run File. I assume we would rather like to retain the original look in this case, right?
So I pass to projects since the solution there will possibly be more complex.

BTW the UI spec contains "Profiling >". Although it's not among the items from Jano I guess it should be implemented too.
Comment 7 jrojcek 2008-06-16 15:54:23 UTC
Milo, also the separator below the Navigate submenu item should be removed. Thanks!
Comment 8 jrojcek 2008-06-23 11:49:47 UTC
Regarding the Run File action, it doesn't need to show the file name in main menu.
Comment 9 Jan Becicka 2008-11-06 14:14:19 UTC
Let's fix it for 7.0
Comment 10 Milan Kubec 2008-11-12 13:10:32 UTC
Milo, 1. and 2. doesn't seem to be fixed. Please take a look. Thanks.
Comment 11 Miloslav Metelka 2008-11-12 17:03:17 UTC
Caused by mobility's layer.xml - should now be fixed.
I have also reordered text in java.editor's layer.xml to correspond to increasing position ids (no change in fact).

So editor's part should now be fixed.
Comment 12 Quality Engineering 2008-11-13 05:06:49 UTC
Integrated into 'main-golden', will be available in build *200811130201* on (upload may still be in progress)
User: Miloslav Metelka <>
Log: #123450 - Make editor menus consistent cross different file types.
Comment 13 hantsy 2008-11-28 03:54:43 UTC
The editor context menu is stupid and confused.
Sometimes two separators are displayed together without content between then.
Why not use a more intelligent way to deal with the context menu?
For example ,use group concept to organize the menu items.
A text file context menu maybe like this.

A generic java file context menu maybe like this.
Select in->
Quick open Hierarchy
Source Code->(generate code ,code fold ,fix imports )
Go to->

A EJB file context menu maybe like this.

Select in->
Quick open Hierarchy
Source Code->(generate code ,code fold ,fix imports )
Go to->
Web Service->

All other 3rd party context actions can be put into a tools group.
Commons Lang->

By the way,  a "Property " action should add to the end of the menu.In the opened "Property" window, user can modify the
Encoding, etc. eg, for a HTML file , user can edit the meta of html.

NetBeans team can define the context category firstly ,when the menu rendered , add a separator between different group.

Another problem , make the context menu is related to the user's action , For example , when user selected some content,
drop unrelated menu item from context menu.