use of org.eclipse.che.ide.ext.git.client.outputconsole.GitOutputConsole in project che by eclipse.
the class MergePresenter method onMergeClicked.
/** {@inheritDoc} */
@Override
public void onMergeClicked() {
view.close();
final GitOutputConsole console = gitOutputConsoleFactory.create(MERGE_COMMAND_NAME);
service.merge(appContext.getDevMachine(), project.getLocation(), selectedReference.getDisplayName()).then(new Operation<MergeResult>() {
@Override
public void apply(MergeResult result) throws OperationException {
console.print(formMergeMessage(result));
consolesPanelPresenter.addCommandOutput(appContext.getDevMachine().getId(), console);
notificationManager.notify(formMergeMessage(result));
project.synchronize();
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
if (error.getCause() instanceof ServerException && ((ServerException) error.getCause()).getErrorCode() == ErrorCodes.NO_COMMITTER_NAME_OR_EMAIL_DEFINED) {
dialogFactory.createMessageDialog(constant.mergeTitle(), constant.committerIdentityInfoEmpty(), new ConfirmCallback() {
@Override
public void accepted() {
//do nothing
}
}).show();
return;
}
console.printError(error.getMessage());
consolesPanelPresenter.addCommandOutput(appContext.getDevMachine().getId(), console);
notificationManager.notify(constant.mergeFailed(), FAIL, FLOAT_MODE);
}
});
}
use of org.eclipse.che.ide.ext.git.client.outputconsole.GitOutputConsole in project che by eclipse.
the class CommitPresenter method onCommitSuccess.
private void onCommitSuccess(@NotNull final Revision revision) {
String date = dateTimeFormatter.getFormattedDate(revision.getCommitTime());
String message = constant.commitMessage(revision.getId(), date);
if ((revision.getCommitter() != null && revision.getCommitter().getName() != null && !revision.getCommitter().getName().isEmpty())) {
message += " " + constant.commitUser(revision.getCommitter().getName());
}
GitOutputConsole console = gitOutputConsoleFactory.create(COMMIT_COMMAND_NAME);
console.print(message);
consolesPanelPresenter.addCommandOutput(appContext.getDevMachine().getId(), console);
notificationManager.notify(message);
view.setMessage("");
}
Aggregations