Beispiel #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);
    }
  }
 public void handleEvent(AppEvent event) {
   EventType type = event.getType();
   if (type == AppEvents.Init) {
     onInit(event);
   } else if (type == AppEvents.Error) {
     onError((Throwable) event.getData());
   }
 }
Beispiel #3
0
  private void onStudentsPanelReady(AppEvent event) {
    Component component = event.getData();

    if (component != null) {
      BorderLayoutData centerLayoutData = new BorderLayoutData(Style.LayoutRegion.CENTER);

      viewportPanel.add(component, centerLayoutData);
    }
  }
 public void handleEvent(AppEvent event) {
   EventType type = event.getType();
   if (type.equals(PagamentoSellaEvents.ShowForm)) {
     forwardToView(pagamentroView, event);
     OrdineModel model = (OrdineModel) event.getData();
     pagamentroView.setPagamentoModel(model);
   } else {
     forwardToView(pagamentroView, event);
   }
 }
 @Override
 protected void handleEvent(AppEvent event) {
   if (event.getType() == AppEvents.INIT) {
     initUI();
   } else if (event.getType() == AppEvents.NAV_STORAGE) {
     List<StorageEngine> engines = event.getData();
     if (engines != null) {
       storageEnginesPanel.getStore().add(engines);
     }
   }
 }
Beispiel #6
0
  @SuppressWarnings("unchecked")
  @Override
  protected void handleEvent(AppEvent event) {

    if (event.getType() == AppEvents.ProfileView) {
      initUI();
      clearFormFields(false);

      updateUser = Registry.get(Constants.LOGIN_USER);
      displayRecords(updateUser);

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

      status.hide();
      submitButton.unmask();

      updateUser = (UserWeb) event.getData();
      Registry.register(Constants.LOGIN_USER, updateUser);

      MessageBox.alert("Information", "User profile was successfully updated", listenInfoMsg);

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

      UserWeb user = copyUserFromGUI(updateUser);
      controller.handleEvent(new AppEvent(AppEvents.ProfileUpdateInitiate, user));

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

      status.hide();
      submitButton.unmask();

      MessageBox.alert("Information", "Incorrect current password", listenInfoMsg);

    } else if (event.getType() == AppEvents.Error) {
      status.hide();
      submitButton.unmask();

      String message = event.getData();
      MessageBox.alert("Information", "Failure: " + message, listenFailureMsg);
    }
  }
Beispiel #7
0
  private void onInformationPanelReady(AppEvent event) {
    Component component = event.getData();

    if (component != null) {
      BorderLayoutData eastLayoutData =
          new BorderLayoutData(Style.LayoutRegion.EAST, 500, 200, 500);
      eastLayoutData.setCollapsible(true);
      eastLayoutData.setSplit(true);

      viewportPanel.add(component, eastLayoutData);
    }
  }
Beispiel #8
0
  private void onNavigationPanelReady(AppEvent event) {
    Component component = event.getData();

    if (component != null) {
      BorderLayoutData westLayoutData =
          new BorderLayoutData(Style.LayoutRegion.WEST, 200, 150, 400);
      westLayoutData.setCollapsible(true);
      westLayoutData.setSplit(true);

      viewportPanel.add(component, westLayoutData);
    }
  }
  @Override
  public void handleEvent(AppEvent event) {
    final EventType type = event.getType();

    if (type.equals(EnvCreateEvents.CreateRequest)) {
      LOG.finest("CreateRequest");
      final String name = event.<String>getData("name");
      final int floors = event.getData("floors");
      final Polygon outline = event.<Polygon>getData("outline");
      final List<ExtDevice> devices = event.<List<ExtDevice>>getData("devices");
      final List<ExtSensor> sensors = event.<List<ExtSensor>>getData("sensors");
      onCreateRequest(name, floors, outline, devices, sensors);

    } else

    /*
     * Pass through to view
     */
    {
      forwardToView(creator, event);
    }
  }
 /** @param event */
 private void onEraseFeature(AppEvent event) {
   ((MapView) this.view).eraseFeature((VectorFeature) event.getData());
 }
 private void onDrawFeature(AppEvent event) {
   ((MapView) this.view).drawFeature((VectorFeature) event.getData());
 }
Beispiel #12
0
 private void onStatusBarReady(AppEvent event) {
   viewportPanel.setBottomComponent(event.<Component>getData());
 }
Beispiel #13
0
 private void onMenuBarReady(AppEvent event) {
   viewportPanel.setTopComponent(event.<Component>getData());
 }
Beispiel #14
0
 protected void onError(AppEvent ae) {
   System.out.println("error: " + ae.<Object>getData());
 }