Ticket #1589: LafPreference.diff
File LafPreference.diff, 1.4 KB (added by , 16 years ago) |
---|
-
src/org/openstreetmap/josm/gui/preferences/LafPreference.java
4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 6 import java.awt.Component; 7 import java.lang.reflect.*; 7 8 8 9 import javax.swing.DefaultListCellRenderer; 9 10 import javax.swing.JComboBox; … … 26 27 public void addGui(PreferenceDialog gui) { 27 28 lafCombo = new JComboBox(UIManager.getInstalledLookAndFeels()); 28 29 30 if (Main.withOSXIntegration) { 31 try { 32 // let's try to load the QuaQua LookAndFeel and put it into the list 33 Class Cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel"); 34 Object Oquaqua = Cquaqua.getConstructor((Class[])null).newInstance((Object[])null); 35 // no exception? Then Go! 36 lafCombo.addItem( 37 new UIManager.LookAndFeelInfo(((javax.swing.LookAndFeel)Oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel") 38 ); 39 } catch (Exception ex) { 40 // just ignore, Quaqua may not even be installed... 41 //System.out.println("Failed to load Quaqua: " + ex); 42 } 43 } 44 29 45 String laf = Main.pref.get("laf"); 30 46 for (int i = 0; i < lafCombo.getItemCount(); ++i) { 31 47 if (((LookAndFeelInfo)lafCombo.getItemAt(i)).getClassName().equals(laf)) {