Package org.eclipse.egit.core.op

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


      return null;
    Repository repo = getSelectedItem(Repository.class, event);
    if (repo == null)
      return null;

    final StashApplyOperation op = new StashApplyOperation(repo, commit);

    Job job = new WorkspaceJob(MessageFormat.format(
        UIText.StashApplyCommand_jobTitle, commit.name())) {

      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) {
        try {
          op.execute(monitor);
        } catch (CoreException e) {
          return new Status(IStatus.ERROR, Activator.getPluginId(),
              MessageFormat.format(
                  UIText.StashApplyCommand_applyFailed,
                  commit.abbreviate(7).name(),
                  e.getLocalizedMessage()), e);
        }
        return Status.OK_STATUS;
      }

      @Override
      public boolean belongsTo(Object family) {
        if (JobFamilies.STASH.equals(family))
          return true;
        return super.belongsTo(family);
      }
    };
    job.setUser(true);
    job.setRule(op.getSchedulingRule());
    job.schedule();
    return null;
  }
View Full Code Here


      return null;
    final RevCommit commit = nodes.get(0).getObject();
    if (commit == null)
      return null;

    final StashApplyOperation op = new StashApplyOperation(repo, commit);
    Job job = new WorkspaceJob(MessageFormat.format(
        UIText.StashApplyCommand_jobTitle, commit.name())) {

      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) {
        try {
          op.execute(monitor);
        } catch (CoreException e) {
          return new Status(IStatus.ERROR, Activator.getPluginId(),
              MessageFormat.format(
                  UIText.StashApplyCommand_applyFailed,
                  commit.abbreviate(7).name(),
                  e.getLocalizedMessage()), e);
        }
        return Status.OK_STATUS;
      }

      @Override
      public boolean belongsTo(Object family) {
        if (JobFamilies.STASH.equals(family))
          return true;
        return super.belongsTo(family);
      }
    };
    job.setUser(true);
    job.setRule(op.getSchedulingRule());
    job.schedule();
    return null;
  }
View Full Code Here

TOP

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

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.