Esempio n. 1
0
 @Override
 public void onDelete() {
   actionRequiringConfirmation =
       new Runnable() {
         @Override
         public void run() {
           String name = taxonomy.getName();
           ResourceRequestBuilderFactory.newBuilder() //
               .forResource(UriBuilders.SYSTEM_CONF_TAXONOMY.create().build(name)) //
               .withCallback(
                   SC_OK,
                   new ResponseCodeCallback() {
                     @Override
                     public void onResponseCode(Request request, Response response) {
                       fireEvent(new TaxonomyDeletedEvent(taxonomy));
                     }
                   }) //
               .withCallback(SC_NOT_FOUND, new TaxonomyNotFoundCallBack(name)) //
               .delete()
               .send();
         }
       };
   fireEvent(
       ConfirmationRequiredEvent.createWithMessages(
           actionRequiringConfirmation,
           translationMessages.removeTaxonomy(),
           translationMessages.confirmDeleteTaxonomy()));
 }
Esempio n. 2
0
  public String getNoSelectionErrorMessage() {
    if (folderDetailsPresenter.isSingleSelectionModel()) {
      return translationMessages.mustSelectFileFolder(
          translations.fileFolderTypeMap().get(fileSelectionType.name()));
    }

    return translationMessages.mustSelectAtLeastFileFolder(
        translations.fileFolderTypeMap().get(fileSelectionType.name()));
  }
Esempio n. 3
0
  @Override
  public void onDeleteIdentifiersMapping(VariableDto variable) {
    removeConfirmation = new RemoveIdentifiersMappingRunnable(variable);

    ConfirmationRequiredEvent event =
        ConfirmationRequiredEvent.createWithMessages(
            removeConfirmation,
            translationMessages.removeIdentifiersMapping(),
            translationMessages.confirmRemoveIdentifiersMapping());

    fireEvent(event);
  }
Esempio n. 4
0
  @Override
  public void onRemove() {
    removeConfirmation = new RemoveRunnable();

    ConfirmationRequiredEvent event;
    event =
        table.hasViewLink()
            ? ConfirmationRequiredEvent.createWithMessages(
                removeConfirmation,
                translationMessages.removeDerivedVariable(),
                translationMessages.confirmRemoveDerivedVariable())
            : ConfirmationRequiredEvent.createWithMessages(
                removeConfirmation,
                translationMessages.removeVariable(),
                translationMessages.confirmRemoveVariable());

    fireEvent(event);
  }
Esempio n. 5
0
  @Override
  public void onDeleteVariables(List<VariableDto> variableDtos) {
    if (variableDtos.isEmpty()) {
      fireEvent(NotificationEvent.newBuilder().error("DeleteVariableSelectAtLeastOne").build());
    } else {
      JsArrayString variableNames = JsArrays.create().cast();
      for (VariableDto variable : variableDtos) {
        variableNames.push(variable.getName());
      }

      deleteVariablesConfirmation = new RemoveVariablesRunnable(variableNames);

      fireEvent(
          ConfirmationRequiredEvent.createWithMessages(
              deleteVariablesConfirmation,
              translationMessages.removeVariables(),
              translationMessages.confirmRemoveVariables(variableNames.length())));
    }
  }