Package org.eclipse.egit.core.op

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


    final int stashIndex = getStashIndex(repo, commit.getId());

    if (!confirmStashDrop(parent, stashIndex))
      return null;

    final StashDropOperation op = new StashDropOperation(repo, stashIndex);

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

      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) {
        try {
          op.execute(monitor);
        } catch (CoreException e) {
          Activator.logError(MessageFormat.format(
              UIText.StashDropCommand_dropFailed, "stash@{" //$NON-NLS-1$
                  + stashIndex + "}"), e); //$NON-NLS-1$
        }

        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 = node.getObject();
          if (commit == null)
            return null;
          final String stashName = node.getObject().getName();
          final StashDropOperation op = new StashDropOperation(repo,
              node.getIndex());
          monitor.subTask(stashName);
          try {
            op.execute(monitor);
          } catch (CoreException e) {
            Activator.logError(MessageFormat.format(
                UIText.StashDropCommand_dropFailed,
                node.getObject().name()), e);
          }
          monitor.worked(1);
        }
        monitor.done();
        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((new StashDropOperation(repo, nodes.get(0).getIndex()))
        .getSchedulingRule());
    job.schedule();
    return null;
  }
View Full Code Here

TOP

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

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.