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.play.collection.preview.home.PreviewHomeView.java

License:Open Source License

/**
 * /*from  ww  w .  j a v a 2s  .  co  m*/
 * @function oncustomizeCollectionBtnClicked 
 * 
 * @created_date : 11-Dec-2013
 * 
 * @description
 * 
 * 
 * @parm(s) : @param clickEvent
 * 
 * @return : void
 *
 * @throws : <Mentioned if any exceptions>
 *
 */
@UiHandler("customizeCollectionBtn")
public void oncustomizeCollectionBtnClicked(ClickEvent clickEvent) {
    MixpanelUtil.Preview_Click_Customize();
    String collectionId = clickEvent.getRelativeElement().getAttribute("collectionId");
    if (!isCustomizePopup) {
        isCustomizePopup = true;
        Boolean loginFlag = false;
        if (AppClientFactory.isAnonymous()) {
            loginFlag = true;
        } else {
            loginFlag = false;
        }
        RenameCustomizePopUp successPopupVc = new RenameCustomizePopUp(collectionId, loginFlag) {

            @Override
            public void closePoup() {
                Window.enableScrolling(true);
                this.hide();
                isCustomizePopup = false;
            }
        };
        Window.scrollTo(0, 0);
        successPopupVc.setWidth("500px");
        successPopupVc.setHeight("350px");
        successPopupVc.show();
        successPopupVc.center();
    }

}

From source file:org.ednovo.gooru.client.mvp.play.collection.preview.home.PreviewHomeView.java

License:Open Source License

/**
 * //from  w ww . ja v a  2s .co  m
 * @function oncustomizeCollectionBtnClicked 
 * 
 * @created_date : 11-Dec-2013
 * 
 * @description
 * 
 * 
 * @parm(s) : @param clickEvent
 * 
 * @return : void
 *
 * @throws : <Mentioned if any exceptions>
 *
 */
@UiHandler("shareCollectionBtn")
public void onshareCollectionBtnClicked(ClickEvent clickEvent) {
    MixpanelUtil.Preview_Click_Share();
    String collectionId = clickEvent.getRelativeElement().getAttribute("collectionId");

    if (!isSharePopup) {
        isSharePopup = true;

        SharePlayerVc successPopupVc = new SharePlayerVc(collectionId) {

            @Override
            public void closePoup() {
                Window.enableScrolling(true);
                this.hide();
                isSharePopup = false;
            }
        };
        Window.scrollTo(0, 0);
        successPopupVc.setWidth("500px");
        successPopupVc.setHeight("350px");
        successPopupVc.show();
        successPopupVc.center();
    }

}

From source file:org.ednovo.gooru.client.mvp.play.collection.preview.home.share.SharePlayerVc.java

License:Open Source License

/**
 * //  w ww.j  a  va2  s .  c  o m
 */
public SharePlayerVc(String collectionIdVal) {
    super(false);

    res = AssignPopUpCBundle.INSTANCE;
    AssignPopUpCBundle.INSTANCE.css().ensureInjected();
    add(uiBinder.createAndBindUi(this));
    this.setGlassEnabled(true);
    sharetext.getElement().setInnerHTML(GL0638);
    swithUrlLbl.setText(GL0639);
    swithToEmbedLbl.setText(GL0640);
    setLabelsAndIds();
    ;

    shareContainer = new ShareViewUc("", "");
    ftmPanel = new HTMLPanel("");

    loadingImageLabel.setVisible(true);
    popupContentAssign.setVisible(false);

    try {

        AppClientFactory.getInjector().getClasspageService().getSCollIdClasspageById(collectionIdVal,
                new AsyncCallback<CollectionDo>() {

                    @Override
                    public void onFailure(Throwable caught) {

                    }

                    @Override
                    public void onSuccess(CollectionDo result) {

                        String collectionId = "";

                        if (result.getGooruOid() != null) {
                            collectionId = result.getGooruOid();
                        } else {
                            collectionId = "4b4bb39d-2892-4dd6-bd7f-5fd1227751de";
                        }

                        toAssignStr = collectionId;

                        if (collectionId != null) {

                            collectionDoGlobal = result;

                            generateShareLink(toAssignStr);

                        }

                        loadingImageLabel.setVisible(false);
                        popupContentAssign.setVisible(true);

                    }
                });
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    setShareUrlGenerationAsyncCallback(new SimpleAsyncCallback<Map<String, String>>() {

        @Override
        public void onSuccess(Map<String, String> result) {
            embedBitlyLink = result.get("decodeRawUrl");
        }
    });
    Window.enableScrolling(false);
    this.getElement().setAttribute("style", "z-index:99999;");
    this.getGlassElement().setAttribute("style", "z-index:99999; position:absolute; left:0px; top:0px;");

    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99999, false));
    this.center();
}

