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 FileMenu.java
Date Fri, 02 May 2003 04:28:24 GMT
psmith      2003/05/01 21:28:24

  Modified:    src/java/org/apache/log4j/chainsaw FileMenu.java
  Log:
  provided accessor methods for the actions, so toolbars etc
  can reuse them
  
  Revision  Changes    Path
  1.3       +18 -6     jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/FileMenu.java
  
  Index: FileMenu.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/FileMenu.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileMenu.java	1 May 2003 04:50:25 -0000	1.2
  +++ FileMenu.java	2 May 2003 04:28:24 -0000	1.3
  @@ -25,16 +25,22 @@
      */
   class FileMenu extends JMenu {
   
  -
  +  private Action closeAction;
  +  private Action exitAction;
  +  private Action loadAction;
  +  private Action saveAction;
  +  
     public FileMenu(final LogUI logUI) {
       super("File");
       setMnemonic(KeyEvent.VK_F);
       
  -
  -    JMenuItem loadFile = new JMenuItem(new FileLoadAction(logUI));
  -    JMenuItem saveFile = new JMenuItem(new FileSaveAction(logUI));
  +    loadAction = new FileLoadAction(logUI);
  +    saveAction = new FileSaveAction(logUI);
  +    
  +    JMenuItem loadFile = new JMenuItem(loadAction);
  +    JMenuItem saveFile = new JMenuItem(saveAction);
       
  -    Action closeAction = new AbstractAction() {
  +    closeAction = new AbstractAction() {
         public void actionPerformed(ActionEvent e) {
           JPanel somepanel = (JPanel) logUI.tabbedPane.getSelectedComponent();
   
  @@ -51,7 +57,7 @@
       
       JMenuItem menuItemClose = new JMenuItem(closeAction);
       
  -    Action exitAction = new AbstractAction() {
  +    exitAction = new AbstractAction() {
   
         public void actionPerformed(ActionEvent e) {
           System.exit(0);
  @@ -71,4 +77,10 @@
       add(new JSeparator());
       add(menuItemExit);
     }
  +  
  +  Action getFileOpenAction() { return loadAction;}
  +  Action getFileSaveAction() { return saveAction;}
  +  Action getExitAction() { return exitAction;}
  +  Action getCloseWelcomeAction() { return closeAction;}
  +  
   }
  
  
  

---------------------------------------------------------------------
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