Package org.eclipse.egit.core.op

Examples of org.eclipse.egit.core.op.DiscardChangesOperation.execute()


    String jobname = UIText.DiscardChangesAction_discardChanges;
    Job job = new WorkspaceJob(jobname) {
      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) {
        try {
          operation.execute(monitor);
        } catch (CoreException e) {
          return Activator.createErrorStatus(e.getStatus()
              .getMessage(), e);
        }
        return Status.OK_STATUS;
View Full Code Here


    assertEquals("Hello world 2", contents);
    setNewFileContent(file2, "changed 2");

    DiscardChangesOperation dcop = new DiscardChangesOperation(
        new IResource[] { file1, file2 });
    dcop.execute(new NullProgressMonitor());

    contents = testUtils.slurpAndClose(file1.getContents());
    assertEquals("Hello world 1", contents);

    contents = testUtils.slurpAndClose(file2.getContents());
View Full Code Here

    String contents = testUtils.slurpAndClose(file.getContents());
    assertEquals("initial", contents);
    setNewFileContent(file, "changed");

    DiscardChangesOperation dcop = new DiscardChangesOperation(new IResource[] { project2 });
    dcop.execute(new NullProgressMonitor());

    String replacedContents = testUtils.slurpAndClose(file.getContents());
    assertEquals("initial", replacedContents);
  }
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.