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 141408

Summary: [65cat] Should display a warning in case there is no valid selection for a global project action
Product: projects Reporter: Michel Graciano <hmichel>
Component: Generic Projects UIAssignee: Jesse Glick <jglick>
Status: RESOLVED WONTFIX    
Severity: blocker CC: mmirilovic
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Michel Graciano 2008-07-23 19:33:34 UTC
[ BUILD # : 200807221016 ]
[ JDK VERSION : 1.6.0_07 ]

The new http://wiki.netbeans.org/MainProjectConceptualChange
definition has a fault. Nb must warning user when any project can be
defined when you try to Build or Run. Several times the focus is on
Output or Project window and I try to run the project and NOTHING
happens... the users that don't know about this behavior will really
think it strange, and experienced users as I don't like this
behavior.
I know that you will say that it is how was defined, but anyone,
AGAIN, ask me, the user, how I think NetBeans should works. Where is
the review about it? Maybe I lost the messages about it, so sorry...
but it should be redefined before 6.5 release.
BTW, the workaround to it is continue to use main project concept.
Comment 1 Lukas Hasik 2008-07-24 09:09:36 UTC
Ondro, could you comment?
Comment 2 Ondrej Langr 2008-07-24 10:14:34 UTC
Well .. I think the problem is in how the context is determined. 

If the focus is in Output window but a file is open in the editor, these actions should naturally work at the project
determined by the open file in editor. This applies for all other windows in which context can not be changed. 

When focus is in windows where context CAN be changed (projects window, files window, ..) the project the actions can be
run upon should be determined by selection from that window. I.e. if focus is in projects window and a project is
selected, these action should work on that project. If a file is selected, actions should be run upon the project this
file belongs to. 

If this worked correctly, the only situation when context COULD NOT be determined (that's the situation when "I try to
run the project and NOTHING happens...") is in awkward contexts like welcome screen and projects where build does not
exist (e.g. ruby projects) .. and in these cases silent behavior is IMO OK. If we wanted to spend extra effort, we could
provide status line warning that "This action does not work in current context" or "Please select project to run the
action at". It would be ideal solution, but if I remember correctly, I was told that it is not possible to have these
actions disabled but still provide error message if they are invoked by keyboard. 
Comment 3 Michel Graciano 2008-07-24 14:31:20 UTC
Not really. To reproduce my problem:
1-Open any project and files;
2-Normally the context can be defined (see the frame title with the project's name);
3-Windows as Output and another have the project defined yet;
3-Open Project window;
4-Remove the selection for the project
5-Nothing happen when click F11, F6 etc... even in Output window for example.

This is the point. I really like this feature, but the behavior about NO WARNING scare me. User really like to know what
is happen and, when nothing should/could happen, we like to know why to solve the issue. Please, a warning about no
context can be defined must be showed.
Comment 4 Tomas Danek 2008-09-09 13:58:50 UTC
I agree that the problem is in determination of context; If you have non-main project opened, in editor are opened it's
files, but focus is e.g. in output window (i'd say in every window but editor), the actions are disabled. The only ways
how to enable them is to
a) select project
2) focus in editor to file

BTW: why is this assigned to Lukas? is he supposed to fix this?:)
Comment 5 Milan Kubec 2008-09-25 11:10:59 UTC
As olangr noted in last paragraph of his comment, if the action is disabled when no project is in context then it's not
easily possible to do some action is user tries to invoke the (disabled) action. Active project is visible at first
glance on main window - its name is in window title, if there is none then project sensitive actions are disabled and do
nothing. Changing to enhancement if there will be some way in future.
Comment 6 Jesse Glick 2010-05-04 23:07:27 UTC
Project actions already act on the last selection if you give focus to e.g. the Output Window. The only case in which nothing should happen, assuming you have at least one project open: there are two or more projects open; none of them is set as the main project; and you have selected some node which is not a part of any of these projects, e.g. something in the Services tab. In such a case the action will be disabled. I don't think this is a serious problem.