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.client.mvp.home.LogoutPopupVc.java

License:Open Source License

/**
 * Cancel the logout and hide logout popup
 * @param clickEvent instance of {@link ClickEvent}
 *//*ww  w  .j  a  v  a  2s . c om*/
@UiHandler("cancelAnr")
public void onCancelClick(ClickEvent clickEvent) {
    appPopUp.hide();

    Window.enableScrolling(true);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true));
}

From source file:org.ednovo.gooru.client.mvp.home.LogoutPopupVc.java

License:Open Source License

/**
 * Logout from signed user and makes as a anonymous user 
 * @param clickEvent instance of {@link ClickEvent}
 */// w ww .  ja v a  2 s  .  c o  m
@UiHandler("okBtnUc")
public void userLogout(ClickEvent clickEvent) {
    AppClientFactory.getInjector().getAppService().v2Signout(new SimpleAsyncCallback<UserDo>() {

        @Override
        public void onSuccess(UserDo result) {

            String premiumAccountUserName = AppClientFactory.getLoggedInUser().getUsername();

            AppClientFactory.fireEvent(new ClearClasspageListEvent());

            Window.enableScrolling(true);
            AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true));
            AppClientFactory.setLoggedInUser(result);
            AppClientFactory.getInjector().getWrapPresenter().get().setLoginData(result);
            //AppClientFactory.resetPlace();
            if (premiumAccountUserName.equalsIgnoreCase("TexasTeacher")) {
                AppClientFactory.fireEvent(new SetTexasAccountEvent("failure"));
                AppClientFactory.fireEvent(new SetTexasPlaceHolderEvent(false));
            } else {
                AppClientFactory.fireEvent(new SetTexasAccountEvent("success"));
                AppClientFactory.fireEvent(new SetTexasPlaceHolderEvent(true));
            }
            AppClientFactory.fireEvent(new StandardPreferenceSettingEvent(null));

            if (AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()
                    .equalsIgnoreCase(PlaceTokens.HOME)
                    || AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()
                            .equalsIgnoreCase(PlaceTokens.RESOURCE_SEARCH)
                    || AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()
                            .equalsIgnoreCase(PlaceTokens.COLLECTION_SEARCH)) {
                Map<String, String> map = StringUtil.splitQuery(Window.Location.getHref());
                if (map.containsKey("query")) {
                    String queryVal = map.get("query");
                    queryVal = queryVal.replaceAll("%5C1", "&");
                    try {
                        queryVal = URL.decodeQueryString(queryVal);
                    } catch (Exception ex) {

                    }
                    map.put("query", queryVal);
                }
                if (map.containsKey("flt.subjectName")) {
                    String subjectNameVal = map.get("flt.subjectName");
                    subjectNameVal = subjectNameVal.replaceAll("%5C1", "&");
                    try {
                        subjectNameVal = URL.decodeQueryString(subjectNameVal);
                    } catch (Exception ex) {

                    }
                    subjectNameVal = subjectNameVal.replace("+", " ");
                    map.put("flt.subjectName", subjectNameVal);
                }
                map.remove("callback");
                map.remove("type");
                map.remove("userName");
                map.remove("account");
                AppClientFactory.getPlaceManager().revealPlace(AppClientFactory.getCurrentPlaceToken(), map);
            } else {
                AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.HOME);
            }
            appPopUp.hide();
        }

    });

}

From source file:org.ednovo.gooru.client.mvp.home.register.ParentRegisterVc.java

License:Open Source License

/**
 * Hide popup//from  w ww .j av a 2 s  .co  m
 * @param clickEvent instance Of {@link ClickEvent} 
 */
@UiHandler("guardianCancelAnr")
public void onCancelClick(ClickEvent clickEvent) {
    appPopUp.hide();
    Window.enableScrolling(true);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true));
}

From source file:org.ednovo.gooru.client.mvp.home.register.RegisterVc.java

License:Open Source License

/**
 * Class constructor, focus and blur events on emailId , dateBox field
 *///from   w w w  .ja  v a  2 s .c  o m