From source file:org.ednovo.gooru.client.mvp.player.ResourcePlayView.java

License:Open Source License

/**
 * Class constructor, style for resource player popup panel
 * /*w  w w  .java  2  s  . c  om*/
 * @param eventBus
 *            {@link EventBus}
 */
@Inject
public ResourcePlayView(EventBus eventBus) {
    super(eventBus);
    // addShareWidgetInPlay();
    isIncremented = false;
    now = new Date();
    nowLong = now.getTime();
    nowLong = nowLong + (1000 * 60 * 60 * 4);
    // nowLong = nowLong + (1000 * 60 * 30);
    now.setTime(nowLong);
    shareContainer = new ShareViewUc("", "");
    ftmPanel = new HTMLPanel("");
    gooruResourcePlayer = new ResourcePlayWidget();
    gooruResourcePlayer.setGlassEnabled(true);
    gooruResourcePlayer.getElement().getStyle().setZIndex(999);
    setAutoHideOnNavigationEventEnabled(true);

    try {
        doc.getElementById("headerMainPanel").getStyle().setZIndex(0);
        doc.getElementById("goToClasicInnerPanel").getStyle().setZIndex(0);
    } catch (Exception e) {
    }

    gooruResourcePlayer.getAddNewCollectionLabel().addClickHandler(new OnNewCollectionClick());
    if (playerCloseHandler != null) {
        playerCloseHandler.removeHandler();
    }
    playerCloseHandler = gooruResourcePlayer.getCloseButton().addClickHandler(

            new ClickHandler() {
                @Override
                public void onClick(ClickEvent e) {
                    try {
                        if (viewCount != null || viewCount != "") {
                            AppClientFactory.fireEvent(
                                    new UpdateSearchResultMetaDataEvent(viewCount, gooruOid, "views"));
                        }
                    } catch (NumberFormatException exe) {
                    } catch (NullPointerException ex) {
                    }
                    gooruResourcePlayer.stopResourcePlayerDataLogEvent();

                    try {
                        Element ifrmaeElement = Document.get().getElementById("resourcePlayerContainer");
                        if (ifrmaeElement != null) {
                            ifrmaeElement.setAttribute("src", "");
                        }
                    } catch (Exception exception) {
                    }

                    gooruResourcePlayer.getResourcePlayerContainer().clear();
                    hideFromPopup(true);
                    hide();
                    gooruResourcePlayer.stopHintsExplanationEvent();
                    gooruResourcePlayer.stopQuestionEvent();

                    try {
                        doc.getElementById("headerMainPanel").getStyle().clearZIndex();
                        doc.getElementById("goToClasicInnerPanel").getStyle().clearZIndex();
                    } catch (Exception ex) {

                    }

                    doc.getElementById("uvTab").getStyle().setDisplay(Display.BLOCK);
                    if (AppClientFactory.isAnonymous() && gooruResourcePlayer.getUserDo() != null) {
                        if (gooruResourcePlayer.getUserDo().getUsername() != null
                                && gooruResourcePlayer.getUserDo().getUserPassword() != null) {
                            AppClientFactory.getInjector().getAppService().signin(
                                    gooruResourcePlayer.getUserDo().getEmailId(),
                                    gooruResourcePlayer.getUserDo().getUserPassword(),
                                    new AsyncCallback<UserDo>() {
                                        @Override
                                        public void onSuccess(UserDo result) {
                                            AppClientFactory.setLoggedInUser(result);
                                            // refresh page
                                            AppClientFactory.fireEvent(new SetHeaderEvent(result));
                                            // redirect(reloadUrl);
                                            AppClientFactory.fireEvent(new RefreshUserShelfCollectionsEvent());
                                        }

                                        @Override
                                        public void onFailure(Throwable caught) {
                                            new AlertContentUc(GL0061, caught.getMessage());
                                        }
                                    });
                        }
                    }
                    /*if (gooruResourcePlayer.getIsResourceAdded()) {
                       // redirect(reloadUrl);
                       AppClientFactory
                     .fireEvent(new RefreshUserShelfCollectionsEvent());
                            
                    }*/
                    AppClientFactory.fireEvent(new RefreshUserShelfCollectionsEvent());

                    //AppClientFactory.fireEvent(new GetSearchKeyWordEvent());
                    // /

                    //
                }
            });

    reloadUrl = Window.Location.getHref();
    Window.enableScrolling(true);
}

