Package com.extjs.gxt.ui.client.mvc

Examples of com.extjs.gxt.ui.client.mvc.Dispatcher


    GXT.setDefaultTheme(Theme.GRAY, true);

    MailServiceAsync service = (MailServiceAsync) GWT.create(MailService.class);
    Registry.register(SERVICE, service);

    Dispatcher dispatcher = Dispatcher.get();
    dispatcher.addController(new AppController());
    dispatcher.addController(new MailController());
    dispatcher.addController(new TaskController());
    dispatcher.addController(new ContactController());

    dispatcher.dispatch(AppEvents.Login);
   
    GXT.hideLoadingPanel("loading");
  }
View Full Code Here


   
    if (!GXT.isIE) {
      loadCss("firefox.css");
    }
    // simply register main controller...
    final Dispatcher dispatcher = Dispatcher.get();
    dispatcher.addController(new WPaloController());
    WorkbenchController wBenchController = new WorkbenchController();
    dispatcher.addController(wBenchController);
    // the left side content:   
    final ViewBrowserController viewBrowserController = new ViewBrowserController();
    wBenchController.setViewBrowserController(viewBrowserController);
    dispatcher.addController(viewBrowserController);
    // dispatcher.addController(new ReportController());
    // dispatcher.addController(new ReportStructureController());
    // dispatcher.addController(new ModellerController());
    dispatcher.addController(new AdminController());
    dispatcher.addController(new AccountController());
    // dispatcher.addController(new ViewModeWorkbenchController());
    // dispatcher.addController(new ViewModeController());

    PrintDialog.setDefaults();
   
View Full Code Here

      public void handleEvent(BoxComponentEvent be) { 
        user = dlg.getUser();       
        if (directLink == null) {
          Dispatcher.forwardEvent(WPaloEvent.INIT, user);
        } else {
          final Dispatcher dispatcher = Dispatcher.get();
          final String locale = Window.Location.getParameter("locale");
          WPaloServiceProvider.getInstance().openViewAfterLogin(locale, user.getSessionId(), directLink,
              new AsyncCallback<XDirectLinkData>() {
                public void onSuccess(final XDirectLinkData data) {                 
                  if (!data.isAuthenticated()) {
                    dispatcher.dispatch(WPaloEvent.APP_START);
                    if (data.getErrors().length > 0) {
                      StringBuffer buf = new StringBuffer();
                      for (String s: data.getErrors()) {
                        buf.append(s + "\n");
                      }
                      MessageBox.alert(constants.errorsWhileProcessingOptions(),
                          buf.toString(), null);
                    }
                  } else {
//                    CubeViewEditor.fromDirectLink = true;
                    XView [] xViews = data.getViews();
                    if (xViews == null || xViews.length == 0) {
                      dispatcher.dispatch(WPaloEvent.INIT, DisplayFlags.createDisplayFlags(user, data.getGlobalDisplayFlags()));
                      directLogin(user);
                      if (data.getErrors().length > 0) {
                        StringBuffer buf = new StringBuffer();
                        for (String s: data.getErrors()) {
                          buf.append(s + "\n");
                        }
                        MessageBox.alert(constants.errorsWhileProcessingOptions(), buf.toString(), null);
                      }
                      return;
                    }
                    LargeQueryWarningDialog.hideWarnDialog = true;                   
                    for (int i = 1; i < xViews.length; i++) {
                      ((WorkbenchController) getController()).getViewBrowserController().
                        addViewToLoad(xViews[i]);
                    }
                    XView xView = xViews[0];
                    DisplayFlags.setDisplayFlagsFor(xView, user, xView.getDisplayFlags(), data.getGlobalDisplayFlags());
                    DisplayFlags displayFlags = DisplayFlags.getDisplayFlagsFor(xView);
                    dispatcher.dispatch(WPaloEvent.INIT, displayFlags);
                    directLogin(user);
//                    CubeViewEditor.hasBeenResized = true;
                    dispatcher.dispatch(WPaloEvent.EDIT_VIEWBROWSER_VIEW, xView);
                    if (data.getErrors().length > 0) {
                      StringBuffer buf = new StringBuffer();
                      for (String s: data.getErrors()) {
                        buf.append(s + "\n");
                      }
                      MessageBox.alert(constants.errorsWhileProcessingOptions(), buf.toString(), null);
                    }
                  }
                }
               
                public void onFailure(Throwable arg0) {
                  dispatcher.dispatch(WPaloEvent.APP_START);
                }
              });         
        }
      }
    });
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.mvc.Dispatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.