예제 #1
0
  @SuppressWarnings("unchecked")
  @Override
  protected void handleEvent(AppEvent event) {
    if (event.getType() == AppEvents.AuditEventEntryView) {

      searchCriteria = null;
      currentEntity = Registry.get(Constants.ENTITY_ATTRIBUTE_MODEL);

      initUI();

      if (Registry.get(Constants.AUDIT_EVENT_TYPE_CODES) != null) {
        List<AuditEventTypeWeb> auditEventTypes =
            (List<AuditEventTypeWeb>) Registry.get(Constants.AUDIT_EVENT_TYPE_CODES);
        /*
         * for (AuditEventTypeWeb type : auditEventTypes) { Info.display("Information", "Event Types: "+
         * type.getAuditEventTypeCd() + ", " + type.getAuditEventTypeName()); }
         */
        eventTypesStore.removeAll();
        eventTypesStore.add(auditEventTypes);
      }

    } else if (event.getType() == AppEvents.Logout) {

      Dispatcher.get().dispatch(AppEvents.Logout);

    } else if (event.getType() == AppEvents.AuditEventReceived) {

      // Info.display("Information", "EventReceived");
      store.removeAll();

      AuditEventEntryListWeb events = (AuditEventEntryListWeb) event.getData();
      if (events.getAuditEventEntries() != null) {
        store.add(events.getAuditEventEntries());
      }

      grid.getSelectionModel().select(0, true);
      grid.getSelectionModel().deselect(0);

      status.hide();
      searchButton.unmask();

    } else if (event.getType() == AppEvents.EntityByIdRequest) {

      RecordWeb record = (RecordWeb) event.getData();

      if (record != null) {
        identifierStore.removeAll();

        buildRefRecordInfoDialog();
        refRecordInfoDialog.show();

        displayEntityRecord(attributeFieldMap, record);
        displayEntityIdentifier(record);
      }

    } else if (event.getType() == AppEvents.Error) {
      String message = event.getData();
      MessageBox.alert("Information", "Failure: " + message, null);
    }
  }
예제 #2
0
 @Override
 public boolean okayToReturn() {
   if (store != null && localStore) {
     store.removeAll();
   }
   return true;
 }
  private void loadTable(List<RiepilogoCostiDipendentiModel> result) {

    store.removeAll();
    store.setStoreSorter(new StoreSorter<RiepilogoCostiDipendentiModel>());
    store.setDefaultSort("nome", SortDir.ASC);
    store.add(result);
  }
  public void caricaDati() {
    // Initialize the service proxy.
    if (dstoreSvc == null) {
      dstoreSvc = GWT.create(AziendaService.class);
    }

    AsyncCallback<ArrayList> callback =
        new AsyncCallback<ArrayList>() {

          @Override
          public void onFailure(Throwable caught) {
            status.setStatus("Problemi di comunicazione col server", baseStyle);
          }

          @Override
          public void onSuccess(ArrayList result) {
            aziende = result;
            BeanModelFactory factory = BeanModelLookup.get().getFactory(Azienda.class);
            if (result != null) {
              Iterator it = result.iterator();
              while (it.hasNext()) {
                Object azienda = it.next();
                BeanModel aziendaModel = factory.createModel(azienda);
                store.add(aziendaModel);
              }
            }
            status.setStatus("Dati caricati con successo", baseStyle);
          }
        };
    // Make the call to the stock price service.
    status.setBusy("Caricamento dati in corso...");
    aziende.clear();
    store.removeAll();
    dstoreSvc.carica(callback);
  }
 @Override
 public void refresh(RefreshableEvent event) {
   if (event.getEventType() == RefreshableEvent.Type.DISTRICT_SUMMARIES) {
     ListStore<DistrictComparisonSummary> store1 = grid.getStore();
     if (store1.getCount() > 0) {
       store1.removeAll();
     }
     List<DistrictComparisons> summaries =
         getSummaries((List<DistrictComparisons>) event.getData(), parentView.loggedUser);
     for (DistrictComparisons d : summaries) {
       final String district = d.getDistrict();
       final String subcounty = d.getSubcounty();
       final String boreholes = d.getBoreholes();
       final String shallowWells = d.getShallowWells();
       final String publicTaps = d.getPublicTaps();
       final String protectedSprings = d.getProtectedSprings();
       int total =
           Integer.parseInt(boreholes)
               + Integer.parseInt(shallowWells)
               + Integer.parseInt(publicTaps)
               + Integer.parseInt(protectedSprings);
       DistrictComparisonSummary summary =
           new DistrictComparisonSummary(
               district,
               subcounty,
               boreholes,
               shallowWells,
               publicTaps,
               protectedSprings,
               String.valueOf(total));
       store1.add(summary);
     }
   }
 }
예제 #6
0
  private void refreshCategoryPickerStore(Item gradebookItemModel) {

    categoryStore.removeAll();

    if (gradebookItemModel != null) {

      ItemModelProcessor processor =
          new ItemModelProcessor(gradebookItemModel) {

            @Override
            public void doCategory(Item categoryModel) {
              categoryStore.add((ItemModel) categoryModel);
            }
          };

      processor.process();
    }
  }
 public void setStore(List<ColumnInformationWeb> columnInformationStore) {
   store.removeAll();
   store.add(columnInformationStore);
 }