From source file:org.ednovo.gooru.client.mvp.player.ResourceRegister.java

License:Open Source License

/**
 * Class constructor//from  w  ww  . ja  v  a  2s.  c  o  m
 */
public ResourceRegister() {
    super(false);
    /* FaqCBundle.INSTANCE.css().ensureInjected(); */
    setWidget(uiBinder.createAndBindUi(this));
    this.setAutoHideEnabled(true);
    setGlassEnabled(true);
    wantToSaveAndShareText.setText(GL0669);
    getAnAccountText.setText(GL0670);
    signUpGooruText.setText(GL0671);
    birthDateText.setText(GL0672);
    emailText.setText(GL0212);
    goBtnUc.setText(GL0673);
    cancelAnr.setText(GL0674);
    iHaveAcc.setText(GL0675);

    //GL0675
    dateBoxUc = new DateBoxUc(true, false, false);
    dateSimPanel.add(dateBoxUc);
    dateValidationUc.setStyleName(RegisterCBundle.INSTANCE.css().resourceRegisterError());
    emailValidationUc.setStyleName(RegisterCBundle.INSTANCE.css().resourceRegisterError());
    emailIdTxtBox.setStyleName(RegisterCBundle.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("txtEmail");
    goBtnUc.getElement().setId("btnSignMeUp");
    cancelAnr.getElement().setId("lnkCancel");
    iHaveAcc.getElement().setId("lnkHaveAcc");
    dateBoxUc.getDoneButton().addClickHandler(new OnDoneClick());

    emailValidationUc.setVisible(false);
    dateValidationUc.setVisible(false);
    this.setGlassEnabled(true);
    MixpanelUtil.Arrive_ResourceRegisterPopup();
    Window.enableScrolling(false);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99, false));

    this.setStyleName("guidePopUpContainer");
    this.getElement().getStyle().setWidth(790, Unit.PX);
    //      this.getElement().getStyle().setZIndex(100001);
    this.center();

}

From source file:org.ednovo.gooru.client.mvp.player.ResourceRegister.java

License:Open Source License

@UiHandler("cancelAnr")
public void onCancelClick(ClickEvent clickEvent) {
    hide();/*from w w  w . j a v a2  s . c o m*/
    Window.enableScrolling(true);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true));
}

From source file:org.ednovo.gooru.client.mvp.player.ResourceRegister.java

License:Open Source License

@UiHandler("iHaveAcc")
public void onHaveClick(ClickEvent clickEvent) {
    hide();/*from www  .j a v a2  s.  c  o m*/
    Window.enableScrolling(true);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true));
    MixpanelUtil.Click_HaveAnAccount_ResourceRegisterPopup();
    LoginPopupUc popup = new LoginPopupUc(new HeaderUc());
    popup.setGlassEnabled(true);
    popup.show();
    popup.center();
}

From source file:org.ednovo.gooru.client.mvp.profilepage.data.item.ProfileTopicListView.java

License:Open Source License

@UiHandler("assignCollectionBtn")
public void onassignCollectionBtnClicked(ClickEvent clickEvent) {
    String collectionId = getProfileLibraryDo().getGooruOid();
    if (!isAssignPopup) {
        isAssignPopup = true;/*from ww w  .j a  v a 2  s.  co m*/
        final Map<String, String> params = StringUtil.splitQuery(Window.Location.getHref());
        if (params.containsKey(CUSTOMIZE)) {
            params.remove(CUSTOMIZE);
        }
        AssignPopupVc successPopupVc = new AssignPopupVc(collectionId, getProfileLibraryDo().getTitle(),
                getProfileLibraryDo().getGoals()) {
            @Override
            public void closePoup() {
                Window.enableScrolling(true);
                this.hide();
                isAssignPopup = false;
            }
        };
        Window.scrollTo(0, 0);
        successPopupVc.setWidth("500px");
        successPopupVc.setHeight("657px");
        successPopupVc.show();
        successPopupVc.center();
        if (AppClientFactory.isAnonymous()) {
            successPopupVc.setPopupPosition(successPopupVc.getAbsoluteLeft(), 10);
        } else {
            successPopupVc.setPopupPosition(successPopupVc.getAbsoluteLeft(), 10);
        }

        params.put(ASSIGN, "yes");
        params.put("collectionId", collectionId);
        PlaceRequest placeRequest = AppClientFactory.getPlaceManager()
                .preparePlaceRequest(AppClientFactory.getCurrentPlaceToken(), params);
        AppClientFactory.getPlaceManager().revealPlace(false, placeRequest, true);
    }
}

