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.
In Eclipse there is a handy option you can turn on that keeps the Projects/Files windows (that's not what they're called in Eclipse, but they are equivalent to those NB windows) in sync with the current selection in the editor. In NetBeans, I have to keep pressing Ctrl-Shift-1 and Ctrl-Shift-2 to get the same behavior. This is annoying. Several Eclipse users have commented that they would also like this feature. Note, it should probably also keep the Favorites window in sync, to avoid having to press Ctrl-Shift-3.
I am not sure users can benefit on synchroznizing all tree-based views with editor. We've implemented it this way, it's different. At least synchronization with Favorites view is impossible. Favorites window doesn't contain all files in the tree by default, it contains only home folder and your added pointers. Reassigne to projects, because Projects/Files view are in their responsibility.
>I am not sure users can benefit on synchroznizing all tree-based views with editor. I'm not sure I understand this comment. We've had multiple requests from Eclipse users who use this feature in Eclipse all the time. When they switch to NetBeans they want equivalent functionality. Naturally, by default it would be turned off. >We've implemented it this way, it's different. What exactly does "implemented it this way" mean? Are you saying that there is a specific reason that NetBeans does not have this feature? And what exactly is meant by "it's different"? What is different? The Eclipse Package Explorer and the NetBeans Project Window look equivalent to me. The Eclipse Navigator and the NetBeans Files Window also look equivalent. They have different names but they perform the same functions. >At least synchronization with Favorites view is impossible. That is correct for situations where the Favorites view does not contain the necessary folder(s). But if it did have the necessary folder, why couldn't it synchronize as well?
If we do it we should turn it on by default and make sure that it works right, not make it yet another hidden option.
Created attachment 28386 [details] Patch for Projects and Files tabs
Try the attached patch. It's quite simple. Notes: 1. Impl could probably be optimized somewhat. 1a. Listens for (its own) selection changes when focussed, but then has to ignore them. Couldn't find a better way, though - using componentActivated/Deactivated in addition to componentShowing/Hidden did not work out. 1b. Should cancel any running selection task when selection is changing rapidly. Currently just sends all selection jobs into RP to be processed whenever, which is not very good. 2. Makes C-S-1/2 (Select Node in > Projects/Files) redundant and useless. Just C-1/2 work as well. Meaning that some code in various parts of projectui could be deleted, incl. code to select newly created files - would be automatic anyway if they were opened in the editor. 3. Could easily be fixed to handle multiselections; currently only handles single selections. 4. Analogous patch for Favorites would probably not be hard. 5. Currently leaves deep trees expanded even after selection is moved away, which can lead to a mess after a while. Could consider collapsing all but the currently used tree after making an automated selection change. Or keeping track of expansions which were done automatically, and collapse only those expansions when selection changes again. 6. Patched behavior is fully consistent with the existing behavior of the Navigator window. Try opening both Projects and Navigator windows and do a Find Usages and step thru results with F12. You will see your selection tracked simultaneously in both windows. Anyway, something to play with and comment on. It seems like a step forward to me. I'm sure you can find some scenarios where automatic synchronization would be unwanted, but the question is whether these are really common enough to justify continuing to withhold this feature from our users (or making it a disabled option, which is nearly the same thing in practice). Note that a large number of our users have been asking for this feature in one form or another for essentially the entire existence of NetBeans, as can be seen by looking at the history of issue #7551, issue #18856, issue #6559, issue #35652, etc. etc.
*** Issue 71377 has been marked as a duplicate of this issue. ***
> 2. Makes C-S-1/2 (Select Node in > Projects/Files) redundant and useless. Just > C-1/2 work as well. Meaning that some code in various parts of projectui could > be deleted, incl. code to select newly created files - would be automatic > anyway if they were opened in the editor. Please don't do so. I used Eclipse for relatively long time in the past. I also liked that feature a lot. But probably the reason was that I din't have shortcuts like those C-S-1/2/3 in NetBeans. So I din't have another choice than to turning on and off the auto-sync feature. On the other side this meant that in any bigger project I had to use to a visual jumping/blinking of Navigator / Project Explorer whenever I pressed C-F6 (the same like C-Tab in NB) which was annoying. So after I "switched" ;) to NB what I really like was those shortcuts - C-S-1/2/3 which are much better (sure, IMHO). I think that the main reason is that Eclipse developers do not have those shortcuts (by default) or are not used to them. I'm heavily dependent shortcut user :) and really like those shortcuts. Please keep them - I believe they can easily coexist with this new feature (sure, they can be "turned off" when the user check auto-sync). PS: I don't know current shortcut/feature situation in Eclipse but not imporatnt in this case.
See also issue #61615.
*** Issue 108196 has been marked as a duplicate of this issue. ***
*** Issue 108021 has been marked as a duplicate of this issue. ***
*** Issue 113279 has been marked as a duplicate of this issue. ***
Making auto-sync'ing behaviour a preference, whilst keeping the ctrl+shift+1 etc. shortcuts would be ideal, I think. Personally, I would like to have the auto-syncing behaviour, but if it is made optional, not all users would have to put up with it. I'll give this a vote.
Please do not increase the Version field. It refers to the _oldest_ version for which the issue is known to be applicable.
*** Issue 123968 has been marked as a duplicate of this issue. ***
*** Issue 127029 has been marked as a duplicate of this issue. ***
*** Issue 134405 has been marked as a duplicate of this issue. ***
*** Issue 87061 has been marked as a duplicate of this issue. ***
Some UI Spec would be needed if we want to implement this feature. First of all I think that we cannot remove those shortcuts C/S/1-2. They have to stay there IMO. Eclipse way of turning the feature on/off seems to me easily accessible and discoverable. NetBeans doesn't have such a toolbar to provide some button so it would have to be probably in Navigate menu, something like "Synchronize selection" check box. HIE guys, please provide comments.
Other thing is that whether we want to have sync in both directions, as Eclipse does? Selecting (not double clicking) a node in Explorer would select the file in Editor.
Jesse, is 1b. still a valid concern?
*** Issue 72382 has been marked as a duplicate of this issue. ***
Reassigning to jrojcek to some HIE insight.
*** Issue 135897 has been marked as a duplicate of this issue. ***
UI spec does not seem to be needed as it is just a feature which can be on/off, i.e. it requires only one option. Location for the option to enable/disable synchronization has been added to permanent UI specification (http://wiki.netbeans.org/MainMenu). It is the view menu, below the "Show Versioning Labels" menu item. The permanent UI spec. assumes: 1) The option would be off by default (to keep current behavior for current users) 2) Current shortcuts would remain too. I assume this is all which is needed from HIE, so re-assigning back.
Integrated into 'main-golden', will be available in build *200811270201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/ab06cad09216 User: Milan Kubec <mkubec@netbeans.org> Log: #71319: synchronization of selected node between editor and Projects and Files views
Integrated into 'main-golden', will be available in build *200812070201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/1809ec7ce2b0 User: Lukas Hasik <lhasik@netbeans.org> Log: #71319: adding the new menu item to perm ui spec
i guess fixed..works fine, verified in 20081208