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 137172 - File opened using the command line switch is not accessible from the explorer
Summary: File opened using the command line switch is not accessible from the explorer
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Favorites (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: mslama
URL:
Keywords: UI, USABILITY
Depends on:
Blocks:
 
Reported: 2008-06-13 14:15 UTC by Petr Jiricka
Modified: 2010-07-28 07:08 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2008-06-13 14:15:28 UTC
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.
Comment 1 David Simonek 2008-06-18 13:11:29 UTC
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.
Comment 2 Antonin Nebuzelsky 2008-06-19 15:50:58 UTC
> 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.

Comment 3 Petr Jiricka 2008-06-19 16:12:39 UTC
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.
Comment 4 jrojcek 2008-06-26 10:40:42 UTC
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.

Comment 5 Antonin Nebuzelsky 2008-06-29 23:45:00 UTC
Marku, can you comment?
Comment 6 mslama 2008-06-30 09:42:57 UTC
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.
Comment 7 Petr Jiricka 2008-06-30 16:16:51 UTC
> Please file separate issue for disabling Select in Projects and Select in Files.

Done, see issue 138646.
Comment 8 jrojcek 2008-07-01 13:44:32 UTC
Your proposal #2 sounds reasonable to me. If you open the file chooser, select the actual file in it for the user.
Comment 9 Jesse Glick 2008-07-11 15:28:31 UTC
Agreed with option #2, I think this should have been done a long time ago actually.
Comment 10 mslama 2008-07-16 17:13:46 UTC
Fixed in core-main 73563ba6cb88
Comment 11 Petr Jiricka 2008-07-18 09:44:51 UTC
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.
Comment 12 Lukas Hasik 2008-09-09 18:11:34 UTC
the file should be selected after the user adds a directory to favorites. Now it seems that the Select in action is 
interupted 
Comment 13 Antonin Nebuzelsky 2008-09-26 13:14:07 UTC
Marku, this must be easy to fix IMO. Right?
Comment 14 mslama 2008-09-26 13:50:54 UTC
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.
Comment 15 mslama 2008-09-26 13:51:01 UTC
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.
Comment 16 mslama 2008-09-26 14:29:05 UTC
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.