Search in sources :

Example 1 with StatusItem

use of org.eclipse.che.plugin.svn.shared.StatusItem in project che by eclipse.

the class CommitPresenter method loadAllChanges.

private void loadAllChanges() {
    final Project project = appContext.getRootProject();
    checkState(project != null);
    service.status(project.getLocation(), new Path[0], 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);
            view.onShow();
            cache.put(Changes.ALL, statusItems);
        }
    }).catchError(new Operation<PromiseError>() {

        @Override
        public void apply(PromiseError error) throws OperationException {
            Log.error(CommitPresenter.class, error.getMessage());
        }
    });
}
Also used : StatusItem(org.eclipse.che.plugin.svn.shared.StatusItem) Project(org.eclipse.che.ide.api.resources.Project) PromiseError(org.eclipse.che.api.promises.client.PromiseError) Operation(org.eclipse.che.api.promises.client.Operation) CLIOutputResponse(org.eclipse.che.plugin.svn.shared.CLIOutputResponse) OperationException(org.eclipse.che.api.promises.client.OperationException)

Example 2 with StatusItem

use of org.eclipse.che.plugin.svn.shared.StatusItem 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());
        }
    });
}
Also used : StatusItem(org.eclipse.che.plugin.svn.shared.StatusItem) Project(org.eclipse.che.ide.api.resources.Project) PromiseError(org.eclipse.che.api.promises.client.PromiseError) Resource(org.eclipse.che.ide.api.resources.Resource) Operation(org.eclipse.che.api.promises.client.Operation) CLIOutputResponse(org.eclipse.che.plugin.svn.shared.CLIOutputResponse) OperationException(org.eclipse.che.api.promises.client.OperationException)

Aggregations

Operation (org.eclipse.che.api.promises.client.Operation)2 OperationException (org.eclipse.che.api.promises.client.OperationException)2 PromiseError (org.eclipse.che.api.promises.client.PromiseError)2 Project (org.eclipse.che.ide.api.resources.Project)2 CLIOutputResponse (org.eclipse.che.plugin.svn.shared.CLIOutputResponse)2 StatusItem (org.eclipse.che.plugin.svn.shared.StatusItem)2 Resource (org.eclipse.che.ide.api.resources.Resource)1