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 45652

Summary: [GTK L&F] Unable to add a folder to Favorites
Product: platform Reporter: Antonin Nebuzelsky <anebuzelsky>
Component: FavoritesAssignee: mslama <mslama>
Status: RESOLVED WONTFIX    
Severity: blocker CC: jchalupa, tboudreau, ttran
Priority: P3 Keywords: RELNOTE
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Simple test app to reproduce problem

Description Antonin Nebuzelsky 2004-06-28 16:08:31 UTC
You cannot add a folder to Favorites using the Add
to Favorites dialog on Linux with GTK L&F. If you
select a folder in the dialog and click Add (or
press Enter, or double-click the folder) you
always get into the folder instead of closing the
dialog and adding it to Favorites.
Comment 1 Antonin Nebuzelsky 2004-06-28 16:10:00 UTC
I found a workaround - writing the folder name manually in the
Selection field of the dialog and pressing Add button does the trick.
Comment 2 mslama 2004-06-29 13:37:13 UTC
JFileChooser ignores
setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES) on GTK L&F.
It works fine on Metal L&F. On GTK JFileChooser enters folder instead
of selecting it and returning after approve button is pressed. I
attach slightly modified FileChooserDemo.java to demonstrate this
problem. I tested it with JDK 1.5.0 build 57, Linux RH 9.

java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
FileChooserDemo

Bug is filed to Bugtraq as #5069423.
Comment 3 mslama 2004-06-29 13:38:02 UTC
Created attachment 16057 [details]
Simple test app to reproduce problem
Comment 4 mslama 2004-06-29 13:39:13 UTC
Closing this issue. Filed against JDK.
Comment 5 _ tboudreau 2004-07-01 23:16:09 UTC
Please update this issue when we know if the JFileChooser issue will be fixed in 1.5 FCS.  If 
it is not, this issue could be a blocker for making GTK L&F the default on Linux - if this 
issue is closed, it has a good chance of being forgotten when we make that decision.
Comment 6 mslama 2004-07-09 10:33:43 UTC
Ok. Reopening to keep track of bugtraq issue.
Comment 7 mslama 2004-08-24 09:36:03 UTC
This is committed to fix in mustang - next JDK release ie. not in JDK
1.5.0 FCS. What to do with this issue? Leave it open or close as
WONTFIX? Probably we should keep list of JDK issues somewhere.
Comment 8 _ tboudreau 2004-08-24 12:15:19 UTC
May still be worth trying to escalate.

You could put in a workaround, i.e.
if ("GTK".equals(UIManager.getLookAndFeel().getID()) {
   fileChooser.setUI (MetalFileChooserUI.createUI(filechooser);
}

and limit it also to 1.5.0 FCS.
Comment 9 mslama 2004-12-23 10:47:58 UTC
Fix is planned for JDK 1.6. Honza do we want to escalate this issue to
be fixed earlier?
Comment 10 mslama 2004-12-23 10:49:39 UTC
I set TM to future to keep it opened for tracking.
Comment 11 Tomas Danek 2005-07-21 11:09:03 UTC
I was not able to reproduce this:(

/space/netbeans-4.2dev/bin$./netbeans --laf
com.sun.java.swing.plaf.gtk.GTKLookAndFeel --jdkhome /space/jdk1.5.0_02/
-------------------------------------------------------------------------------
>Log Session: Thursday, July 21, 2005 12:04:16 PM CEST
>System Info: 
  Product Version       = NetBeans IDE Dev (Build 200507191800)
  Operating System      = SunOS version 5.9 running on sparc
  Java; VM; Vendor      = 1.5.0_02; Java HotSpot(TM) Client VM 1.5.0_02-b09; Sun
Microsystems Inc.

on JDK 1.6 it also works ok! I suppose this works ok now, and if no other
comments, i'll close this bug!
Comment 12 mslama 2005-07-29 19:32:27 UTC
It works for me now on FC2/Gnome GTK L&F on JDK 1.5.0_04 and JDK 1.6.0 build 44.
(Though relevant bugs in Bugtraq are not yet fixed #5069423 and #5090726.)
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5090726
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5069423

Feel free to reopen if you find any problem.
I started current IDE dev build with 
--laf com.sun.java.swing.plaf.gtk.GTKLookAndFeel
Comment 13 mslama 2005-07-29 19:43:34 UTC
According to note in #5090726 there is new File chooser in Gnome 2.6/GTK 2.4.0
which is FC2 case. Last time I checked it was on RH9 but I do not have access to
that amchine. It would be good if someone could make more tests even on older
Gnome and perhaps newer Gnome (FC3 or newer). And of course please report also
Gnome/GTK version. (GTK version can be found in
/usr/local/lib/pkgconfig/gtk+-2.0.pc, Gnome version is displayed in Help->About
dialog in any Gnome system application.)