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.newhome.NewHomePresenter.java

License:Open Source License

@Override
protected void onReset() {
    Window.enableScrolling(true);
}

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

License:Open Source License

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

        @Override//from   w ww  . j a  va  2  s.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()) {

            }

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

From source file:org.ednovo.gooru.client.mvp.analytics.collectionSummaryTeacher.CollectionSummaryTeacherView.java

License:Open Source License

@Override
public void setViewResponseData(ArrayList<OetextDataDO> result, String resourceGooruId, String collectionId,
        String classpageId, String pathwayId, String questionType, String session) {
    popupPanel = new ViewResponsesPopup(result, resourceGooruId, collectionId, classpageId, pathwayId,
            questionType, true, session, new ClasspageItemDo());
    popupPanel.setStyleName(res.css().setOETextPopupCenter());
    if (popupPanel.isShowing()) {
        popupPanel.hide();/*from w  w  w .  ja v a  2 s  . c o m*/
        Window.enableScrolling(true);
    } else {
        Window.enableScrolling(false);
        popupPanel.setGlassEnabled(true);
        popupPanel.setAutoHideEnabled(true);
        popupPanel.show();
        popupPanel.center();
    }
}

From source file:org.ednovo.gooru.client.mvp.analytics.util.ViewResponsesPopup.java

License:Open Source License

