Examples of ImportOperation


Examples of org.eclipse.ui.wizards.datatransfer.ImportOperation

    if (importStructureProvider == null) {
      return false;
    }

    ImportOperation operation = new ImportOperation(getContainerFullPath(),
        importStructureProvider.getRoot(), importStructureProvider,
        this, fileSystemObjects);

    operation.setContext(getShell());
    if (!executeImportOperation(operation))
      return false;

    ArchiveFileManipulations.closeStructureProvider(
        importStructureProvider, getShell());
View Full Code Here

Examples of org.eclipse.ui.wizards.datatransfer.ImportOperation

   * @throws InvocationTargetException
   */
  private static void importFilesFromZip(ZipFile srcZipFile, IPath destPath, IProgressMonitor monitor) throws InvocationTargetException {   
    ZipFileStructureProvider structureProvider=  new ZipFileStructureProvider(srcZipFile);
    try {
      ImportOperation op= new ImportOperation(destPath, structureProvider.getRoot(), structureProvider, new ImportOverwriteQuery());
      op.run(monitor);
    } catch (InterruptedException e) {
      // should not happen
    }
  }
View Full Code Here

Examples of org.eclipse.ui.wizards.datatransfer.ImportOperation

  public static void importFilesFromDirectory(File rootDir, IPath destPath, IProgressMonitor monitor) throws InvocationTargetException, IOException {   
    IImportStructureProvider structureProvider = FileSystemStructureProvider.INSTANCE;
    List<File> files = new ArrayList<File>(100);
    addJavaFiles(rootDir, files);
    try {
      ImportOperation op= new ImportOperation(destPath, rootDir, structureProvider, new ImportOverwriteQuery(), files);
      op.setCreateContainerStructure(false);
      op.run(monitor);
    } catch (InterruptedException e) {
      // should not happen
    }
  } 
View Full Code Here

Examples of org.eclipse.ui.wizards.datatransfer.ImportOperation

  public static void importFile(File file, IPath destPath, IProgressMonitor monitor) throws InvocationTargetException {   
    IImportStructureProvider structureProvider = FileSystemStructureProvider.INSTANCE;
    List<File> files = new ArrayList<File>(1);
    files.add(file);
    try {
      ImportOperation op= new ImportOperation(destPath, file.getParentFile(), structureProvider, new ImportOverwriteQuery(), files);
      op.setCreateContainerStructure(false);
      op.run(monitor);
    } catch (InterruptedException e) {
      // should not happen
    }
  }
View Full Code Here

Examples of org.eclipse.ui.wizards.datatransfer.ImportOperation

  }

  private void importFiles(IProject project, File unzipFolder, IProgressMonitor monitor) throws IOException,
      InvocationTargetException, InterruptedException {
    FileSystemStructureProvider provider = FileSystemStructureProvider.INSTANCE;
    ImportOperation operation = new ImportOperation(project.getFullPath(), unzipFolder, provider,
        new IOverwriteQuery() {
          // always overwrite
          public String queryOverwrite(String pathString) {
            return IOverwriteQuery.YES;
          }
        });
    operation.setContext(shell);

    // need to overwrite .project file
    operation.setOverwriteResources(true);
    operation.setCreateContainerStructure(false);
    operation.run(monitor);
  }
View Full Code Here

Examples of org.eclipse.ui.wizards.datatransfer.ImportOperation

            projectFile));
      }

      File importSource = new File(locationURI).getParentFile();
      List filesToImport = FileSystemStructureProvider.INSTANCE.getChildren(importSource);
      ImportOperation operation = new ImportOperation(project.getFullPath(), importSource,
          FileSystemStructureProvider.INSTANCE, this, filesToImport);
      operation.setContext(shell);
      operation.setOverwriteResources(true); // need to overwrite
      operation.setCreateContainerStructure(false);
      try {
        operation.run(monitor);
      }
      catch (InvocationTargetException e) {
        return new Status(IStatus.ERROR, WizardPlugin.PLUGIN_ID, NLS.bind(
            "Error: Could not create project from {0}", projectFile));
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.