[Schmitzm-commits] r1956 - trunk/schmitzm-core/src/main/java/de/schmitzm/swing

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Wed Apr 18 12:00:40 CEST 2012


Author: mojays
Date: 2012-04-18 12:00:40 +0200 (Wed, 18 Apr 2012)
New Revision: 1956

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/WebFilesChooserPanel.java
Log:
WebFilesChooserPanel: general internet connection check removed because long delay due to timeouts


Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/WebFilesChooserPanel.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/WebFilesChooserPanel.java	2012-04-16 12:41:48 UTC (rev 1955)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/WebFilesChooserPanel.java	2012-04-18 10:00:40 UTC (rev 1956)
@@ -176,6 +176,8 @@
     
     add(baseUrl, "growx");
     add(splitpane,"growx, growy");
+// causes long delay when opening dialog; not nice...    
+//    checkInternetConnection();
   }
   
   /**
@@ -214,18 +216,18 @@
    * according to the URL.
    */
   public void setBaseURL(String baseURL) {
-    try {
-      SwingUtil.setWaitCursor(this);
-      if ( !IOUtil.isInetConnectionAvailable(getProxy()) ) {
-        baseUrl.setText( SwingUtil.R("WebFilesChooserPanel.InetNotAvailable") );
-        setEnabled(false);
-        return;
-      }
+//    try {
+//      SwingUtil.setWaitCursor(this);
+//      if ( !IOUtil.isInetConnectionAvailable(getProxy()) ) {
+//        baseUrl.setText( SwingUtil.R("WebFilesChooserPanel.InetNotAvailable") );
+//        setEnabled(false);
+//        return;
+//      }
       baseUrl.setText(baseURL);
       baseUrl.performAction(null, baseUrl.getText());
-    } finally {
-      SwingUtil.resetCursor(this);
-    }
+//    } finally {
+//      SwingUtil.resetCursor(this);
+//    }
   }
   
   /**
@@ -237,6 +239,28 @@
     String urlStr = baseURL != null ? baseURL.toExternalForm() : "";
     setBaseURL(urlStr);
   }
+ 
+// Causes long delay due to timeout... not nice... so we avoid the check
+//  /**
+//   * Checks generally whether an internet connection is available. If not
+//   * the component is disabled and an info message is set to URL field.
+//   */
+//  protected boolean checkInternetConnection() { 
+//    try {
+//      SwingUtil.setWaitCursor(this);
+//      if ( !IOUtil.isInetConnectionAvailable(getProxy()) ) {
+//        baseUrl.setText( SwingUtil.R("WebFilesChooserPanel.InetNotAvailable") );
+//        setEnabled(false);
+//        return false;
+//      }
+//      if ( baseUrl.getText().equals(SwingUtil.R("WebFilesChooserPanel.InetNotAvailable")) )
+//        baseUrl.setText("");
+//      setEnabled(true);
+//    } finally {
+//      SwingUtil.resetCursor(this);
+//    }
+//    return true;
+//  }
 
   /**
    * Returns the proxy server used for url connection.



More information about the Schmitzm-commits mailing list