JOptionPane.showMessageDialog((Component)e.getSource(), "Please save this workspace before importing workflows into it", "Warning", JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog((Component)e.getSource(), ResourceManager.getString("error.save.unsavedspace"), ResourceManager.getString("title.warning"), JOptionPane.WARNING_MESSAGE);
  public void actionPerformed(ActionEvent e)  {    if(currentWorkspace.getLocation() == null)    {      JOptionPane.showMessageDialog((Component)e.getSource(), "Please save this workspace before importing workflows into it", "Warning", JOptionPane.WARNING_MESSAGE);      return;    }    File inputFile = Utils.promptUserForFile((Component)e.getSource(), JFileChooser.FILES_AND_DIRECTORIES, false, ".xml", "XML Workflow Files");    if(inputFile!=null)    {      try      {        File ouputFile = new File(currentWorkspace.getLocation().getParentFile(), inputFile.getName());        if(!ouputFile.getCanonicalPath().equals(inputFile.getCanonicalPath()))        {          FileOutputStream out = new FileOutputStream(ouputFile);          FileInputStream in = new FileInputStream(inputFile);          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();        }        String name = inputFile.getName();        currentWorkspace.importDescriptor(name.substring(0, name.lastIndexOf('.')), new FileInputStream(inputFile));        WorkflowDesigner.INSTANCE.navigator().setWorkspace(currentWorkspace);      }      catch(Exception t)      {        log.error("Error importing descriptor", t);      }    }  }