コード例 #1
0
ファイル: Setup.java プロジェクト: genievn/LD
  @Override
  public void onModuleLoad() {
    // Setup the language for localization
    RequestInfo loc = WindowUtils.getRequestInfo();

    // Tries to capture locale parameter
    String lang;
    if (loc.getParameter(Constants.LOCALE) != null
        && !loc.getParameter(Constants.LOCALE).equals("")) {
      lang = loc.getParameter(Constants.LOCALE);
    } else {
      // First we initialize language values
      lang = Util.getBrowserLanguage();
    }
    I18N.setLocale(lang);

    // Get grid of scrollbars, and clear out the window's built-in margin,
    // because we want to take advantage of the entire client area.
    Window.enableScrolling(false);
    Window.setMargin("0px");

    infoService.getInfo(
        I18N.getLocale(),
        new AsyncCallback<GUIInfo>() {
          @Override
          public void onFailure(Throwable error) {
            SC.warn(error.getMessage());
          }

          @Override
          public void onSuccess(GUIInfo info) {
            I18N.init(info);

            WindowUtils.setTitle(
                info.getProductName()
                    + " "
                    + info.getRelease()
                    + (info.getLicensee() != null
                        ? " - " + I18N.message("licensedto") + ": " + info.getLicensee()
                        : ""));
            initGUI(info);
          }
        });
  }