psmith      2003/09/11 20:37:47

  Modified:    src/java/org/apache/log4j/chainsaw
                        ChainsawToolBarAndMenus.java
  Log:
  If the JDK 1.4.2 GTK+ 2.0 Look and Feel can be detected
  provide it as a L&F option.
  
  But it's not as good as I would have hoped.
  
  Revision  Changes    Path
  1.12      +25 -0     
jakarta-log4j/src/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java
  
  Index: ChainsawToolBarAndMenus.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ChainsawToolBarAndMenus.java      10 Sep 2003 23:03:07 -0000      1.11
  +++ ChainsawToolBarAndMenus.java      12 Sep 2003 03:37:47 -0000      1.12
  @@ -577,10 +577,35 @@
                 });
             }
           });
  +        
  + 
         lookAndFeelGroup.add(lfItemMenu);
         lookAndFeelMenu.add(lfItemMenu);
         lookAndFeelMenus.add(lfItemMenu);
       }
  +    
  +     try {
  +        final Class gtkLF = 
Class.forName("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
  +        final JRadioButtonMenuItem lfIGTK =
  +              new JRadioButtonMenuItem("GTK+ 2.0");
  +             lfIGTK.addActionListener(
  +              new ActionListener() {
  +                public void actionPerformed(ActionEvent e) {
  +                      SwingUtilities.invokeLater(
  +                        new Runnable() {
  +                              public void run() {
  +                                logui.setLookAndFeel(gtkLF.getName());
  +                              }
  +                        });
  +                }
  +              });
  +             lookAndFeelGroup.add(lfIGTK);
  +             lookAndFeelMenu.add(lfIGTK);
  +             lookAndFeelMenus.add(lfIGTK);
  +
  +   } catch (Exception e) {
  +        LogLog.debug("Can't find new GTK L&F, might be Windows, or <JDK1.4.2");
  +   }
   
       levelIconMenu.add(levelDisplayIcon);
       levelIconMenu.add(levelDisplayText);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to