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.
1. Start NetBeans with a fresh userdir using "netbeans --open <filename>". The file will be opened in NetBeans. 2. Right-click the file and choose Select In -> 3. Neither of the three options (Projects, Files, Favorites) does anything. (That is, unless the file is under your home, in which case Favorites works.) I would expect that there will be at least one options that always works. The other options should be disabled.
Starting NB with such option is edge case, so that's fine, but "Select In" doesn't work even if file is opened through Open File... action from menu, which is worse. Projects and Files view are tied to projects, so they are out of competition. Perhaps Favorites view could "auto mount" folder in which opened file lives if it's not in Favorites already. Passing to favorites module owner.
> Perhaps Favorites view could "auto mount" folder in which opened file lives if it's not in Favorites already. Makes sense to me. Favorites view could also be fronted in Explorer iff the "auto mount" happens.
Well, I think an even better way would be to ask the user which directory she wants to mount: whether the containing directory, or a parent of this directory, or a parent of the parent, or... Otherwise the user could end up with multiple directories mounted which are ancestors of each other. Also cc'ing Jano.
First of all to make this work properly we really need to disable the other Select items: "Projects" and "Files", if the file doesn't belong to any project. Otherwise users may not even get to the Favorite item if the other two don't work (and they are enabled). If the file isn't in Favorites, we could simply show the existing "Add to Favorites" file chooser with the file preselected. I guess users would soon figure out what is Favorites about and how it works. To make it more obvious (and probably also cleaner from UI perspective), we would first show a question message something like: --- The "<filename.txt>" is not yet added in Favorites window. Do you want to add the file or its parent folder now? [ Add Parent Folder... ] [[ Add File ]] [ Cancel ] --- I think I like the question message better.
Marku, can you comment?
We discussed when we should ask user about adding file to Favorites. We found 2 possibilities: 1.After IDE start. 2.Once user invokes Select in Favorites. 1.It would not work well when more than one file is opened. 2.When user invokes Select in Favorites and file is not found in Favorites we open Add to Favorites dialog. It is actually JFileChooser so user can select what to add to Favorites so probably it would be enough to use default Add to Favorites dialog without modification. IMO it is better to keep it simple. Please file separate issue for disabling Select in Projects and Select in Files. It had nothing to do with Favorites.
> Please file separate issue for disabling Select in Projects and Select in Files. Done, see issue 138646.
Your proposal #2 sounds reasonable to me. If you open the file chooser, select the actual file in it for the user.
Agreed with option #2, I think this should have been done a long time ago actually.
Fixed in core-main 73563ba6cb88
It does not work correctly for me. When I do Select in Favorites on a file that is not contained in Favorites, a dialog is open prompting me to add a directory to Favorites, but when I do that, the Favorites view is still not expanded correctly and the file is not selected. On a second attempt it works. I am using deadlock build 2900 on Mac OS X 10.4, JDK 5.
the file should be selected after the user adds a directory to favorites. Now it seems that the Select in action is interupted
Marku, this must be easy to fix IMO. Right?
It is clear what directory/folder are you talking about. Please give exact steps you do and actual/expected result. If you invoke Select in Favorites on file in editor which is not in any opened project File chooser will be opened and this file is selected in file chooser. If you select Add now new root node alias Favorites link is created in Favorites tab and is selected (at least on Linux/Gnome/GTK). If you do anything else you must say it. In this use case there is NO folder, no folder expansion,.... I will check on Mac if it is some Mac specific behavior.
It is NOT clear what directory/folder are you talking about. Please give exact steps you do and actual/expected result. If you invoke Select in Favorites on file in editor which is not in any opened project File chooser will be opened and this file is selected in file chooser. If you select Add now new root node alias Favorites link is created in Favorites tab and is selected (at least on Linux/Gnome/GTK). If you do anything else you must say it. In this use case there is NO folder, no folder expansion,.... I will check on Mac if it is some Mac specific behavior.
I just checked on Mac and yes it does not work as expected. FileChooser on Mac is 'special'. It does not contain "File name:" edit box and JFileChooser.setSelectedFile is ignored. If I select manually any file/directory from this file chooser and press Add then it is added to Favorites and selected. I do not see any problem you describe. So please come and show me what does not work for you. I used my own fresh today build 080926 with latest JDK update 1.5.0_16-133.