Example usage for com.google.gwt.user.client Window enableScrolling

List of usage examples for com.google.gwt.user.client Window enableScrolling

Introduction

In this page you can find the example usage for com.google.gwt.user.client Window enableScrolling.

Prototype

public static void enableScrolling(boolean enable) 

Source Link

Usage

From source file:org.ednovo.gooru.application.client.home.HomePresenter.java

License:Open Source License

private void callBackMethods() {
    GWT.runAsync(new SimpleRunAsyncCallback() {

        @Override/* w  ww  .ja  va2s . c  om*/
        public void onSuccess() {
            if (AppClientFactory.getLoggedInUser().getConfirmStatus() == 0) {
                AppClientFactory.fireEvent(new ConfirmStatusPopupEvent(true));
            }
            if (getPlaceManager().getRequestParameter(CALLBACK) != null
                    && getPlaceManager().getRequestParameter(CALLBACK).equalsIgnoreCase("registration")) {
                getUserService().getRegistredUserDetails(
                        AppClientFactory.getPlaceManager().getRequestParameter(GOORU_UID),
                        getRegisterdUserAsyncCallback());
                parentGooruUID = AppClientFactory.getPlaceManager().getRequestParameter(GOORU_UID);
            } else if (getPlaceManager().getRequestParameter(CALLBACK) != null
                    && getPlaceManager().getRequestParameter(CALLBACK).equalsIgnoreCase("changePassword")) {
                validateResetLink(AppClientFactory.getPlaceManager().getRequestParameter("resetToken"));
            } else if (getPlaceManager().getRequestParameter(CALLBACK) != null
                    && getPlaceManager().getRequestParameter(CALLBACK).equalsIgnoreCase("signup")) {
                //To show SignUp (Registration popup)
                if (AppClientFactory.isAnonymous()) {
                    Window.enableScrolling(false);
                    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(98, false));
                    String type = getPlaceManager().getRequestParameter("type");
                    int displayScreen = getPlaceManager().getRequestParameter("type") != null
                            ? Integer.parseInt(type)
                            : 1;
                    signUpViewPresenter.displayPopup(displayScreen);
                    addToPopupSlot(signUpViewPresenter);
                }
            } else if (getPlaceManager().getRequestParameter(CALLBACK) != null
                    && getPlaceManager().getRequestParameter(CALLBACK).equalsIgnoreCase("registerChild")) {
                if (getPlaceManager().getRequestParameter("dob") != null
                        && getPlaceManager().getRequestParameter("userName") != null) {
                    String externalId = AppClientFactory.getLoggedInUser().getExternalId();
                    String email = AppClientFactory.getLoggedInUser().getEmailId();

                    String parentEmailId = email != null && !email.equalsIgnoreCase("") ? email
                            : externalId != null && externalId.equalsIgnoreCase("") ? externalId : null;
                    String parameterEmailId = getPlaceManager().getRequestParameter("emailId", null);
                    parentEmailId = parameterEmailId != null && !parameterEmailId.equalsIgnoreCase("")
                            ? parameterEmailId
                            : parentEmailId;

                    StudentSignUpUc studentSignUp = new StudentSignUpUc(parentEmailId,
                            getPlaceManager().getRequestParameter("userName"),
                            getPlaceManager().getRequestParameter("dob").replaceAll("D", "\\/"),
                            AppClientFactory.isAnonymous()
                                    ? getPlaceManager().getRequestParameter("privateGooruUId")
                                    : AppClientFactory.getLoggedInUser().getGooruUId());
                    studentSignUp.center();
                    studentSignUp.show();
                }
            } else if (getPlaceManager().getRequestParameter(CALLBACK) != null
                    && getPlaceManager().getRequestParameter(CALLBACK).equalsIgnoreCase("guide")) {

            } else if (getPlaceManager().getRequestParameter(CALLBACK) != null
                    && getPlaceManager().getRequestParameter(CALLBACK).equalsIgnoreCase("profileUpdate")) {
                if (AppClientFactory.isAnonymous()) {
                    AppClientFactory.fireEvent(new InvokeLoginEvent());
                } else {
                    signUpCompletePresenter.displayView();
                    addToPopupSlot(signUpCompletePresenter);
                }
            } else if (getPlaceManager().getRequestParameter(CALLBACK) != null
                    && getPlaceManager().getRequestParameter(CALLBACK).equalsIgnoreCase("turn13")) {
                if (AppClientFactory.isAnonymous()) {
                    AppClientFactory.fireEvent(new InvokeLoginEvent());
                } else {
                    if (!signUpAfterThirteenPresenter.isVisible()) {
                        signUpAfterThirteenPresenter.displayView();
                        addToPopupSlot(signUpAfterThirteenPresenter);
                    }
                }
            } else if (getPlaceManager().getRequestParameter(CALLBACK) != null
                    && getPlaceManager().getRequestParameter(CALLBACK).equalsIgnoreCase("confirmUser")) {
                //SignUpGradeCourseView gradeCourseView = new SignUpGradeCourseView(AppClientFactory.getLoggedInUser());
                //Check if user is logged or not.
                if (AppClientFactory.isAnonymous()) {
                    //If not Open Login Popup
                    AppClientFactory.fireEvent(new InvokeLoginEvent());
                } else {
                    if (AppClientFactory.getLoggedInUser().getConfirmStatus() == 0) {
                        String gooruUid = getPlaceManager().getRequestParameter("gooruuid") != null
                                ? getPlaceManager().getRequestParameter("gooruuid")
                                : "";
                        String token = getPlaceManager().getRequestParameter("sessionid") != null
                                ? getPlaceManager().getRequestParameter("sessionid")
                                : "";
                        Map<String, String> params = new HashMap<String, String>();
                        params.put("confirmUser", "true");
                        params.put("gooruUid", AppClientFactory.getLoggedInUser().getGooruUId());
                        // Confirm User and remove/hide Not confirmed Popup.
                        AppClientFactory.getInjector().getUserService().updateUserDetails(gooruUid, token,
                                params, new SimpleAsyncCallback<ProfileDo>() {
                                    @Override
                                    public void onSuccess(ProfileDo result) {
                                        //Display thanks popup if required.
                                        //Set Visiblity to false
                                        AppClientFactory.setLoggedInUser(result.getUser());
                                        boolean isConfirmed = result.getUser().getConfirmStatus() == 1 ? true
                                                : false;
                                        if (isConfirmed) {
                                            AppClientFactory
                                                    .fireEvent(new ConfirmStatusPopupEvent(isConfirmed));
                                            ThanksEmailConfirmPopupUc confirmPopup = new ThanksEmailConfirmPopupUc();
                                            confirmPopup.center();
                                            confirmPopup.show();
                                        }
                                    }
                                });
                    }
                }
            }

            if (getPlaceManager().getRequestParameter(LOGINEVENT) != null
                    && getPlaceManager().getRequestParameter(LOGINEVENT).equalsIgnoreCase("true")
                    && AppClientFactory.isAnonymous()) {
                AppClientFactory.fireEvent(new InvokeLoginEvent());
            }

            if (getPlaceManager().getRequestParameter(ERROR) != null
                    && getPlaceManager().getRequestParameter(ERROR).equals("401")
                    && AppClientFactory.isAnonymous()) {
                new AlertContentUc(i18n.GL1966(), i18n.GL1938());
            }

            final UserDo userDo = AppClientFactory.getLoggedInUser();
            int flag = userDo != null ? userDo.getViewFlag() : 0;
            final String loginType = userDo != null && userDo.getLoginType() != null ? userDo.getLoginType()
                    : "";
            //Show Popup where user can update his details like, username and role. Show this only for non regular user and if he is logging for the first time.
            if (!AppClientFactory.isAnonymous() && flag == 0 && !loginType.equalsIgnoreCase(CREDENTIAL)) {
                Window.enableScrolling(false);
                AlmostDoneUc update = new AlmostDoneUc(AppClientFactory.getLoggedInUser().getEmailId(),
                        AppClientFactory.getLoggedInUser());
                update.setGlassEnabled(true);
                update.show();
                update.center();
                Document doc = Document.get();
                Element bodyelement = doc.getBody();
                Window.scrollTo(0, 0);
                bodyelement.getParentElement().setAttribute("style", "overflow:hidden");
            } else if (flag > 0 && flag <= 11 && !AppClientFactory.isAnonymous()) {
                showMarketingPopup(userDo);
            }

            AppClientFactory.fireEvent(new SetFooterEvent(
                    AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()));
        }
    });
}

