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 7230

Summary: Some tools actions are not correctly disabled if no node is activated.
Product: projects Reporter: iformanek <iformanek>
Component: Generic InfrastructureAssignee: Martin Ryzl <mryzl>
Status: CLOSED FIXED    
Severity: normal CC: mmetelka
Priority: P1    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description iformanek 2000-08-02 09:44:37 UTC
This happens either on the first startup or if I go to explorer, and deselect
any selected nodes. Next, in the Tools menu, there are 2 actions: "Add to
Project" and "Update parser database" which do not work.

This is especially annoying for the first time users, who start the ide for the
first time and go to see what are the menu items, and these two are erratical.
Comment 1 iformanek 2000-08-02 10:02:59 UTC
The enable() methods in these actions do not check for empty array of activated
nodes, and return true in such case:
    (from Editor's JCUpdateAction)
    protected boolean enable(Node[] activatedNodes) {
        boolean ok = true;
        for (int i = 0; i < activatedNodes.length; i++) {
            if (activatedNodes[i].getCookie(DataFolder.class) == null) {
                ok = false;
                break;
            }
        }
        return ok;
    }

These are really 2 separate bugs - one in Projects, on in Editor module, but as
the fix is simple, will keep both here.
Comment 2 Miloslav Metelka 2000-08-02 10:14:59 UTC
I have partly fixed this bug by fixing the editor part in JCUpdateAction.
Comment 3 Jaroslav Tulach 2000-08-02 17:36:59 UTC
Martin can you fix the "Add to project" action?
Comment 4 Quality Engineering 2003-07-01 14:17:43 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.