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 49998 - [40cat] There is no way to select a subfolder in add to favorites dialog
Summary: [40cat] There is no way to select a subfolder in add to favorites dialog
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Favorites (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: mslama
URL:
Keywords:
: 49733 50594 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-06 11:10 UTC by vanob
Modified: 2008-12-22 10:35 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 vanob 2004-10-06 11:10:14 UTC
[ BUILD # : 200409220845 ]
[ JDK VERSION : J2SE 1.5.0 ]

1. Start with empty userdir
2. Press Ctrl+3 (Favourites window)
3. Press Shift+F10
4. Press Add To Favourites
5. In the dialog There is not way to step into the
folder.

If you press enter it adds the selected folder to
the favourites
need an ability to look into the folder
Comment 1 psuk 2004-10-25 13:57:20 UTC
Changing comp+subcomp
Comment 2 Petr Hrebejk 2004-10-25 16:27:05 UTC
Well, I really fear that this is the default behavior (not sayng that
correct one) of JFileChooser which permits to select directories. You
have to double-click the folder. Thus a JDK bug.


Comment 3 Petr Hrebejk 2004-10-25 16:27:47 UTC
x
Comment 4 mslama 2004-10-25 16:46:00 UTC
What L&F? On GTK L&F it is known bug of JFileChooser.
Comment 5 mslama 2004-10-25 17:26:56 UTC
From Summary I thought you cannot select and add folder to Favorites
but  in description you say you cannot enter folder in JFileChooser
using Enter. These are 2 different problems. First is problem on GTK
L&F as I said. Second problem is default behavior of JFileChooser as
Petr mentioned above.
Comment 6 vanob 2004-10-26 06:58:07 UTC
I don't use GTK L&F. I use ocean.
I don't think this bug relates to JFileChooser bug
either because for example in File Open dialog
I can look into folders without a problem.

IMO Enter keypress is overridden by the add button.
That's why I cannot step into the folders.
And with the keyboard there is no other way to achieve this.
Comment 7 mslama 2004-10-26 09:58:05 UTC
Probably you did not read my comment carefully enough. So again:

JFileChooser has 3 possible modes set using method setFileSelectionMode:
FILES_ONLY (default)
DIRECTORIES_ONLY
FILES_AND_DIRECTORIES

If FILES_ONLY is used Enter enters directory. If the other 2 are used
(ie. directory can be selected) Enter selects folder marked in list
view ie. it is like press approve button. It means it does NOT enter
directory. It is behaviour of JFileChooser depending on selected
chooser mode. Is it clear enough now?

As JFileChooser is able to add both files and folders to Favorites it
is set to FILES_AND_DIRECTORIES selection mode.
Comment 8 vanob 2004-10-26 10:13:30 UTC
Yes it's clear now.
Can we workaround the issue somehow?

For example make the selection mode FILES_ONLY
and add the button "add current dir" or something
that will add the directory we are in.

I just want to use the IDE only with keyboard.
But if it's not possible mouse double click
is not a problem in this particular case.
Comment 9 mslama 2004-10-26 10:26:18 UTC
To solve this we would have to hack current JFileChooser and use it
everywhere or use our own file chooser. I will pass this issue to HIE
to evaluate and decide what to do. The best way would be to file or
vote (it it exists) for it in Swing/JDK.
Comment 10 mslama 2004-10-26 10:27:54 UTC
Jano please check this. It is accessibility problem with JFileChooser
with DIR chooser mode. Enter works as approval and not as enter dir as
in FILES chooser mode. Thanks.
Comment 11 Tomas Zezula 2004-10-26 15:21:20 UTC
*** Issue 49733 has been marked as a duplicate of this issue. ***
Comment 12 Jesse Glick 2004-10-27 00:46:42 UTC
Applicable to any file chooser in the IDE that asks for folders, I guess.
Comment 13 mslama 2004-10-27 10:24:52 UTC
Data editors use hacked JFileChooser created by
org.netbeans.beaninfo.editors.FileEditor.createHackedFileChooser() to
fix this issue in wizards in NB 3.3.1. (Not part of API - see issue
#18270.)
Comment 14 jrojcek 2004-10-27 20:57:22 UTC
*** Issue 50594 has been marked as a duplicate of this issue. ***
Comment 15 jrojcek 2007-10-17 12:42:01 UTC
We have a special directory chooser we're using for Open Project dialog. The same directory chooser would fix this issue.
Comment 16 David Simonek 2007-10-17 13:27:56 UTC
Yes, in 6.0 we have our own tree-based directory chooser UI which allows to drill down the folders using right arrow or
tree expand click or by directory name completion in text field.
Comment 17 mslama 2007-10-17 15:00:41 UTC
Dafe in Favorites it shoudld be possible to select *BOTH* files and folders so we still use JFileChooser. If we use our
custom directory chooser we cannot add file to favorites so this is not solved yet. AFAIK Swing improved behavior. I
will check again with last JDK update.
Comment 18 David Simonek 2007-10-17 15:24:07 UTC
Aha, sorry, we don't use our custom UI for "files and folders" mode...
Comment 19 Jesse Glick 2007-10-17 19:05:34 UTC
BTW Quick Filechooser (on dev AU) does not suffer from this issue.
Comment 20 Lukas Hasik 2008-04-10 21:23:43 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 21 mslama 2008-06-27 12:46:27 UTC
On Metal L&F Ctrl-Enter enters directory. On GTK L&F IDE uses Metal UI for JFileChooser. I just tested GTK JFileChooser
ie. GTK UI and Ctrl-Enter works there as expected.

Question to Jano: Is it not time now to stop using Metal UI for JFileChooser on GTK L&F? (I have no idea why Ctrl-Enter
does not work on GTK L&F for Metal UI JFileChooser.)
Comment 22 mslama 2008-06-27 14:45:32 UTC
Fixed for GTK L&F JFileChooser. I added Ctrl-ENTER into JFileChooser input map. 5e7207ea1d7c
Comment 23 mslama 2008-06-27 14:46:33 UTC
Question if we should use GTK UI for JFileChooser on GTK L&F is still valid.
Comment 24 jrojcek 2008-06-30 16:11:06 UTC
I'm not really sure why the IDE shows the file chooser in Metal if the whole IDE runs with GTK L&F. Using the GTK L&F is the right thing to do from UI 
perspective. Maybe there was some bug with the GTK file chooser, so we switched it to Metal?
Comment 25 mslama 2008-06-30 16:36:08 UTC
Yes GTK UI of JFileChooser was not good in JDK 5. For JDK 6u1 and newer (we use GTK L&F as deafult for them) it should
be ok. So I will set GTK UI for JFileChooser in IDE and wait for feedback. I filed issue #138648.
Comment 26 Quality Engineering 2008-07-02 15:38:52 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #295 build
Changeset: http://hg.netbeans.org/main/rev/5e7207ea1d7c
User: Marek Slama <mslama@netbeans.org>
Log: #49998: Add Ctrl-ENTER to input map of JFileChooser on GTK L&F.