From source file:org.ednovo.gooru.application.client.home.HomeView.java

License:Open Source License

/**
 * @function setIds/*from  w  w w.ja  v  a  2  s  . com*/
 *
 * @created_date : Jul 28, 2014
 *
 * @description
 *
 *
 *
 * @return : void
 *
 * @throws : <Mentioned if any exceptions>
 *
 *
 *
 *
*/

private void setIds() {
    StringUtil.setAttributes(btnSignUp.getElement(), "btnHomeSignUp", i18n.GL0186(), i18n.GL0186());
    StringUtil.setAttributes(btnSearch.getElement(), "btnSearch", i18n.GL0176(), i18n.GL0176());

    StringUtil.setAttributes(lblHeading.getElement(), "lblHeading", i18n.GL2046(), i18n.GL2046());
    StringUtil.setAttributes(lblSubHeading.getElement(), "lblSubHeading", i18n.GL2047(), i18n.GL2047());

    getEditSearchTxtBox().getElement().setAttribute("placeholder", i18n.GL2073());
    getEditSearchTxtBox().getElement().setId("txtEditSearch");

    htmlDescription.setHTML(i18n.GL2102());
    StringUtil.setAttributes(htmlDescription.getElement(), "htmlDescription", i18n.GL2102_1(), i18n.GL2102_1());

    if (AppClientFactory.isAnonymous()) {
        btnSignUp.setVisible(true);
    } else {
        btnSignUp.setVisible(false);
    }
    Window.enableScrolling(true);
}

