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.
IDE built from today's CVS, jdk 1.5.0 b50, Bluecurve Usually the property sheet shows a small turner icon left to the caption of a section on the property sheet. When the user clicks on it, the section is collapsed. On GTK L&F that turner is not visible
Created attachment 14762 [details] Property sheet on GTK LaF
JDK bug 5043327, UIManager.get("Tree.collapsedIcon")/expandedIcon retruns null. We'll probably have to create our own tree icon for it for 4.0.
perhaps just stealing the triangle little icons from GTK tree control ans use them when we get null would be good enough
That's what we do for every other look and feel; for GTK the icon per se doesn't exist, at least not in a form we can access it :-/
sorry I wasn't clear, by "stealing" I meant copying the images using Gimp or something
FWIW, I'm advised by the JDK team that there is an icon there, it just has a size of -1. And indeed, it is. So I've committed code to use it and paint it (wrapping it in a wrapper icon that returns a reasonable value). However, nothing paints on b56. Will try to figure out what the problem might be.
GTK L&F will not be supported for promo D -> Future.
-> P3
As I've been investigating issue 50494 and using Linux as the main platform I found workaround for this one :) See the following patch. Code is based on the com.sun.java.swing.plaf.gtk.GTKEngine. I know it's ugly workaround but it works. Furthermore I'm not sure if we want another such a hack to the Netbeans code as I found few of them in the current code. There may be better solution but I don't understand everything in the JDK code (yet :) ). So consider the patch please (Tim or Dave) and eventually reassign the issue. I think, we should apply it and watch the JDK bug closely to switch back to "clean" code when the JDK bug is fixed.
Created attachment 18472 [details] gtk workaround
Ups, replace the lines for GTKLookAndFeel checking with if ("com.sun.java.swing.plaf.gtk.GTKLookAndFeel".equals( UIManager.getLookAndFeel().getClass().getName())) { as (e.g.) Windows know nothing about GTKLookAndFeel. I'm assigning the bug to me as I should retake as much of Tim's UI issues as I can. Take it back Tim, if you want :). But still I'll appreciate yours comments - use or not? I'm still new and not so sure where is the level of code "ugliness" of netbeans.
Looks fine to me. Since we're not officially supporting GTK for 4.0 (last I heard), up to you whether to integrate it in 4.0 or wait for 4.1. No harm integrating it now, given that the code there now doesn't work (it was supposed to eventually in some 1.5 build - I was told that the icon was there, but didn't have a correct size until it had been painted once). I'd say go ahead and integrate it.
Instead of if ("com.sun.java.swing.plaf.gtk.GTKLookAndFeel".equals( UIManager.getLookAndFeel().getClass().getName())) { try if ("GTK".equals(UIManager.getLookAndFeel().getID()) Should be safer if they change the package or class name at some point. BTW, the icon could be moved to org.netbeans.swing.plaf.gtk.GtkLFCustoms and put into UIManager that way - the property sheet code would be a little cleaner.
Ok, thanks for the suggestion. What I found is that icon dissapear when the component is "highlighted" (mouse over). Try this code: import java.awt.FlowLayout; import javax.swing.*; public class TestGTKIcon extends javax.swing.JFrame { public TestGTKIcon() throws Exception { UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); setLayout(new FlowLayout()); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); Icon exp = UIManager.getIcon("Tree.expandedIcon"); add(new JButton(exp)); add(new JLabel(exp)); pack(); } public static void main(String args[]) throws Exception { new TestGTKIcon().setVisible(true); } }
Checking in core/swing/plaf/src/org/netbeans/swing/plaf/gtk/GtkLFCustoms.java; /cvs/core/swing/plaf/src/org/netbeans/swing/plaf/gtk/GtkLFCustoms.java,v <-- GtkLFCustoms.java new revision: 1.10; previous revision: 1.9
closing