Revision: 1736
          http://svn.sourceforge.net/spring-rich-c/?rev=1736&view=rev
Author:   peterdb
Date:     2007-03-22 02:50:03 -0700 (Thu, 22 Mar 2007)

Log Message:
-----------
make the next logical frame the active one (skipping iconified frames)

Modified Paths:
--------------
    
trunk/spring-richclient/sandbox/src/main/java/org/springframework/richclient/application/mdi/DesktopApplicationPage.java

Modified: 
trunk/spring-richclient/sandbox/src/main/java/org/springframework/richclient/application/mdi/DesktopApplicationPage.java
===================================================================
--- 
trunk/spring-richclient/sandbox/src/main/java/org/springframework/richclient/application/mdi/DesktopApplicationPage.java
    2007-03-22 08:40:13 UTC (rev 1735)
+++ 
trunk/spring-richclient/sandbox/src/main/java/org/springframework/richclient/application/mdi/DesktopApplicationPage.java
    2007-03-22 09:50:03 UTC (rev 1736)
@@ -163,11 +163,16 @@
      * Overridden so it will leave iconified frames iconified.
      */
     protected void setActiveComponent() {
-        for(Iterator iter = getPageComponents().iterator(); iter.hasNext();) {
-            PageComponent component = (PageComponent) iter.next();
-
-            if(!getInternalFrame(component).isIcon()) {
-                setActiveComponent(component);
+        // getAllFrames returns the frames in z-order (i.e. the first one in 
the list is the last one used)
+        JInternalFrame[] frames = control.getAllFrames();
+        for( int i = 0; i < frames.length; i++ ) {
+            JInternalFrame frame = frames[i];
+            if(!frame.isIcon()) {
+                try {
+                    frame.setSelected( true );
+                } catch( PropertyVetoException ignore ) {
+                    
+                }
                 break;
             }
         }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
spring-rich-c-cvs mailing list
spring-rich-c-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs

Reply via email to