Esempio n. 1
0
  @Override
  public void updateView(List<Zone> models) {
    try {
      if (models != null) {
        boolean allOperationsSuccess = true;
        for (Zone model : models) {
          boolean success = true;
          if (model != null) {
            if (model.getErrorMessage() != null) {
              success = false;
              if (allOperationsSuccess) {
                allOperationsSuccess = false;
              }
            } else {
              success = true;
            }
            if ("REMOVE".equalsIgnoreCase(model.getSTATUS())) {
              if (success) {
                listStore.remove(model);
                presenter.removeModelToBeRemoved(model);
              } else {
                Zone oldModel =
                    listStore.findModelWithKey(listStore.getKeyProvider().getKey(model));
                if (oldModel != null) {
                  oldModel.merge(model);
                }
              }
            } else {
              Zone oldModel = listStore.findModelWithKey(listStore.getKeyProvider().getKey(model));
              if (success) {
                model.setErrorMessage(null);
                model.setSTATUS("IGNORE");
              }
              if (oldModel != null) {
                oldModel.merge(model);
              }
            }
          }
        }
        if (allOperationsSuccess) {
          formReset();
          presenter.clearModelsToBeRemoved();
          listStore.commitChanges();
        }
        grid.getView().refresh(false);
      }
    } catch (Exception ex) {
      ViewUtils.notify(htmlMessage, new SystemMessage(ex.getMessage()));
      Window.alert(ex.getMessage());
      ex.printStackTrace(System.out);
    } finally {
      Info.display(messages.message(), messages.finished());

      if (box != null) {
        box.hide();
        box = null;
      }
    }
  }
Esempio n. 2
0
 @Override
 public void updateView(Zone model) {
   Info.display(messages.message(), messages.finished());
   if (box != null) {
     box.hide();
     box = null;
   }
 }
Esempio n. 3
0
 @Override
 public void displayMessage(String aMessage) {
   Info.display("MEssaggio", aMessage);
 }
Esempio n. 4
0
 @Override
 public void editEntity() {
   DocumentUploadWindow.getInstance().show();
   Info.display("Edit document", "Edit document");
 }