Package org.eclipse.egit.ui.internal.dialogs

Examples of org.eclipse.egit.ui.internal.dialogs.CommitDialog


            UIText.CommitAction_amendNotPossible);
        return false;
      }
    }

    CommitDialog commitDialog = new CommitDialog(shell);
    commitDialog.setAmending(amending);
    commitDialog.setAmendAllowed(amendAllowed);
    commitDialog.setFiles(repo, files, indexDiff);
    commitDialog.setPreselectedFiles(getSelectedFiles());
    commitDialog.setPreselectAll(preselectAll);
    commitDialog.setAuthor(commitHelper.getAuthor());
    commitDialog.setCommitter(commitHelper.getCommitter());
    commitDialog.setAllowToChangeSelection(!commitHelper.isMergedResolved && !commitHelper.isCherryPickResolved);
    commitDialog.setCommitMessage(commitHelper.getCommitMessage());

    if (commitDialog.open() != IDialogConstants.OK_ID)
      return false;

    final CommitOperation commitOperation;
    try {
      commitOperation= new CommitOperation(
          repo,
          commitDialog.getSelectedFiles(), notTracked, commitDialog.getAuthor(),
          commitDialog.getCommitter(), commitDialog.getCommitMessage());
    } catch (CoreException e1) {
      Activator.handleError(UIText.CommitUI_commitFailed, e1, true);
      return false;
    }
    if (commitDialog.isAmending())
      commitOperation.setAmending(true);
    commitOperation.setComputeChangeId(commitDialog.getCreateChangeId());
    commitOperation.setCommitAll(commitHelper.isMergedResolved);
    if (commitHelper.isMergedResolved)
      commitOperation.setRepository(repo);
    Job commitJob = new CommitJob(repo, commitOperation).
        setPushUpstream(commitDialog.isPushRequested());
    commitJob.schedule();

    return true;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.ui.internal.dialogs.CommitDialog

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.