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 49144 - [40cat] Freeform UI messed up the context menu
Summary: [40cat] Freeform UI messed up the context menu
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks: 42682
  Show dependency tree
 
Reported: 2004-09-16 12:56 UTC by gugrim
Modified: 2006-03-24 09:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Project file with messed up context menu. (9.48 KB, text/plain)
2004-09-16 12:58 UTC, gugrim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gugrim 2004-09-16 12:56:29 UTC
[ BUILD # : 200409141800 ]
[ JDK VERSION : J2SE 1.4.2 ]

Opened Project Properties for a Freeform project and changed the target mapping for "Build Project" from "ear" to "make". Next time I called up the context menu for the project node I found a bunch of action names such as "compile.single" mixed with the normal menu items. After inspecting the project.xml file I found that all these actions had automatically been added the <context-menu> section. I'll attach the complete file.
Comment 1 gugrim 2004-09-16 12:58:02 UTC
Created attachment 17687 [details]
Project file with messed up context menu.
Comment 2 Jesse Glick 2004-09-16 14:38:25 UTC
David, whatever code you have to regenerate the context menu seems to
not know about context-sensitive actions. They should never be
included in the context menu.

Gunnar, note that the project properties dialog has a simplified model
of the project.xml format, and while it tries to avoid losing
hand-edited information, it is best to avoid using the dialog if you
have complex edits to project.xml that could not have been made from
the GUI, especially in the same areas as are manipulated by the dialog
panels you use. For example, in this case you have some hand-edited
context-sensitive actions, in the //ide-actions section, then you
opened the properties dialog and changed things that could affect both
//ide-actions and //view/context-menu. Updating //ide-actions from the
GUI is not problematic really, but when action mappings are changed
from the GUI, //view/context-menu is partially regenerated (to handle
changes you may have made in the GUI). This bug with context-sensitive
actions can be fixed, but you may still find that in
//view/context-menu (1) all ./action are put after all ./ide-action,
regardless of where you had them before, (2) ./separator (if there are
any) are just lumped together somewhere. Perhaps a future rewrite of
the project.xml modeling code will enable it to be friendlier to
manual edits.
Comment 3 David Konecny 2004-09-16 15:06:22 UTC
I see, will fix that.

Re. "but you may still find that in //view/context-menu (1) all
./action are put after all ./ide-action, regardless of where you had
them before, (2) ./separator (if there are any) are just lumped
together somewhere." - true. The similar case is also //view/items. 
Comment 4 David Konecny 2004-09-17 10:03:01 UTC
Fixed in:
src/org/netbeans/modules/ant/freeform/FreeformProjectGenerator.java;
new revision: 1.25; previous revision: 1.24
test/unit/src/org/netbeans/modules/ant/freeform/FreeformProjectGeneratorTest.java;
new revision: 1.11; previous revision: 1.10
Comment 5 Marian Mirilovic 2005-12-20 15:46:06 UTC
This issue was solved long time ago. Because nobody has reopened it neither
added comments, we are verifying/closing it now. 
If you are still able to reproduce the problem, please reopen. Thanks in advance.