public RegisterVc() {
    super(false);
    NewRegisterCBundle.INSTANCE.css().ensureInjected();
    add(binder.createAndBindUi(this));
    //      this.setStyleName(Register1CBundle.INSTANCE.css().registerPopupStyle());
    //      this.addStyleName("gwt-PopupPanel");
    if (AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()
            .equals(PlaceTokens.COLLECTION_PLAY.toString())
            || AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()
                    .equals(PlaceTokens.PREVIEW_PLAY.toString())
            || AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()
                    .equals(PlaceTokens.RESOURCE_PLAY.toString())) {
        this.getElement().getStyle().setZIndex(999999);
    } else {
        this.getElement().getStyle().clearZIndex();
    }
    this.setGlassEnabled(true);
    this.setSize("435px", "428px");

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

    this.center();

    dateBoxUc = new DateBoxUc(true, false, false);
    dateSimPanel.add(dateBoxUc);
    dateValidationUc.setStyleName(NewRegisterCBundle.INSTANCE.css().registerErrorLabel());
    emailValidationUc.setStyleName(NewRegisterCBundle.INSTANCE.css().registerEmailErrorLabel());

    emailIdTxtBox.setStyleName(NewRegisterCBundle.INSTANCE.css().emailTxtBox());
    dateBoxUc.getDateBox().addFocusHandler(new OnDateFocus());
    dateBoxUc.getDateBox().addBlurHandler(new OnDateBlur());
    dateBoxUc.addDomHandler(new OnDateFocus(), FocusEvent.getType());
    emailIdTxtBox.addFocusHandler(new OnEmailFocus());
    emailIdTxtBox.addBlurHandler(new OnEmailBlur());
    emailIdTxtBox.getElement().setId("tbEmail");
    goBtnUc.getElement().setId("btnGo");
    gmailButton.getElement().setId("btnGmail");
    dateBoxUc.getDoneButton().addClickHandler(new OnDoneClick());

    lblSignUp.setText(GL0186 + GL_SPL_EXCLAMATION);
    lblAsBetauser.setText(GL0210);
    lblSignWithGoogle.setText(GL0203);
    lblSignWithGoogle.getElement().setId("lblSignWithGoogle");
    lblOr.setText(GL0209);
    lblBirthday.setText(GL0211);
    lblEmail.setText(GL0212);
    goBtnUc.setText(GL0213);

    emailValidationUc.setVisible(false);
    dateValidationUc.setVisible(false);
    this.setGlassEnabled(true);
}

From source file:org.ednovo.gooru.client.mvp.home.register.RegisterVc.java

License:Open Source License

@UiHandler("cancelButton")
public void onCancelClicked(ClickEvent clickEvent) {
    //this.setVisible(false);
    /*   Window.enableScrolling(true);
         AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true));
       hide();/*ww w. j a v a  2s  . c  om*/
       AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.HOME);*/
    String currentPlaceToken = AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken();
    if (currentPlaceToken.equals(PlaceTokens.COLLECTION_PLAY)
            || currentPlaceToken.equals(PlaceTokens.PREVIEW_PLAY)
            || currentPlaceToken.equals(PlaceTokens.RESOURCE_PLAY)
            || currentPlaceToken.equals(PlaceTokens.COLLECTION_SEARCH)
            || currentPlaceToken.equals(PlaceTokens.RESOURCE_SEARCH)) {

    } else {
        hide();
        AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.HOME);
    }
    Window.enableScrolling(true);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true));
    hide();

}

From source file:org.ednovo.gooru.client.mvp.home.register.RegistrationConfirmationVc.java

License:Open Source License

/**
 * Close the registration confirmation popup by clicking ok button 
 * @param clickEvent instance of the {@link ClickEvent}
 *//*w w  w  .  j  ava2  s.c o m*/
@UiHandler("confirmRegisterUc")
public void confirmRegisteration(ClickEvent clickEvent) {
    appPopUp.hide();
    Window.enableScrolling(true);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true));
}

From source file:org.ednovo.gooru.client.mvp.home.register.UserRegistrationPresenter.java

License:Open Source License

/**
 * Creates welcome popup after registration
 *//*w ww  . j ava2  s.  c o m*/
private void showWelcomeMessage() {

    AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.HOME);
    getUserService().updateUserViewFlag(AppClientFactory.getLoggedInUser().getGooruUId(), 1,
            getUpdateFlagAsyncCallback());
    Window.enableScrolling(false);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, false));

    /*registrationWelcomePopup = new RegistrationWelcomePopup();
    registrationWelcomePopup.getConfirmButton().addClickHandler(new ClickHandler() {
       @Override
       public void onClick(ClickEvent event) {
    registrationWelcomePopup.getPopupPanel().hide();
    AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.HOME);
    getUserService().updateUserViewFlag(AppClientFactory.getLoggedInUser().getGooruUId(), 1, getUpdateFlagAsyncCallback());
    GooruGuideVc gooruGuideVc = new GooruGuideVc();
    gooruGuideVc.show();
    gooruGuideVc.center();
            
       }
    });*/
}

From source file:org.ednovo.gooru.client.mvp.home.register.UserRegistrationView.java

License:Open Source License

/**
 * Class constructor, creates popup , focus and blur events
 * /*ww w  .j  a  va  2 s.c o  m*/
 * @param eventBus
 *            {@link EventBus}
 */
