Beispiel #1
0
  private void submitSearch() {
    List<ModelData> query = new ArrayList<ModelData>();

    for (Field<?> field : formFields) {
      ModelData md = new BaseModelData();
      MetaField mf = findField(field.getName());

      if (mf == null
          || !enabledFields.containsKey(mf.getName())
          || field.getValue() == null
          || field.getValue().toString().length() == 0
          || !field.isValid()) {
        GWT.log("Will not submit field " + field.getName() + ".", null);
        continue;
      }

      md.set("field", mf);
      md.set("value", field.getValue());

      query.add(md);
    }

    GWT.log("Submitting search with " + query.size() + " query elements.", null);

    AppEvent evt = new AppEvent(ApplicationEvents.SUBMIT_ADVANCED_SEARCH, query);
    evt.setData("asset", combo.getValue().getBean());
    Dispatcher.forwardEvent(evt);
  }
 public void handleEvent(AppEvent event) {
   EventType type = event.getType();
   if (type == AppEvents.Init) {
     onInit(event);
   } else if (type == AppEvents.Error) {
     onError((Throwable) event.getData());
   }
 }
 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 #5
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);
    }
  }
Beispiel #6
0
 @Override
 protected void handleEvent(AppEvent event) {
   super.handleEvent(event);
   EventType type = event.getType();
   if (type == AppEvents.MANAGEMENT_VIEW_EVENT) {
     onActivateView();
   }
 }
Beispiel #7
0
  private void onStudentsPanelReady(AppEvent event) {
    Component component = event.getData();

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

      viewportPanel.add(component, centerLayoutData);
    }
  }
Beispiel #8
0
 public void handleEvent(AppEvent event) {
   EventType type = event.getType();
   if (type == AppEvents.Init) {
     onInit(event);
   } else if (type == AppEvents.Login) {
     onLogin(event);
   } else if (type == AppEvents.Error) {
     onError(event);
   }
 }
  /**
   * (non-Javadoc)
   *
   * @see com.extjs.gxt.ui.client.mvc.Controller#handleEvent(com.extjs.gxt.ui.client .mvc.AppEvent)
   */
  @Override
  public void handleEvent(AppEvent event) {
    if (event.getType() == MapWidgetEvents.ERASE_FEATURE) {
      onEraseFeature(event);
    }

    if (event.getType() == GeoPlatformEvents.UPDATE_CENTER) {
      onUpdateCenter();
    }

    if (event.getType() == MapWidgetEvents.DRAW_FEATURE) {
      onDrawFeature(event);
    }

    if (event.getType() == GeoPlatformEvents.USER_UPDATE_HIS_NAME) {
      onUserChangeHisName(event);
    }

    forwardToView(view, event);
  }
Beispiel #10
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 #11
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);
    }
  }
 @Override
 public void handleEvent(AppEvent event) {
   EventType type = event.getType();
   if (type == AppEvents.Init) {
     forwardToView(browseView, event);
   } else if (type == AppEvents.LoadMainData) {
     forwardToView(browseView, event);
   } else if (type == AppEvents.ResetFilter
       || type == AppEvents.ViewMoveDataProviderDialog
       || type == AppEvents.ViewMoveDataSetDialog
       || type == AppEvents.AutoRefreshData
       || type == AppEvents.RemoveGridOperations) {
     forwardToView(browseView, event);
   }
 }
 @Override
 public void handleEvent(AppEvent event) {
   EventType type = event.getType();
   if (type == MainEvents.Init) {
     forwardToView(reportView, event);
   }
   if (type == MainEvents.ReportGraphicTrustDiagram) {
     forwardToView(grdView, event);
   }
   if (type == MainEvents.ReportGraphicCancel) {
     forwardToView(grdView, event);
   }
   if (type == MainEvents.ReportGraphicTrustSPGrid) {
     forwardToView(tblSPView, event);
   }
   if (type == MainEvents.ReportGraphicTrustIPGrid) {
     forwardToView(tblIPView, event);
   }
 }
Beispiel #15
0
  @Override
  protected void handleEvent(AppEvent event) {
    EventType eventType = event.getType();

    if (eventType.equals(CommonEvents.Init)) {
      onInit();
    } else if (eventType.equals(CommonEvents.Error)) {
      onError();
    } else if (eventType.equals(StudentEvents.NavigationPanelReady)) {
      onNavigationPanelReady(event);
    } else if (eventType.equals(StudentEvents.StudentsPanelReady)) {
      onStudentsPanelReady(event);
    } else if (eventType.equals(StudentEvents.InformationPanelReady)) {
      onInformationPanelReady(event);
    } else if (eventType.equals(StudentEvents.MenuBarReady)) {
      onMenuBarReady(event);
    } else if (eventType.equals(StudentEvents.StatusBarReady)) {
      onStatusBarReady(event);
    } else if (eventType.equals(StudentEvents.UIReady)) {
      onUIReady();
    }
  }
Beispiel #16
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 #17
0
 protected void onError(AppEvent ae) {
   System.out.println("error: " + ae.<Object>getData());
 }
 /** @param event */
 private void onEraseFeature(AppEvent event) {
   ((MapView) this.view).eraseFeature((VectorFeature) event.getData());
 }
Beispiel #19
0
 private void onMenuBarReady(AppEvent event) {
   viewportPanel.setTopComponent(event.<Component>getData());
 }
Beispiel #20
0
 private void onStatusBarReady(AppEvent event) {
   viewportPanel.setBottomComponent(event.<Component>getData());
 }
 private void onDrawFeature(AppEvent event) {
   ((MapView) this.view).drawFeature((VectorFeature) event.getData());
 }
Beispiel #22
0
 /*
  * (non-Javadoc)
  *
  * @see com.extjs.gxt.ui.client.mvc.View#handleEvent(com.extjs.gxt.ui.client.mvc.AppEvent)
  */
 @Override
 protected void handleEvent(AppEvent event) {
   if (event.getType() == GeofenceEvents.INIT_GEOFENCE_MAIN_UI) {
     initUI();
   }
 }