tn5250j/src/org/tn5250j Gui5250Frame.java,1.21,1.22

"Kenneth J. Pouncey" <[email protected]> Mon, 05 Jul 2004 05:08:03 +0000
Newsgroups gmane.comp.java.tn5250j.cvs
Message-ID <[email protected]>
Update of /cvsroot/tn5250j/tn5250j/src/org/tn5250j
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32037/src/org/tn5250j

Modified Files:
	Gui5250Frame.java 
Log Message:
Changed to use the new tabbed pane that provides a closable (X)

Index: Gui5250Frame.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/Gui5250Frame.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** Gui5250Frame.java	30 Jun 2004 06:18:56 -0000	1.21
--- Gui5250Frame.java	5 Jul 2004 05:07:38 -0000	1.22
***************
*** 30,33 ****
--- 30,34 ----
  import javax.swing.*;
  import java.util.*;
+ 
  import javax.swing.event.ChangeListener;
  import javax.swing.event.ChangeEvent;
***************
*** 38,43 ****
--- 39,46 ----
  import org.tn5250j.event.SessionListener;
  import org.tn5250j.event.SessionChangeEvent;
+ import org.tn5250j.event.TabClosedListener;
  import org.tn5250j.interfaces.GUIViewInterface;
  import org.tn5250j.interfaces.ConfigureFactory;
+ import org.tn5250j.gui.TN5250jTabbedPane;
  
  public class Gui5250Frame extends GUIViewInterface implements
***************
*** 45,52 ****
                                                      TN5250jConstants,
                                                      SessionListener,
                                                      SessionJumpListener {
  
     BorderLayout borderLayout1 = new BorderLayout();
!    JTabbedPane sessionPane = new JTabbedPane();
     private int selectedIndex = 0;
     private boolean embedded = false;
--- 48,57 ----
                                                      TN5250jConstants,
                                                      SessionListener,
+                                                     TabClosedListener,                                                    
                                                      SessionJumpListener {
  
     BorderLayout borderLayout1 = new BorderLayout();
!    //JTabbedPane sessionPane = new JTabbedPane();
!    TN5250jTabbedPane sessionPane = new TN5250jTabbedPane();
     private int selectedIndex = 0;
     private boolean embedded = false;
***************
*** 54,57 ****
--- 59,63 ----
     public static int count = 0;
     private TN5250jLogger log = TN5250jLogFactory.getLogger (this.getClass());
+ 
     
     //Construct the frame
***************
*** 82,85 ****
--- 88,92 ----
  
        sessionPane.addChangeListener(this);
+       sessionPane.addtabCloseListener(this);
  
        Properties props = ConfigureFactory.getInstance().
***************
*** 99,102 ****
--- 106,110 ----
        else
           validate();
+       
  
     }
***************
*** 343,346 ****
--- 351,359 ----
     }
  
+    public void tabClosed(int tabToBeClosed){
+       
+       me.closeSession(this.getSessionAt(tabToBeClosed));
+    }
+    
     public void removeSessionView(Session targetSession) {
  



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com