From source file:org.ednovo.gooru.application.client.home.HomeView.java

License:Open Source License

@UiHandler("achTerms")
public void onClickTermsLink(ClickEvent envent) {
    GWT.runAsync(new SimpleRunAsyncCallback() {

        @Override/* w  w  w. j  a  v a2s  .  c  om*/
        public void onSuccess() {

            Window.enableScrolling(false);
            AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99, false));

            termsOfUse = new TermsOfUse() {

                @Override
                public void openParentPopup() {
                    // TODO Auto-generated method stub

                }

            };
            termsOfUse.show();
            termsOfUse.center();

        }
    });
}

From source file:org.ednovo.gooru.application.client.home.HomeView.java

License:Open Source License

@UiHandler("achPrivacy")
public void onClickPrivacyLink(ClickEvent envent) {
    GWT.runAsync(new SimpleRunAsyncCallback() {

        @Override/*from  ww  w .  j a v  a 2s  .com*/
        public void onSuccess() {

            Window.enableScrolling(false);
            AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99, false));
            TermsAndPolicyVc termsAndPolicyVc = new TermsAndPolicyVc(false) {

                @Override
                public void openParentPopup() {

                }
            };
            termsAndPolicyVc.show();
            termsAndPolicyVc.center();

        }
    });
}

From source file:org.ednovo.gooru.application.client.home.HomeView.java

License:Open Source License

@UiHandler("achCopyright")
public void onClickCopyrightLink(ClickEvent envent) {
    GWT.runAsync(new SimpleRunAsyncCallback() {

        @Override/*from   ww  w .j  a v a  2s .  com*/
        public void onSuccess() {

            Window.enableScrolling(false);
            AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99, false));

            CopyRightPolicyVc copyRightPolicy = new CopyRightPolicyVc() {

                @Override
                public void openParentPopup() {
                    //No need to set.
                }
            };
            copyRightPolicy.center();
            copyRightPolicy.show();

        }
    });
}

From source file:org.ednovo.gooru.application.client.home.HomeView.java

License:Open Source License

