Package org.eclipse.ui.wizards.datatransfer

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


    @Override
    public boolean performFinish()
    {
      IImportStructureProvider importProvider = new DocumentImportStructureProvider();

      ImportOperation operation = new ImportOperation(mMainPage.getImportDestinationPath(),
              importProvider, null, mMainPage.getFilesToImport());

      operation.setContext(getShell());

      operation.setOverwriteResources(false);

      try {
        getContainer().run(true, true, operation);
      } catch (InvocationTargetException e) {
        CasEditorPlugin.log(e);
View Full Code Here


   
    IImportStructureProvider importProvider = new DocumentImportStructureProvider(mMainPage.getLanguage(),
        mMainPage.getTextEncoding(), mMainPage.getCasFormat());
   
    // BUG: We cannot pass null here for the overwrite query
    ImportOperation operation =
            new ImportOperation(mMainPage.getImportDestinationPath(), importProvider, new OverwriteQuery(getShell()),
            mMainPage.getFilesToImport());

    operation.setContext(getShell());

    operation.setOverwriteResources(false);

    try {
      getContainer().run(true, true, operation);
    } catch (InvocationTargetException e) {
      CasEditorPlugin.log(e);
View Full Code Here

  @Override
  public boolean performFinish() {
    IImportStructureProvider importProvider = new DocumentImportStructureProvider();

    ImportOperation operation =
            new ImportOperation(mMainPage.getImportDestinationPath(), importProvider, null,
            mMainPage.getFilesToImport());

    operation.setContext(getShell());

    operation.setOverwriteResources(false);

    try {
      getContainer().run(true, true, operation);
    } catch (InvocationTargetException e) {
      CasEditorPlugin.log(e);
View Full Code Here

    List<File> files = new ArrayList<File>(100);
    addFiles(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

    }
  }

  private void importFilesFromZip(ZipFile srcZipFile, IPath destPath, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
    ZipFileStructureProvider structureProvider = new ZipFileStructureProvider(srcZipFile);
    ImportOperation op = new ImportOperation(destPath, structureProvider.getRoot(), structureProvider, overwriteQuery);
    op.run(monitor);
  }
View Full Code Here

    URL local = FileLocator.toFileURL(installLocation);
    File root = new File(local.getPath(), sdkname);
    RelativityFileSystemStructureProvider structureProvider
      = new RelativityFileSystemStructureProvider(root);

    ImportOperation operation =
      new ImportOperation(projectHandle.getFullPath(),
                root,
                structureProvider,
                this,
                structureProvider.getChildren(root));
   
    operation.setContext(getShell());
    operation.run(monitor);
  }
View Full Code Here

  @Override
  public boolean performFinish() {
    IImportStructureProvider importProvider = new DocumentImportStructureProvider(
        mMainPage.getTextEncoding(), mMainPage.getCasFormat());

    ImportOperation operation =
            new ImportOperation(mMainPage.getImportDestinationPath(), importProvider, null,
            mMainPage.getFilesToImport());

    operation.setContext(getShell());

    operation.setOverwriteResources(false);

    try {
      getContainer().run(true, true, operation);
    } catch (InvocationTargetException e) {
      CasEditorPlugin.log(e);
View Full Code Here

      File templateRoot = new File(location.getPath(), path);
      LogUtil.info("templateRoot: " + templateRoot.getAbsolutePath());
     
      RelativityFileSystemStructureProvider structureProvider = new RelativityFileSystemStructureProvider(
          templateRoot);
      ImportOperation operation = new ImportOperation(
          projectHandle.getFullPath(), templateRoot,
          structureProvider, new IOverwriteQuery() {
            public String queryOverwrite(String pathString) {
              return ALL;
            }
          }, structureProvider.getChildren(templateRoot));

      operation.setContext(getShell());
      operation.run(null);
    } catch (Exception e) {
      throw new CoreException(new Status(IStatus.ERROR,
          Activator.PLUGIN_ID, e.getLocalizedMessage()));
    }
  }
View Full Code Here

    }

    RelativityFileSystemStructureProvider structureProvider = new RelativityFileSystemStructureProvider(
        workingDirectory);

    ImportOperation operation = new ImportOperation(
        projectHandle.getFullPath(), root, structureProvider,
        new IOverwriteQuery() {
          @Override
          public String queryOverwrite(String pathString) {
            return IOverwriteQuery.ALL;
          }
        }, structureProvider.collectFiles(root));
    operation.setCreateContainerStructure(false);
    operation.setContext(getShell());
    operation.run(monitor);
  }
View Full Code Here

                }
                return returnCode[0];
            }
        };

        ImportOperation op = new ImportOperation(target.getFullPath(), stores[0].getParent(),
                FileStoreStructureProvider.INSTANCE, query, Arrays.asList(stores));
        op.setContext(messageShell);
        op.setCreateContainerStructure(false);
        try {
            op.run(monitor);
        } catch (InterruptedException e) {
            return;
        } catch (InvocationTargetException e) {
            if (e.getTargetException() instanceof CoreException) {
                displayError(((CoreException) e.getTargetException()).getStatus());
            } else {
                display(e);
            }
            return;
        }
        // Special case since ImportOperation doesn't throw a CoreException on
        // failure.
        IStatus status = op.getStatus();
        if (!status.isOK()) {
            if (errorStatus == null) {
                errorStatus = new MultiStatus(PlatformUI.PLUGIN_ID, IStatus.ERROR, getProblemsMessage(), null);
            }
            errorStatus.merge(status);
View Full Code Here

TOP

Related Classes of org.eclipse.ui.wizards.datatransfer.ImportOperation

Copyright © 2018 www.massapicom. 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.