jdk/src/share/classes/sun/tools/jconsole/VMPanel.java
changeset 18253 4323a5fe8bc4
parent 18197 ae73e4f50e08
parent 17719 ba3677303a76
child 19432 ce3b6c1ab8a6
equal deleted inserted replaced
18252:1a7454a9febb 18253:4323a5fe8bc4
    53     private String password;
    53     private String password;
    54     private String url;
    54     private String url;
    55     private VMInternalFrame vmIF = null;
    55     private VMInternalFrame vmIF = null;
    56     private static ArrayList<TabInfo> tabInfos = new ArrayList<TabInfo>();
    56     private static ArrayList<TabInfo> tabInfos = new ArrayList<TabInfo>();
    57     private boolean wasConnected = false;
    57     private boolean wasConnected = false;
       
    58     private boolean userDisconnected = false;
    58     private boolean shouldUseSSL = true;
    59     private boolean shouldUseSSL = true;
    59 
    60 
    60     // The everConnected flag keeps track of whether the window can be
    61     // The everConnected flag keeps track of whether the window can be
    61     // closed if the user clicks Cancel after a failed connection attempt.
    62     // closed if the user clicks Cancel after a failed connection attempt.
    62     //
    63     //
   124 
   125 
   125             public void mouseClicked(MouseEvent e) {
   126             public void mouseClicked(MouseEvent e) {
   126                 if (connectedIconBounds != null && (e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && connectedIconBounds.contains(e.getPoint())) {
   127                 if (connectedIconBounds != null && (e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && connectedIconBounds.contains(e.getPoint())) {
   127 
   128 
   128                     if (isConnected()) {
   129                     if (isConnected()) {
       
   130                         userDisconnected = true;
   129                         disconnect();
   131                         disconnect();
   130                         wasConnected = false;
   132                         wasConnected = false;
   131                     } else {
   133                     } else {
   132                         connect();
   134                         connect();
   133                     }
   135                     }
   450     }
   452     }
   451 
   453 
   452     // Call on EDT
   454     // Call on EDT
   453     private void vmPanelDied() {
   455     private void vmPanelDied() {
   454         disconnect();
   456         disconnect();
       
   457 
       
   458         if (userDisconnected) {
       
   459             userDisconnected = false;
       
   460             return;
       
   461         }
   455 
   462 
   456         JOptionPane optionPane;
   463         JOptionPane optionPane;
   457         String msgTitle, msgExplanation, buttonStr;
   464         String msgTitle, msgExplanation, buttonStr;
   458 
   465 
   459         if (wasConnected) {
   466         if (wasConnected) {