use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.
the class CommitPresenter method loadSelectionChanges.
private void loadSelectionChanges() {
final Project project = appContext.getRootProject();
checkState(project != null);
final Resource[] resources = appContext.getResources();
checkState(!Arrays.isNullOrEmpty(resources));
service.status(project.getLocation(), toRelative(project, resources), null, false, false, false, true, false, null).then(new Operation<CLIOutputResponse>() {
@Override
public void apply(CLIOutputResponse response) throws OperationException {
List<StatusItem> statusItems = parseChangesList(response);
view.setChangesList(statusItems);
cache.put(Changes.SELECTION, statusItems);
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
Log.error(CommitPresenter.class, error.getMessage());
}
});
}
use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.
the class ResolvePresenter method showConflictsDialog.
public void showConflictsDialog() {
final Project project = appContext.getRootProject();
checkState(project != null);
final Resource[] resources = appContext.getResources();
checkState(!Arrays.isNullOrEmpty(resources));
service.showConflicts(project.getLocation(), toRelative(project, resources)).then(new Operation<CLIOutputResponse>() {
@Override
public void apply(CLIOutputResponse response) throws OperationException {
conflictsList = parseConflictsList(response.getOutput());
if (conflictsList.isEmpty()) {
dialogFactory.createMessageDialog(constants.resolveNoConflictTitle(), constants.resolveNoConflictContent(), null).show();
return;
}
for (String file : conflictsList) {
view.addConflictingFile(file);
}
view.showDialog();
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
}
});
}
use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.
the class RevertPresenter method show.
public void show() {
final Project project = appContext.getRootProject();
checkState(project != null);
final Resource[] resources = appContext.getResources();
checkState(!Arrays.isNullOrEmpty(resources));
ConfirmDialog confirmDialog = createConfirmDialog(project, resources);
confirmDialog.show();
}
use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.
the class ShowLogPresenter method showLogs.
/**
* Fetches and displays commit log messages for specified range.
*
* @param range
* range to be logged
*/
private void showLogs(String range) {
final Project project = appContext.getRootProject();
checkState(project != null);
final Resource[] resources = appContext.getResources();
checkState(!Arrays.isNullOrEmpty(resources));
service.showLog(project.getLocation(), toRelative(project, resources), range).then(new Operation<CLIOutputResponse>() {
@Override
public void apply(CLIOutputResponse response) throws OperationException {
printResponse(response.getCommand(), response.getOutput(), null, constants.commandLog());
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
notificationManager.notify(error.getMessage(), FAIL, FLOAT_MODE);
}
});
}
use of org.eclipse.che.ide.api.resources.Project in project che by eclipse.
the class MergePresenter method mergeClicked.
/**
* Performs actions when clicking Merge button.
*/
@Override
public void mergeClicked() {
view.hide();
final Project project = appContext.getRootProject();
checkState(project != null);
final Resource[] resources = appContext.getResources();
checkState(resources != null && resources.length == 1);
service.merge(project.getLocation(), resources[0].getLocation(), Path.valueOf(sourceURL)).then(new Operation<CLIOutputResponse>() {
@Override
public void apply(CLIOutputResponse response) throws OperationException {
printResponse(response.getCommand(), response.getOutput(), null, constants.commandMerge());
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
notificationManager.notify(error.getMessage(), FAIL, FLOAT_MODE);
}
});
}
Aggregations