Ejemplo n.º 1
0
 private void renameBranch() {
   final String selectedBranchName = getSelectedBranchName();
   dialogFactory
       .createInputDialog(
           constant.branchTitleRename(),
           constant.branchTypeRename(),
           selectedBranchName,
           0,
           selectedBranchName.length(),
           getNewBranchNameCallback(),
           null)
       .show();
 }
Ejemplo n.º 2
0
  /** {@inheritDoc} */
  @Override
  public void onCreateClicked() {
    dialogFactory
        .createInputDialog(
            constant.branchCreateNew(),
            constant.branchTypeNew(),
            new InputCallback() {
              @Override
              public void accepted(String value) {
                if (!value.isEmpty()) {
                  service.branchCreate(
                      workspaceId,
                      project.getRootProject(),
                      value,
                      null,
                      new AsyncRequestCallback<Branch>(
                          dtoUnmarshallerFactory.newUnmarshaller(Branch.class)) {
                        @Override
                        protected void onSuccess(Branch result) {
                          getBranches();
                        }

                        @Override
                        protected void onFailure(Throwable exception) {
                          final String errorMessage =
                              (exception.getMessage() != null)
                                  ? exception.getMessage()
                                  : constant.branchCreateFailed();
                          final GitOutputConsole console =
                              gitOutputConsoleFactory.create(BRANCH_CREATE_COMMAND_NAME);
                          console.printError(errorMessage);
                          consolesPanelPresenter.addCommandOutput(
                              appContext.getDevMachineId(), console);
                          notificationManager.notify(
                              constant.branchCreateFailed(), FAIL, true, project.getRootProject());
                        }
                      });
                }
              }
            },
            null)
        .show();
  }