status.setIndeterminate(false);
  public void actionPerformed(ActionEvent e)  {    if(currentWorkspace.getLocation() == null)    {      JOptionPane.showMessageDialog((Component)e.getSource(), ResourceManager.getString("error.save.unsavedspace"), ResourceManager.getString("title.warning"), JOptionPane.WARNING_MESSAGE);      return;    }    ImportWorkflowDialog dialog = new ImportWorkflowDialog(WorkflowDesigner.INSTANCE, (String)getValue(NAME), true);    dialog.pack();    Utils.centerComponent(WorkflowDesigner.INSTANCE, dialog);    dialog.show();    URL inputFile = dialog.getImportURL();    if(inputFile!=null)    {      String f = inputFile.getFile();      String fileName = f.substring(f.lastIndexOf('/')+1, f.length());      try      {        File ouputFile = new File(currentWorkspace.getLocation().getParentFile(), fileName);        //don't allow importing of files within the workspace!        if(!"file".equals(inputFile.getProtocol()) ||          new File(inputFile.getFile()).getCanonicalPath().indexOf(currentWorkspace.getLocation().getParentFile().getCanonicalPath())==-1)        {          FileOutputStream out = new FileOutputStream(ouputFile);          InputStream in = inputFile.openStream();          byte[] buff = new byte[4096];          int nch;          while((nch = in.read(buff, 0, buff.length)) != -1)          {            out.write(buff, 0, nch);          }          out.flush();          out.close();          currentWorkspace.importDescriptor(fileName.substring(0, fileName.lastIndexOf('.')), inputFile.openStream());          WorkflowDesigner.INSTANCE.navigator().setWorkspace(currentWorkspace);        }      }      catch(Exception t)      {        log.error("Error importing descriptor", t);      }    }  }