@Override
public void onSelection(SelectionEvent<Suggestion> event) {
    final String searchText = txtSearch.getText().replaceAll("-<n> Gooru Search</n>", "");
    txtSearch.setText(searchText.trim());
    GWT.runAsync(new SimpleRunAsyncCallback() {

        @Override//from   w  w w. j  a  va2 s  . c o m
        public void onSuccess() {
            Window.enableScrolling(true);
            AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true));
            if (txtSearch.getText() != null && txtSearch.getText().length() > 0) {
                MixpanelUtil.Perform_Search(txtSearch.getText().trim().toLowerCase(), "HeaderUc");
                Map<String, String> params = new HashMap<String, String>();
                params = updateParams(params);
                savePlaceRequest();
                if (AppClientFactory.getCurrentPlaceToken().equalsIgnoreCase(PlaceTokens.COLLECTION_SEARCH)) {
                    AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.COLLECTION_SEARCH, params);
                } else {
                    String queryVal = params.get("query");
                    //queryVal = queryVal.replaceAll("%5C1", "&");
                    Map<String, String> map = params;
                    map.put("query", queryVal);
                    AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.SEARCH_COLLECTION, map);
                }
                txtSearch.setText("");
                AppClientFactory.fireEvent(new HomeEvent(HeaderTabType.DISCOVER));
                txtSearch.hideSuggestionList();
            }
            MixpanelUtil.mixpanelEvent("Select_Autocomplete_Search");
            getEditSearchTxtBox().setText(searchText.trim());

        }
    });
}

From source file:org.ednovo.gooru.application.client.home.presearch.PreSearchPresenter.java

License:Open Source License

@Override
public void showStandardsPopup(String standardVal, String standardsDesc,
        List<LiPanelWithClose> collectionLiPanelWithCloseArray) {
    Window.enableScrolling(false);
    standardsPopupPresenter.callStandardsBasedonTypeService(standardVal, standardsDesc);
    standardsPopupPresenter.setPreSearchPresenter(this);
    standardsPopupPresenter.setAlreadySelectedItems(collectionLiPanelWithCloseArray);
    addToPopupSlot(standardsPopupPresenter);
}

From source file:org.ednovo.gooru.application.client.home.presearch.PreSearchView.java

License:Open Source License

@UiHandler("ancLogin")
public void onClickLogin(ClickEvent event) {
    GWT.runAsync(new SimpleRunAsyncCallback() {
        @Override// ww  w. java2  s .  c  o  m
        public void onSuccess() {
            Window.enableScrolling(false);
            AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99, false));
            LoginPopupUc popup = new LoginPopupUc() {
                @Override
                public void onLoginSuccess() {

                }
            };
            popup.setGlassEnabled(true);
            popup.center();
            popup.show();
        }
    });

}

From source file:org.ednovo.gooru.application.client.newhome.NewHomePresenter.java

License:Open Source License

@Override
protected void onReveal() {
    super.onReveal();
    Window.enableScrolling(true);

    if (AppClientFactory.isAnonymous()) {
        AppClientFactory.setBrowserWindowTitle(SeoTokens.HOME_TITLE_ANONYMOUS);
    } else {//from   w  ww .jav a2 s.  c o m
        AppClientFactory.setBrowserWindowTitle(SeoTokens.HOME_TITLE_LOGGEDIN);
    }
    AppClientFactory.setMetaDataDescription(SeoTokens.HOME_META_DESCRIPTION);
    AppClientFactory.fireEvent(new HomeEvent(HeaderTabType.HOME));
    if (AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken() != null) {
        AppClientFactory.fireEvent(
                new SetFooterEvent(AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()));
    }

    Document doc = Document.get();
    if (doc.getElementById("uvTab") != null) {
        doc.getElementById("uvTab").getStyle().setDisplay(Display.BLOCK);
    }

}

From source file:org.ednovo.gooru.application.client.newhome.NewHomePresenter.java

License:Open Source License

@Override
public void onBind() {
    super.onBind();
    Window.enableScrolling(true);
    MixpanelUtil.Arrive_Landing_Page();/*from  ww  w .j ava 2s.com*/
    setRegisterdUserAsyncCallback(new SimpleAsyncCallback<UserDo>() {
        @Override
        public void onSuccess(final UserDo user) {
            GWT.runAsync(new SimpleRunAsyncCallback() {

                @Override
                public void onSuccess() {
                    initilazeRegistrationView(user);
                }
            });
        }
    });
    setInSlot(BANNER_SLOT, banner);
    setInSlot(PRESEARCH_SLOT, presearchPresenter);
}