You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by le...@apache.org on 2002/03/05 05:14:06 UTC
cvs commit: jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/altprofile/profiler/gui MenuBar.java
leif 02/03/04 20:14:06
Modified: src/scratchpad/org/apache/avalon/excalibur/altprofile/profiler/gui
MenuBar.java
Log:
Added a Close All menu choice to the Window menu.
Revision Changes Path
1.2 +27 -1 jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/altprofile/profiler/gui/MenuBar.java
Index: MenuBar.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/altprofile/profiler/gui/MenuBar.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MenuBar.java 3 Mar 2002 15:59:44 -0000 1.1
+++ MenuBar.java 5 Mar 2002 04:14:06 -0000 1.2
@@ -29,7 +29,7 @@
/**
*
* @author <a href="mailto:leif@silveregg.co.jp">Leif Mortenson</a>
- * @version CVS $Revision: 1.1 $ $Date: 2002/03/03 15:59:44 $
+ * @version CVS $Revision: 1.2 $ $Date: 2002/03/05 04:14:06 $
* @since 4.1
*/
public class MenuBar
@@ -292,7 +292,33 @@
{
m_menuWindow.removeAll();
+ // Close All menu choice
+ Action closeAllAction = new AbstractAction( "Close All" )
+ {
+ public void actionPerformed( ActionEvent event )
+ {
+ JInternalFrame[] frames = m_frame.getDesktopPane().getAllFrames();
+ for ( int i = 0; i < frames.length; i++ )
+ {
+ frames[i].setVisible( false );
+ frames[i].dispose();
+ }
+ }
+ };
+
+ JMenuItem closeAll = new JMenuItem( closeAllAction );
+ closeAll.setMnemonic( 'o' );
+ m_menuWindow.add( closeAll );
+
+
+ // List up all of the visible frames.
JInternalFrame[] frames = m_frame.getDesktopPane().getAllFrames();
+
+ if ( frames.length > 0 )
+ {
+ m_menuWindow.addSeparator();
+ }
+
for ( int i = 0; i < frames.length; i++ )
{
String label = ( i + 1 ) + " " + frames[i].getTitle();
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>