Exemplo n.º 1
0
  /** Get the list of branches. */
  private void getBranches() {
    service.branchList(
        workspaceId,
        project.getRootProject(),
        LIST_ALL,
        new AsyncRequestCallback<List<Branch>>(
            dtoUnmarshallerFactory.newListUnmarshaller(Branch.class)) {
          @Override
          protected void onSuccess(List<Branch> result) {
            view.setBranches(result);
            view.showDialogIfClosed();
          }

          @Override
          protected void onFailure(Throwable exception) {
            final String errorMessage =
                (exception.getMessage() != null)
                    ? exception.getMessage()
                    : constant.branchesListFailed();
            final GitOutputConsole console =
                gitOutputConsoleFactory.create(BRANCH_LIST_COMMAND_NAME);
            console.printError(errorMessage);
            consolesPanelPresenter.addCommandOutput(appContext.getDevMachineId(), console);
            notificationManager.notify(
                constant.branchesListFailed(), FAIL, true, project.getRootProject());
          }
        });
  }
Exemplo n.º 2
0
 private void getWorkspaces(@NotNull AsyncCallback<List<WorkspaceDto>> callback) {
   final String url = baseHttpUrl;
   asyncRequestFactory
       .createGetRequest(url)
       .header(ACCEPT, APPLICATION_JSON)
       .loader(loaderFactory.newLoader("Getting info about workspaces..."))
       .send(
           newCallback(callback, dtoUnmarshallerFactory.newListUnmarshaller(WorkspaceDto.class)));
 }