use of org.eclipse.che.ide.api.subversion.Credentials in project che by eclipse.
the class MovePresenter method onMoveClicked.
/** {@inheritDoc} */
@Override
public void onMoveClicked() {
final Project project = appContext.getRootProject();
checkState(project != null);
final Path source = getSource();
final String comment = view.isURLSelected() ? view.getComment() : null;
final StatusNotification notification = new StatusNotification(locale.moveNotificationStarted(source.toString()), PROGRESS, FLOAT_MODE);
notificationManager.notify(notification);
performOperationWithCredentialsRequestIfNeeded(new RemoteSubversionOperation<CLIOutputResponse>() {
@Override
public Promise<CLIOutputResponse> perform(Credentials credentials) {
notification.setStatus(PROGRESS);
notification.setTitle(locale.moveNotificationStarted(source.toString()));
return service.move(project.getLocation(), source, getTarget(), comment, credentials);
}
}, notification).then(new Operation<CLIOutputResponse>() {
@Override
public void apply(CLIOutputResponse response) throws OperationException {
notification.setTitle(locale.moveNotificationSuccessful());
notification.setStatus(SUCCESS);
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError arg) throws OperationException {
notification.setTitle(locale.moveNotificationFailed());
notification.setStatus(FAIL);
}
});
view.onClose();
}
Aggregations