ui/src/main/java/ucar/nc2/ui/ToolsUI.java
private void jumptoThreddsDatatype(thredds.client.catalog.Access invAccess) {
    if (invAccess == null) {
      return;
    }

    thredds.client.catalog.Service s = invAccess.getService();
    if (s.getType() == ServiceType.HTTPServer) {
      downloadFile(invAccess.getStandardUrlName());
      return;
    }

    if (s.getType() == ServiceType.WMS) {
      openWMSDataset(invAccess.getStandardUrlName());
      return;
    }

    if (s.getType() == ServiceType.CdmrFeature) {
      openCoverageDataset(invAccess.getWrappedUrlName());
      return;
    }

    thredds.client.catalog.Dataset ds = invAccess.getDataset();
    if (ds.getFeatureType() == null) {
      // if no feature type, just open as a NetcdfDataset
      try {
        openNetcdfFile(threddsDataFactory.openDataset(invAccess, true, null, null));
      }
      catch (IOException ioe) {
        JOptionPane.showMessageDialog(null, "Error on setThreddsDatatype = " + ioe.getMessage());
      }
      return;
    }

    DataFactory.Result threddsData = null;
    try {
      threddsData = threddsDataFactory.openFeatureDataset(invAccess, null);
      if (threddsData.fatalError) {
        JOptionPane.showMessageDialog(null, "Failed to open err="+threddsData.errLog);
        return;
      }
      jumptoThreddsDatatype(threddsData);
    }
    catch (IOException ioe) {
      ioe.printStackTrace();
      JOptionPane.showMessageDialog(null, "Error on setThreddsDatatype = " + ioe.getMessage());
      if (threddsData != null) {
        try {
          threddsData.close();
        }
        catch (IOException ioe2) {
          // Okay to fall through?
        }
      }
    }

  }
private void jumptoThreddsDatatype(thredds.client.catalog.Access invAccess) {
    if (invAccess == null) {
      return;
    }

    thredds.client.catalog.Service s = invAccess.getService();
    if (s.getType() == ServiceType.HTTPServer) {
      downloadFile(invAccess.getStandardUrlName());
      return;
    }

    if (s.getType() == ServiceType.WMS) {
      openWMSDataset(invAccess.getStandardUrlName());
      return;
    }

    if (s.getType() == ServiceType.CdmrFeature) {
      openCoverageDataset(invAccess.getWrappedUrlName());
      return;
    }

    thredds.client.catalog.Dataset ds = invAccess.getDataset();
    if (ds.getFeatureType() == null) {
      // if no feature type, just open as a NetcdfDataset
      try {
        openNetcdfFile(threddsDataFactory.openDataset(invAccess, true, null, null));
      }
      catch (IOException ioe) {
        JOptionPane.showMessageDialog(null, "Error on setThreddsDatatype = " + ioe.getMessage());
      }
      return;
    }

    DataFactory.Result threddsData = null;
    try {
      threddsData = threddsDataFactory.openFeatureDataset(invAccess, null);
      if (threddsData.fatalError) {
        JOptionPane.showMessageDialog(null, "Failed to open err="+threddsData.errLog);
        return;
      }
      jumptoThreddsDatatype(threddsData);
    }
    catch (IOException ioe) {
      ioe.printStackTrace();
      JOptionPane.showMessageDialog(null, "Error on setThreddsDatatype = " + ioe.getMessage());
      if (threddsData != null) {
        try {
          threddsData.close();
        }
        catch (IOException ioe2) {
          // Okay to fall through?
        }
      }
    }

  }
private void jumptoThreddsDatatype ( thredds . client . catalog . Access invAccess ) { if ( invAccess == null ) { return ; } thredds . client . catalog . Service s = invAccess . getService ( ) ; if ( s . getType ( ) == ServiceType . HTTPServer ) { downloadFile ( invAccess . getStandardUrlName ( ) ) ; return ; } if ( s . getType ( ) == ServiceType . WMS ) { openWMSDataset ( invAccess . getStandardUrlName ( ) ) ; return ; } if ( s . getType ( ) == ServiceType . CdmrFeature ) { openCoverageDataset ( invAccess . getWrappedUrlName ( ) ) ; return ; } thredds . client . catalog . Dataset ds = invAccess . getDataset ( ) ; if ( ds . getFeatureType ( ) == null ) { // if no feature type, just open as a NetcdfDataset
 try { openNetcdfFile ( threddsDataFactory . openDataset ( invAccess , true , null , null ) ) ; } catch ( IOException ioe ) { JOptionPane . showMessageDialog ( null , "Error on setThreddsDatatype = " + ioe . getMessage ( ) ) ; } return ; } DataFactory . Result threddsData = null ; try { threddsData = threddsDataFactory . openFeatureDataset ( invAccess , null ) ; if ( threddsData . fatalError ) { JOptionPane . showMessageDialog ( null , "Failed to open err=" + threddsData . errLog ) ; return ; } jumptoThreddsDatatype ( threddsData ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; JOptionPane . showMessageDialog ( null , "Error on setThreddsDatatype = " + ioe . getMessage ( ) ) ; if ( threddsData != null ) { try { threddsData . close ( ) ; } catch ( IOException ioe2 ) { // Okay to fall through?
 } } } }
jump to the appropriate tab based on datatype of InvAccess
jump to the appropriate tab based on datatype of InvAccess