@Inject
public UserRegistrationView(EventBus eventBus) {
    super(eventBus);
    RegisterCBundle.INSTANCE.css().ensureInjected();
    UcCBundle.INSTANCE.css().ensureInjected();
    appPopUp = new AppPopUp();
    appPopUp.setStyleName(RegisterCBundle.INSTANCE.css().registerPopup());
    appPopUp.setContent(REGISTER_LOGIN, uiBinder.createAndBindUi(this));
    appPopUp.setGlassStyleName(RegisterCBundle.INSTANCE.css().registerPopupGlassPanel());
    accountTypeFieldLbl.setText(GL0807);
    accountInformationLbl.setText(GL1198);
    fName.setText(GL0424);
    lName.setText(GL0425);
    uName.setText(GL1035);
    pWord.setText(GL0204);
    cPword.setText(GL0427);
    bdLbl.setText(GL0211);
    emailText.setText(GL0212);
    genderText.setText(GL0809);
    female.setText(GL0811);
    male.setText(GL0810);
    other.setText(GL1047);
    donot.setText(GL1199);
    aboutMe.setText(GL1200);
    conditionsText.setText(GL1201 + " ");
    termsAndConditionsAnr.setText(GL0297 + " " + GL_GRR_AND + " " + GL0452);
    andText.setText("  " + GL_GRR_AND + "  ");
    copyRightPolicyAnr.setText(GL0421);
    gooruText.setText(" " + GL_GRR_OF + " " + GL1202);
    updateUserDetailsUc.setText(GL1203);
    cancelAnr.setText(GL0142);
    welcomeMessageHtml.setHTML(GL1211);
    passwordFieldTxtBox.addFocusHandler(new OnPasswordFocus());
    dateBoxUc = new DateBoxUc(true, false, false);
    dateSimPanel.add(dateBoxUc);
    confirmPasswordValidUc.setVisible(false);
    passwordValidUc.setVisible(false);
    dateValidationUc.setVisible(false);
    dateValidationUc.setStyleName(RegisterCBundle.INSTANCE.css().rightErrorLabel());
    genderValidUc.setVisible(false);
    genderValidUc.setStyleName(RegisterCBundle.INSTANCE.css().rightErrorLabel());
    dateBoxUc.setStyleName(UcCBundle.INSTANCE.css().parentDateBox());
    dateBoxUc.getDateBox().setStyleName(UcCBundle.INSTANCE.css().parentDateText());
    dateBoxUc.getDatePickerUc().setStyleName(UcCBundle.INSTANCE.css().parentDatePickerContainer());
    dateBoxUc.addDomHandler(new OnDateFocus(), FocusEvent.getType());
    dateBoxUc.getDateBox().addFocusHandler(new OnDateFocus());
    dateBoxUc.getDoneButton().addClickHandler(new OnDoneClick());
    dateBoxUc.getDateBox().addBlurHandler(new OnDateBlur());
    genderFocusFocPanel.addFocusHandler(new OnGenderFocus());
    userNameValidUc.setVisible(false);
    userNameFieldTxtBox.setMaxLength(20);
    userNameFieldTxtBox.addBlurHandler(new OnUserNameBlur());
    userNameFieldTxtBox.addFocusHandler(new OnUserNameFocus());
    userNameFieldTxtBox.getElement().setId("txtUserName");
    firstNameFieldUc.getElement().setId("txtFirstName");
    lastNameFieldUc.getElement().setId("txtLastName");
    passwordFieldTxtBox.getElement().setId("txtpassword");
    confirmPasswordFieldTxtBox.getElement().setId("txtConfirmPassword");
    female.getElement().setId("rdFemale");
    male.getElement().setId("rdMale");
    other.getElement().setId("rdOther");
    donot.getElement().setId("rdDoNot");
    termsAndConditionsAnr.getElement().setId("lnkTermsAndConditions");
    copyRightPolicyAnr.getElement().setId("lnkCopyRightPolicy");
    updateUserDetailsUc.getElement().setId("btnRegister");
    cancelAnr.getElement().setId("lnkCancel");
    termsAndPolicyVc = new TermsAndPolicyVc(false) {

        @Override
        public void openParentPopup() {
            appPopUp.show();
        }
    };

    copyRightPolicy = new CopyRightPolicyVc() {

        @Override
        public void openParentPopup() {
            appPopUp.show();
        }
    };

    /**
     * Added click handler for showing Terms ans Policy popup in footer
     **/
    termsAndConditionsAnr.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {

            hide();
            if (termsAndPolicyVc == null) {
                termsAndPolicyVc = new TermsAndPolicyVc(false) {

                    @Override
                    public void openParentPopup() {
                        Window.enableScrolling(false);
                        AppClientFactory.fireEvent(new SetHeaderZIndexEvent(98, false));
                        appPopUp.show();
                    }
                };
            }
            termsAndPolicyVc.getElement().getStyle().setZIndex(999);
            termsAndPolicyVc.show();
            termsAndPolicyVc.setSize("600px", "300px");
            termsAndPolicyVc.center();
        }
    });

    copyRightPolicyAnr.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            // appPopUp.show();
            hide();
            Window.enableScrolling(false);
            AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99, false));
            copyRightPolicy.show();
            copyRightPolicy.setSize("600px", "300px");
            copyRightPolicy.center();
        }
    });
}