@Override
protected void onUnload() {
    super.onUnload();
    if (AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()
            .equalsIgnoreCase(PlaceTokens.COLLECTION_PLAY)
            || AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()
                    .equalsIgnoreCase(PlaceTokens.ASSESSMENT_PLAY)) {
        Window.enableScrolling(false);
    } else {//from  w  w w .  j  a  v a2 s  .c om
        Window.enableScrolling(true);
    }
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.collection.AssessmentsPlayerPresenter.java

License:Open Source License

protected void showSignupPopup() {
    if (AppClientFactory.getPlaceManager().getRequestParameter("callback") != null
            && AppClientFactory.getPlaceManager().getRequestParameter("callback").equalsIgnoreCase("signup")) {
        //To show SignUp (Registration popup)
        if (AppClientFactory.isAnonymous()) {
            Window.enableScrolling(false);
            AppClientFactory.fireEvent(new SetHeaderZIndexEvent(98, false));
            String type = AppClientFactory.getPlaceManager().getRequestParameter("type");
            int displayScreen = AppClientFactory.getPlaceManager().getRequestParameter("type") != null
                    ? Integer.parseInt(type)
                    : 1;/*from  www  . j a v  a 2  s . co  m*/
            signUpViewPresenter.displayPopup(displayScreen);
            addToPopupSlot(signUpViewPresenter);
        }
    }
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.collection.AssessmentsPlayerPresenter.java

License:Open Source License

public void setAddResourcesView(String collectionId, String resourceId) {
    clearSlot(COLLECTION_PLAYER_TOC_PRESENTER_SLOT);
    new CustomAnimation(getView().getResourceAnimationContainer()).run(400);
    ResourceSearchResultDo resourceSearchResultDo = new ResourceSearchResultDo();
    resourceSearchResultDo.setGooruOid(collectionItemDo.getResource().getGooruOid());
    resourceSearchResultDo.setQuestionType(collectionItemDo.getResource().getTypeName());
    SearchResourceFormatDO searchResourceFormatDO = new SearchResourceFormatDO();
    searchResourceFormatDO.setValue(collectionItemDo.getResource().getResourceFormat().getValue());
    resourceSearchResultDo.setResourceFormat(searchResourceFormatDO);
    shelfMainPresenter.SetDefaultTypeAndVersion();
    searchAddResourceToCollectionPresenter.DisableMyCollectionsPanelData(false);
    searchAddResourceToCollectionPresenter.getLoadingImage();
    searchAddResourceToCollectionPresenter.getUserShelfData(resourceSearchResultDo, "coursebuilder", null);
    searchAddResourceToCollectionPresenter.getView().getAppPopUp().show();
    searchAddResourceToCollectionPresenter.getView().getAppPopUp().center();
    searchAddResourceToCollectionPresenter.getView().getAppPopUp().setGlassEnabled(true);
    searchAddResourceToCollectionPresenter.getView().getAppPopUp().setGlassStyleName("setGlassPanelZIndex");
    searchAddResourceToCollectionPresenter.getView().getAppPopUp()
            .addCloseHandler(new CloseHandler<PopupPanel>() {
                @Override// ww w.j av  a  2  s  . c om
                public void onClose(CloseEvent<PopupPanel> event) {
                    Window.enableScrolling(false);
                    searchAddResourceToCollectionPresenter.getView().closeTabView();
                }
            });
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.collection.end.study.AssessmentsHomeMetadataView.java

License:Open Source License

/**
 *
 * @function oncustomizeCollectionBtnClicked
 *
 * @created_date : 11-Dec-2013//from   ww w .  ja  va  2 s .com
 *
 * @description
 *
 *
 * @parm(s) : @param clickEvent
 *
 * @return : void
 *
 * @throws : <Mentioned if any exceptions>
 *
 */
@UiHandler("customizeCollectionBtn")
public void oncustomizeCollectionBtnClicked(ClickEvent clickEvent) {
    final String collectionId = clickEvent.getRelativeElement().getAttribute("collectionId");
    final String collectionTitle = collectionDo.getTitle();
    if (!isCustomizePopup) {
        isCustomizePopup = true;
        Window.scrollTo(0, 0);
        if (AppClientFactory.isAnonymous()) {
            LoginPopupUc loginPopupUc = new LoginPopupUc() {
                @Override
                public void onLoginSuccess() {
                    Window.enableScrolling(false);

                    getUiHandlers().setDefultVersionAndType();
                    remixPresenterWidget.DisableMyCollectionsPanelData(false);
                    remixPresenterWidget.getLoadingImage();
                    remixPresenterWidget.getUserShelfCollectionsData(collectionId, "coursebuilder",
                            collectionTitle);
                    remixPresenterWidget.getView().getAppPopUp().show();
                    isCustomizePopup = false;
                    remixPresenterWidget.getView().getAppPopUp().center();
                    remixPresenterWidget.getView().getAppPopUp().setGlassEnabled(true);
                    remixPresenterWidget.getView().getAppPopUp().setGlassStyleName("setGlassPanelZIndex");
                }
            };
            loginPopupUc.show();
            loginPopupUc.setGlassEnabled(true);
            loginPopupUc.setGlassStyleName("setGlassPanelZIndex");
        } else {

            getUiHandlers().setDefultVersionAndType();
            remixPresenterWidget.DisableMyCollectionsPanelData(false);
            remixPresenterWidget.getLoadingImage();
            remixPresenterWidget.getUserShelfCollectionsData(collectionId, "coursebuilder", collectionTitle);
            remixPresenterWidget.getView().getAppPopUp().show();
            isCustomizePopup = false;
            remixPresenterWidget.getView().getAppPopUp().center();
            remixPresenterWidget.getView().getAppPopUp().setGlassEnabled(true);
            remixPresenterWidget.getView().getAppPopUp().setGlassStyleName("setGlassPanelZIndex");
        }

        //   successPopupVc.setWidth("500px");
        /*if (!BrowserAgent.isDevice() && AppClientFactory.isAnonymous()){
           successPopupVc.setWidth("500px");
           successPopupVc.setHeight("515px");
        }else if(!BrowserAgent.isDevice() && !AppClientFactory.isAnonymous()){
           successPopupVc.setWidth("500px");
           successPopupVc.setHeight("336px");
        }
        successPopupVc.show();
        successPopupVc.center();*/
        Map<String, String> params = StringUtil.splitQuery(Window.Location.getHref());

    }
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.collection.end.study.AssessmentsHomeMetadataView.java

License:Open Source License

/**
 *
 * @function oncustomizeCollectionBtnClicked
 *
 * @created_date : 11-Dec-2013/*from  w  ww . j  a  v  a2 s. c o m*/
 *
 * @description
 *
 *
 * @parm(s) : @param clickEvent
 *
 * @return : void
 *
 * @throws : <Mentioned if any exceptions>
 *
 */
@UiHandler("shareCollectionBtn")
public void onshareCollectionBtnClicked(ClickEvent clickEvent) {
    getUiHandlers().triggerCollectionShareDataEvent(null, PlayerDataLogEvents.COLLECTION, "gooru", false);
    String collectionId = collectionDo.getGooruOid();
    AssignPopupVc successPopupVc = new AssignPopupVc(collectionId, collectionDo.getTitle(),
            collectionDo.getGoals()) {
        @Override
        public void closePoup() {
            Window.enableScrolling(true);
            this.hide();
        }
    };

    Window.scrollTo(0, 0);
    int clientHeight = Window.getClientHeight();
    //successPopupVc.setWidth("500px");
    //successPopupVc.setHeight("658px");
    if (clientHeight > 625) {
        clientHeight = 625;
        //successPopupVc.getAssignContainer().getElement().setAttribute("style", "max-height:"+clientHeight+"px;overflow-x:hidden;overflow-y:scroll");
    } /*else{
        successPopupVc.getAssignContainer().getElement().setAttribute("style", "max-height:"+clientHeight+"px;overflow-x:hidden;overflow-y:scroll");
      }*/
    successPopupVc.show();
    int left = (Window.getClientWidth() - 500) >> 1;
    int top = (Window.getClientHeight() - clientHeight) >> 1;
    //  successPopupVc.setHeight("658px");
    // successPopupVc.setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max(Window.getScrollTop()+5, 0));

    /*if(AppClientFactory.isAnonymous()){
       successPopupVc.setPopupPosition(successPopupVc.getAbsoluteLeft(), -30);
            
    }*/
    if (!BrowserAgent.isDevice() && AppClientFactory.isAnonymous()) {
        /*successPopupVc.setWidth("550px");
        successPopupVc.setHeight("625px");
        successPopupVc.center();*/
        successPopupVc.setPopupPosition(0, (Window.getClientHeight() - 625) / 2);
    } else if (!BrowserAgent.isDevice() && !AppClientFactory.isAnonymous()) {
        /*successPopupVc.setWidth("550px");
        successPopupVc.setHeight("502px");
        successPopupVc.center();*/
        successPopupVc.setPopupPosition(0, (Window.getClientHeight() - 527) / 2);
    }

}

From source file:org.ednovo.gooru.client.mvp.assessments.play.collection.end.study.AssessmentsHomeMetadataView.java

License:Open Source License

/**
 *
 * Showing Customize or Assign popup after login with gmail account.
 *
 *///  w  w  w .j a v a  2  s . c  o m
private void showPopupAfterGmailSignin() {
    String collectionId = AppClientFactory.getPlaceManager().getRequestParameter("id") != null
            ? AppClientFactory.getPlaceManager().getRequestParameter("id")
            : null;
    String customize = AppClientFactory.getPlaceManager().getRequestParameter("customize") != null
            ? AppClientFactory.getPlaceManager().getRequestParameter("customize")
            : null;
    String assign = AppClientFactory.getPlaceManager().getRequestParameter("assign") != null
            ? AppClientFactory.getPlaceManager().getRequestParameter("assign")
            : null;
    String emailId = AppClientFactory.getPlaceManager().getRequestParameter("emailId") != null
            ? AppClientFactory.getPlaceManager().getRequestParameter("emailId")
            : null;
    String collectionTitle = collectionDo.getTitle();
    if (customize != null && YES.equals(customize) && emailId != null) {

        getUiHandlers().setDefultVersionAndType();
        remixPresenterWidget.DisableMyCollectionsPanelData(false);
        remixPresenterWidget.getLoadingImage();
        remixPresenterWidget.getUserShelfCollectionsData(collectionId, "coursebuilder", collectionTitle);
        remixPresenterWidget.getView().getAppPopUp().show();
        isCustomizePopup = false;
        remixPresenterWidget.getView().getAppPopUp().center();
        remixPresenterWidget.getView().getAppPopUp().setGlassEnabled(true);
        remixPresenterWidget.getView().getAppPopUp().setGlassStyleName("setGlassPanelZIndex");
    }
    if (assign != null && YES.equals(assign) && emailId != null) {
        AssignPopupPlayerVc successPopupVc = new AssignPopupPlayerVc(collectionId) {
            @Override
            public void closePoup() {
                Window.enableScrolling(true);
                this.hide();
                isAssignPopup = false;
            }
        };
        Window.scrollTo(0, 0);
        successPopupVc.setWidth("500px");
        successPopupVc.setHeight("635px");
        successPopupVc.show();
        successPopupVc.center();
        if (AppClientFactory.isAnonymous()) {
            successPopupVc.setPopupPosition(successPopupVc.getAbsoluteLeft(), 30);
        } else {
            successPopupVc.setPopupPosition(successPopupVc.getAbsoluteLeft(), 30);
        }
    }
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.collection.preview.end.AssessmentsPreviewEndView.java

License:Open Source License

/**
 *
 * @function onassignCollectionBtnClicked
 *
 * @created_date : 11-Dec-2013//w  w w. jav a2 s  .  co  m
 *
 * @description
 *
 *
 * @parm(s) : @param clickEvent
 *
 * @return : void
 *
 * @throws : <Mentioned if any exceptions>
 *
 *
 */
@UiHandler("assignCollectionBtn")
public void onassignCollectionBtnClicked(ClickEvent clickEvent) {
    String collectionId = clickEvent.getRelativeElement().getAttribute("collectionId");
    if (!isAssignPopup) {
        isAssignPopup = true;
        AssignPopupPlayerVc successPopupVc = new AssignPopupPlayerVc(collectionId) {
            @Override
            public void closePoup() {
                Window.enableScrolling(true);
                this.hide();
                isAssignPopup = false;
            }
        };
        Window.scrollTo(0, 0);
        successPopupVc.setWidth("500px");
        successPopupVc.setHeight("635px");

        successPopupVc.show();
        successPopupVc.center();
        if (AppClientFactory.isAnonymous()) {
            successPopupVc.setPopupPosition(successPopupVc.getAbsoluteLeft(), 30);
        } else {
            successPopupVc.setPopupPosition(successPopupVc.getAbsoluteLeft(), 30);
        }

        Map<String, String> params = StringUtil.splitQuery(Window.Location.getHref());

        params.put("assign", "yes");
        PlaceRequest placeRequest = AppClientFactory.getPlaceManager()
                .preparePlaceRequest(PlaceTokens.PREVIEW_PLAY, params);
        AppClientFactory.getPlaceManager().revealPlace(false, placeRequest, true);
    }
}