From source file:org.ednovo.gooru.client.mvp.profilepage.data.item.ProfileTopicListView.java

License:Open Source License

@UiHandler("customizeCollectionBtn")
public void oncustomizeCollectionBtnClicked(ClickEvent clickEvent) {
    String collectionId = getProfileLibraryDo().getGooruOid();
    if (!isCustomizePopup) {
        isCustomizePopup = true;//w  w w. j a v a 2s  .  c o  m
        Boolean loginFlag = false;
        if (AppClientFactory.isAnonymous()) {
            loginFlag = true;
        } else {
            loginFlag = false;
        }
        final Map<String, String> params = StringUtil.splitQuery(Window.Location.getHref());
        if (params.containsKey(ASSIGN)) {
            params.remove(ASSIGN);
        }
        RenameAndCustomizeLibraryPopUp successPopupVc = new RenameAndCustomizeLibraryPopUp(collectionId,
                loginFlag, getProfileLibraryDo().getTitle()) {
            @Override
            public void closePoup() {
                Window.enableScrolling(true);
                this.hide();
                isCustomizePopup = false;
            }
        };
        Window.scrollTo(0, 0);
        successPopupVc.setWidth("500px");
        successPopupVc.setHeight("475px");
        successPopupVc.show();
        successPopupVc.center();

        params.put(CUSTOMIZE, "yes");
        params.put("collectionId", collectionId);
        PlaceRequest placeRequest = AppClientFactory.getPlaceManager()
                .preparePlaceRequest(AppClientFactory.getCurrentPlaceToken(), params);
        AppClientFactory.getPlaceManager().revealPlace(false, placeRequest, true);
    }
}

From source file:org.ednovo.gooru.client.mvp.profilepage.data.item.ProfileTopicListView.java

License:Open Source License

/**
 * //  w ww.j  av  a2 s  .  c o  m
 * Showing Customize or Assign popup after login with gmail account.
 * 
 */

private void showPopupAfterGmailSignin() {

    String collectionId = getProfileLibraryDo().getGooruOid() != null ? getProfileLibraryDo().getGooruOid()
            : null;
    String colleId = AppClientFactory.getPlaceManager().getRequestParameter("collectionId") != null
            ? AppClientFactory.getPlaceManager().getRequestParameter("collectionId")
            : 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;

    if (customize != null && customize.equals("yes")) {
        if (colleId.equals(collectionId) && isVisible) {
            isVisible = false;
            Boolean loginFlag = false;
            if (AppClientFactory.isAnonymous()) {
                loginFlag = true;
            } else {
                loginFlag = false;
            }
            final Map<String, String> params = StringUtil.splitQuery(Window.Location.getHref());
            RenameAndCustomizeLibraryPopUp customizePopup = new RenameAndCustomizeLibraryPopUp(collectionId,
                    loginFlag, getProfileLibraryDo().getTitle()) {
                @Override
                public void closePoup() {
                    Window.enableScrolling(true);
                    this.hide();
                    isCustomizePopup = false;

                }
            };
            Window.scrollTo(0, 0);
            customizePopup.setWidth("500px");
            customizePopup.setHeight("440px");
            customizePopup.show();
            customizePopup.center();

        }

    }
    if (assign != null && assign.equals("yes")) {
        final Map<String, String> params = StringUtil.splitQuery(Window.Location.getHref());
        if (colleId.equals(collectionId) && isVisible) {
            isVisible = false;
            AssignPopupVc assignPopup = new AssignPopupVc(collectionId, getProfileLibraryDo().getTitle(),
                    getProfileLibraryDo().getGoals()) {
                @Override
                public void closePoup() {
                    Window.enableScrolling(true);
                    this.hide();
                    isAssignPopup = false;
                    params.remove(ASSIGN);
                    PlaceRequest placeRequest = AppClientFactory.getPlaceManager()
                            .preparePlaceRequest(AppClientFactory.getCurrentPlaceToken(), params);
                    AppClientFactory.getPlaceManager().revealPlace(false, placeRequest, true);
                }
            };
            Window.scrollTo(0, 0);
            assignPopup.setWidth("500px");
            assignPopup.setHeight("657px");
            assignPopup.show();
            assignPopup.center();
            if (AppClientFactory.isAnonymous()) {
                assignPopup.setPopupPosition(assignPopup.getAbsoluteLeft(), 10);
            } else {
                assignPopup.setPopupPosition(assignPopup.getAbsoluteLeft(), 10);
            }

        }

    }

}