From source file:org.ednovo.gooru.client.mvp.home.ResetPasswordVc.java

License:Open Source License

/**
 * Class constructor , create reset password popup and assign password reset token
 * @param resetToken password token //from w w  w.  j  a v a2  s  . c o  m
 */
public ResetPasswordVc(String resetToken) {
    appPopUp = new AppPopUp();

    if (!appPopUp.isShowing()) {
        this.resetToken = resetToken;
        appPopUp.setContent(GL0062, uiBinder.createAndBindUi(this));
        //appPopUp.addStyleName(HomeCBundle.INSTANCE.css().resetPasswordPopup());
        appPopUp.show();
        appPopUp.center();
        newPasswordText.setText(GL1254);
        newPwdLbl.setText(GL1255);
        confirmPwdLbl.setText(GL0427);
        sendMailBtnUc.setText(GL0141);
        resetPwdCancelAnr.setText(GL0142);
        resetConfirmPwdTxtBox.getElement().setPropertyString("type", "password");
        resetNewPwdTxtBox.getElement().setPropertyString("type", "password");
        resetConfirmPwdTxtBox.getElement().setId("txtConfirmPwd");
        resetNewPwdTxtBox.getElement().setId("txtNewPwd");
        newPwdValidationUc.setStyleName(HomeCBundle.INSTANCE.css().passwordErrorLabel());
        newPwdValidationUc.setVisible(false);
        confirmPwdValidationUc.setStyleName(HomeCBundle.INSTANCE.css().passwordErrorLabel());
        confirmPwdValidationUc.setVisible(false);
        sendMailBtnUc.getElement().setId("btnSave");
        resetPwdCancelAnr.getElement().setId("lnkCancel");
        //resetNewPwd.addBlurHandler(new OnPasswordBlur());
        //resetConfirmPwd.addBlurHandler(new OnPasswordBlur());
        resetNewPwdTxtBox.addFocusHandler(new OnNewPasswordFocus());
        resetConfirmPwdTxtBox.addFocusHandler(new OnConfirmPasswordFocus());
        Window.enableScrolling(false);
        AppClientFactory.getEventBus().fireEvent(new SetHeaderZIndexEvent(99, false));
    }
}

From source file:org.ednovo.gooru.client.mvp.home.ResetPasswordVc.java

License:Open Source License

/**
 * Check the password reset token has expired or not if not create success popup with their user name
 * @param clickEvent instance of {@link ClickEvent}
 */// w  w w.  ja va2  s.c om
@UiHandler("sendMailBtnUc")
public void onCancelClick(ClickEvent clickEvent) {
    if (validatePassword()) {
        AppClientFactory.getInjector().getUserService().resetCredential(this.getresetConfirmPwd(), resetToken,
                new SimpleAsyncCallback<Map<String, Object>>() {

                    @Override
                    public void onSuccess(Map<String, Object> result) {
                        if (result != null && result.containsKey("statusCode")
                                && Integer.parseInt(result.get("statusCode").toString()) == 400) {
                            resetNewPwdTxtBox.addStyleName(HomeCBundle.INSTANCE.css().resetPwdTextError());
                            newPwdValidationUc.setText(StringUtil.generateMessage(GL0078, "Password"));
                            newPwdValidationUc.setVisible(true);
                        } else if (result != null && result.containsKey("tokenExpired")
                                && result.get("tokenExpired") != null
                                && result.get("tokenExpired").toString().length() > 0) {
                            appPopUp.hide();
                            new AlertContentUc(GL1089, StringUtil.generateMessage(GL0100, ""));
                        } else if (result != null && result.containsKey("username")
                                && result.get("username").toString().length() > 0) {
                            appPopUp.hide();
                            new ResetPwdSuccessVc(result.get("username").toString());

                        } else {
                            appPopUp.hide();
                        }
                        /*if (result != null && result.containsKey("username") && result.get("username").toString().length() > 0) {
                           new ResetPwdSuccessVc(result.get("username").toString());
                                   
                        }
                        if (result != null && result.containsKey("tokenExpired") && result.get("tokenExpired") != null && result.get("tokenExpired").toString().length() > 0) {
                           new AlertContentUc(GL1089, StringUtil.generateMessage(GL0100, ""));
                        }*/
                        //               appPopUp.hide();
                        Window.enableScrolling(true);
                        AppClientFactory.getEventBus().fireEvent(new SetHeaderZIndexEvent(0, true));
                    }
                });
    }
}