logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From psm...@apache.org
Subject cvs commit: jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw LogUI.java
Date Fri, 02 May 2003 05:14:28 GMT
psmith      2003/05/01 22:14:28

  Modified:    src/java/org/apache/log4j/chainsaw LogUI.java
  Log:
  Moved Toolbar back to standard North position, and locked it in place.
  
  Add a Lock/Unlock toolbar action to the View menu.
  
  Revision  Changes    Path
  1.16      +26 -4     jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/LogUI.java
  
  Index: LogUI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/LogUI.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- LogUI.java	2 May 2003 04:43:51 -0000	1.15
  +++ LogUI.java	2 May 2003 05:14:27 -0000	1.16
  @@ -200,7 +200,7 @@
           } else {
             runnable = new Runnable() {
               public void run() {
  -              getContentPane().add(removeToolbarComponent, BorderLayout.WEST);
  +              getContentPane().add(removeToolbarComponent, BorderLayout.NORTH);
                 getRootPane().repaint();
                 getRootPane().revalidate();
               }
  @@ -213,7 +213,29 @@
       
       JCheckBoxMenuItem showToolbarCheck = new JCheckBoxMenuItem(toggleToolbarAction);
       showToolbarCheck.setSelected(true);
  +    
  +    final JToolBar theToolbar = toolbar;
  +    Action lockToolbarAction = new AbstractAction("Lock Toolbar") {
  +      private boolean lock = true;
  +      public void actionPerformed(ActionEvent e) {
  +        lock = !lock;
  +        final boolean isLocked = lock;
  +         Runnable runnable = null;
  +          runnable = new Runnable() {
  +            public void run() {
  +              toolbar.setFloatable(!isLocked);
  +              toolbar.repaint();
  +            }
  +          };
  +        SwingUtilities.invokeLater(runnable);
  +      }
  +    };    
  +    JCheckBoxMenuItem lockToolbarCheck = new JCheckBoxMenuItem(lockToolbarAction);
  +    lockToolbarCheck.setSelected(true);
  +    
       viewMenu.add(showToolbarCheck);
  +    viewMenu.add(lockToolbarCheck);
  +    
       /**
        * -== End of Show/Hide toolbar
        */
  @@ -234,8 +256,8 @@
      * @param fileMenu need the filemenu to extract the Open/Save actions
      */
     private void createToolbar(FileMenu fileMenu) {
  -    toolbar = new JToolBar(JToolBar.VERTICAL);
  -    toolbar.setFloatable(true);
  +    toolbar = new JToolBar(JToolBar.HORIZONTAL);
  +    toolbar.setFloatable(false);
       toolbar.setRollover(false);
       
       Insets buttonMargins = new Insets(1,1,1,1);
  @@ -334,7 +356,7 @@
       tabbedPane.add("Welcome", new WelcomePanel());
       panePanel.add(tabbedPane);
   
  -    getContentPane().add(toolbar, BorderLayout.WEST);
  +    getContentPane().add(toolbar, BorderLayout.NORTH);
       getContentPane().add(panePanel, BorderLayout.CENTER);
   
       addWindowListener(
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


Mime
View raw message