Package org.eclipse.egit.core.op

Examples of org.eclipse.egit.core.op.ConnectProviderOperation


        .newProjectDescription(projectName);
    File parentFile = repo.getRepository().getWorkTree();
    desc.setLocation(new Path(new File(parentFile, projectName).getPath()));
    firstProject.create(desc, null);
    firstProject.open(null);
    ConnectProviderOperation cop = new ConnectProviderOperation(
        firstProject, repo.getRepository().getDirectory());
    cop.execute(null);
    return firstProject;
  }
View Full Code Here


    super.tearDown();
  }

  @Test
  public void testAddingAFile() throws Exception {
    new ConnectProviderOperation(project.project, repository.getDirectory())
        .execute(null);
    // create first commit containing a dummy file
    testRepository
        .createInitialCommit("testBranchOperation\n\nfirst commit\n");
    prepareCacheEntry();
View Full Code Here

            throws CoreException {
          IProject[] currentProjects = ResourcesPlugin.getWorkspace()
              .getRoot().getProjects();
          for (IProject current : currentProjects) {
            if (!previousProjects.contains(current)) {
              ConnectProviderOperation cpo = new ConnectProviderOperation(
                  current, myRepository.getDirectory());
              cpo.execute(actMonitor);
            }
          }

        }
      };
      try {
        ResourcesPlugin.getWorkspace().run(wsr, monitor);
      } catch (CoreException e) {
        throw new InvocationTargetException(e);
      }
      break;
    }
    case GitSelectWizardPage.GENERAL_WIZARD: {
      final String[] projectName = new String[1];
      final boolean[] defaultLocation = new boolean[1];
      // get the data from the page in the UI thread
      PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
        public void run() {
          projectName[0] = myCreateGeneralProjectPage
              .getProjectName();
          defaultLocation[0] = myCreateGeneralProjectPage
              .isDefaultLocation();
        }
      });

      try {
        IWorkspaceRunnable wsr = new IWorkspaceRunnable() {
          public void run(IProgressMonitor actMonitor)
              throws CoreException {
            final IProjectDescription desc = ResourcesPlugin
                .getWorkspace().newProjectDescription(
                    projectName[0]);
            if (!defaultLocation[0])
              desc.setLocation(new Path(myGitDir));

            IProject prj = ResourcesPlugin.getWorkspace().getRoot()
                .getProject(desc.getName());
            prj.create(desc, actMonitor);
            prj.open(actMonitor);

            ResourcesPlugin.getWorkspace().getRoot().refreshLocal(
                IResource.DEPTH_ONE, actMonitor);

            File repoDir = myRepository.getDirectory();
            ConnectProviderOperation cpo = new ConnectProviderOperation(
                prj, repoDir);
            cpo.execute(new NullProgressMonitor());
          }
        };
        ResourcesPlugin.getWorkspace().run(wsr, monitor);

      } catch (CoreException e) {
View Full Code Here

          project.create(projectDescription, monitor);
          importedProjects.add(project);
        }

        project.open(monitor);
        final ConnectProviderOperation connectProviderOperation = new ConnectProviderOperation(
            project, repositoryPath);
        connectProviderOperation.execute(monitor);
      }

      return importedProjects;

    } catch (final CoreException e) {
View Full Code Here

        // Ignore this project in that case
        continue;
      }
    }
    if (!connections.isEmpty()) {
      ConnectProviderOperation operation = new ConnectProviderOperation(
          connections);
      JobUtil.scheduleUserJob(operation,
          CoreText.Activator_AutoShareJobName, JobFamilies.AUTO_SHARE);
    }
  }
View Full Code Here

    pathsToClean.add(gitDirectory);
    return gitDirectory;
  }

  private void connectProject(IProject project, File gitDir) throws CoreException {
    ConnectProviderOperation operation = new ConnectProviderOperation(
        project.getProject(), gitDir);
    operation.execute(null);
  }
View Full Code Here

        regexFilterArguments);
    container.createFilter(type, matcherDescription, 0, null);
  }

  private void connectProject(IProject p) throws CoreException {
    final ConnectProviderOperation operation = new ConnectProviderOperation(
        p, gitDir);
    operation.execute(null);
  }
View Full Code Here

    assertEquals(0, projects.length);
  }

  @Test
  public void testGetProjects() throws Exception {
    ConnectProviderOperation operation = new ConnectProviderOperation(
        project.getProject(), gitDir);
    operation.execute(null);
    IProject[] projects = ProjectUtil.getProjects(repository
        .getRepository());
    assertEquals(1, projects.length);
    IProject p = projects[0];
    assertEquals("Project-1", p.getDescription().getName());
View Full Code Here

    final Writer fileWriter = new OutputStreamWriter(new FileOutputStream(
        file), "UTF-8");
    fileWriter.write("aaaaaaaaaaa");
    fileWriter.close();

    final ConnectProviderOperation operation = new ConnectProviderOperation(
        project.getProject(), gitDir);
    operation.execute(null);
  }
View Full Code Here

        .create(singleProjectGitDir);
    singleProjectRepo.create();

    // Repository must be mapped in order to test the GitFileHistory
    Activator.getDefault().getRepositoryUtil().addConfiguredRepository(singleProjectGitDir);
    ConnectProviderOperation connectOp = new ConnectProviderOperation(proj, singleProjectGitDir);
    connectOp.execute(progress);

    try {
      IFile file = proj.getFile("file");
      file.create(new ByteArrayInputStream("data".getBytes("UTF-8")), 0,
          progress);
View Full Code Here

TOP

Related Classes of org.eclipse.egit.core.op.ConnectProviderOperation

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.