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 129015 - useless actions in CSS popup menu
Summary: useless actions in CSS popup menu
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 6.x
Hardware: Sun All
: P4 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords: NETFIX, SIMPLEFIX
Depends on:
Blocks:
 
Reported: 2008-03-03 14:30 UTC by Jindrich Sedek
Modified: 2010-03-25 09:13 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jindrich Sedek 2008-03-03 14:30:41 UTC
Create new CSS file
press right mouse button to get a popup menu
use Rename action -> it cannot be performed anywhere
use goto Declaration -> nothing happens 
these actions should be removed
Comment 1 Marek Fukala 2008-11-18 14:03:28 UTC
Goto Declaration action is not there, but Rename is still present.
Comment 2 Jiri Kovalsky 2009-03-30 15:02:56 UTC
Marek Fukala agreed that he would review and integrate a patch for this issue contributed by the NetFIX [1] team.

[1] http://wiki.netbeans.org/NetFIX
Comment 3 tusharvjoshi 2009-08-15 13:46:17 UTC
I observed that the context menu on the CSS file node in project panel works and correctly shows a dialog box asking for
new name and then renames it.

Please tell me in which module's layer file is this Popup context menu for CSS Rename, so I can work on it.  I tried to
find but it is not in css.editor module according to my observation.

with regards
Tushar Joshi, Nagpur
NetFIX Team
Comment 4 Marek Fukala 2009-08-17 09:05:18 UTC
Looks like the action is added dynamically by CSL engine, no layer declaration anywhere...
Comment 5 dynamite 2010-03-15 23:13:40 UTC
I've made a bit of progress.  The key is the refactoring module.  This has the RSMEditorAction class which in turn is composed of a RefactoringSubMenuAction.  RefactoringSubMenuAction constructs the entries in the Refactor sub-menu by looking through the Menu/Refactoring folder and loading the contained Actions (including RenameAction).  Menu/Refactoring is populated from the refactoring modules layer.xml.

This is all confirmed by putting into the css-editor modules layer.xml

    <folder name="Menu">
        <folder name="Refactoring">
	    <file name="RenameAction.shadow_hidden"/>
        </folder>
    </folder>

And the Rename sub-menu item disappears.  Alas of course it also disappears from the Refactor sub-menu of all files, but this at least proves that I've found where the entry comes from.

Is there a recommended means of making classes such as RefactoringSubMenuAction aware of the current files file-type?
Comment 6 Marek Fukala 2010-03-16 13:02:21 UTC
I'm sorry dynamite, that I haven't closed the issue and let you work on it. I've already resolved the issue when implementing refactorings for css files in Netbeans 6.9 Milestone 1.
Comment 7 Jiri Kovalsky 2010-03-16 13:09:33 UTC
OK, can you please at least confirm that Daniel's intention was correct? Thanks.
Comment 8 Marek Fukala 2010-03-16 13:16:23 UTC
As for the proposed dynamite's solution - the findings and the proposed fix was basically correct. 

The final solution is quite different though - the CSL's instant rename action is not automatically registered into the languages' popup menu, and the module must do it explicitly if it wants. For most file types (css, html, jsp, php...) this is not necessary because there's the default refactoring popup action generated by the RSMEditorAction. The original instant rename action is accessible only via a shortcut and delegates to the default rename refactoring if there is nothing to instant rename.

So as for the proposed fix, it was basically correct given the 6.8 state of code if the rename action instance hiding was done only for css mimetype and not generally.
Comment 9 Jiri Kovalsky 2010-03-16 13:40:28 UTC
OK, thanks Marku. I consider Daniel's solution as accepted then.
Comment 10 Jindrich Sedek 2010-03-25 09:13:30 UTC
v.