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.gsearch.addResourcePopup.SearchAddResourceToCollectionPresenter.java

License:Open Source License

@Override
public void copyCollectionToLession(String collectionId, String collectionTitle,
        final HashMap<String, String> urlparams) {
    if (urlparams != null) {
        this.urlParameters = urlparams;
        courseId = urlparams.get("o1");
        unitId = urlparams.get("o2");
        lessonId = urlparams.get("o3");
    }/*from   w  ww . j av  a 2 s  .c o m*/
    AppClientFactory.getInjector().getResourceService().CopyCollectionToLesson(courseId, unitId, lessonId,
            getCollectionGooruId(), this.collectionTitle,
            new org.ednovo.gooru.application.client.SimpleAsyncCallback<CollectionDo>() {
                @Override
                public void onSuccess(CollectionDo result) {
                    if (result != null && result.getStatusCode() == 200) {
                        FolderDo folderDo = getFolderDo(result);
                        AppClientFactory.getInjector().getAnalyticsService().getResourceAndCollectionCounts(
                                getCollectionGooruId(), "collection",
                                new SimpleAsyncCallback<HashMap<String, String>>() {
                                    @Override
                                    public void onSuccess(HashMap<String, String> result) {
                                        if (collectionSearchWidget != null) {
                                            collectionSearchWidget.getRemixCountLbl()
                                                    .setText(result.get("copyCount"));
                                        }
                                    }
                                });
                        HashMap<String, String> params = new HashMap<String, String>();
                        if (urlparams != null && urlparams.get("o3") != null) {
                            params.put("o3", urlparams.get("o3"));
                        }
                        if (urlparams != null && urlparams.get("o2") != null) {
                            params.put("o2", urlparams.get("o2"));
                        }
                        if (urlparams != null && urlparams.get("o1") != null) {
                            params.put("o1", urlparams.get("o1"));
                        }
                        params.put("view", "Course");
                        params.put("id", result.getGooruOid());
                        String NameTokenValue = AppClientFactory.getPlaceManager().getCurrentPlaceRequest()
                                .getNameToken();
                        if (NameTokenValue.equalsIgnoreCase(PlaceTokens.MYCONTENT)) {
                            getView().hidePopup();
                            AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.MYCONTENT, params);
                        } else {
                            getView().displaySuccessPopup("My Content", result.getGooruOid(), params,
                                    "collection", folderDo);
                        }
                    } else {
                        getView().hidePopup();
                        Window.enableScrolling(false);
                        AlertContentUc alertContentUc = new AlertContentUc(i18n.GL0061(),
                                "Sorry Something Went Wrong");
                    }
                }
            });
}

From source file:org.ednovo.gooru.client.mvp.gsearch.addResourcePopup.SearchAddResourceToCollectionPresenter.java

License:Open Source License

@Override
public void moveCollectionTOLesson(String collectionId, String collectionTitle,
        final HashMap<String, String> urlparams) {
    if (urlparams != null) {
        this.urlParameters = urlparams;
        courseId = urlparams.get("o1");
        unitId = urlparams.get("o2");
        lessonId = urlparams.get("o3");
    }/* ww  w.ja  v a  2s  .  c  o m*/
    AppClientFactory.getInjector().getResourceService().moveCollectionTOLesson(courseId, unitId, lessonId,
            getCollectionGooruId(),
            new org.ednovo.gooru.application.client.SimpleAsyncCallback<CollectionDo>() {
                @Override
                public void onSuccess(CollectionDo result) {
                    if (result != null && result.getStatusCode() == 200) {
                        FolderDo folderDo = getFolderDo(result);
                        HashMap<String, String> params = new HashMap<String, String>();
                        if (urlparams != null && urlparams.get("o3") != null) {
                            params.put("o3", urlparams.get("o3"));
                        }
                        if (urlparams != null && urlparams.get("o2") != null) {
                            params.put("o2", urlparams.get("o2"));
                        }
                        if (urlparams != null && urlparams.get("o1") != null) {
                            params.put("o1", urlparams.get("o1"));
                        }
                        params.put("id", getCollectionGooruId());
                        params.put("view", "Course");
                        String NameTokenValue = AppClientFactory.getPlaceManager().getCurrentPlaceRequest()
                                .getNameToken();
                        if (NameTokenValue.equalsIgnoreCase(PlaceTokens.MYCONTENT)) {
                            getView().hidePopup();
                            AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.MYCONTENT, params);
                        } else {
                            getView().displaySuccessPopup("My Content", getCollectionGooruId(), params,
                                    "collection", folderDo);
                        }
                    } else {
                        getView().hidePopup();
                        Window.enableScrolling(false);
                        AlertContentUc alertContentUc = new AlertContentUc(i18n.GL0061(),
                                result.getErrorMessage());
                    }
                }
            });
}

From source file:org.ednovo.gooru.client.mvp.gsearch.addResourcePopup.SearchAddResourceToCollectionPresenter.java

License:Open Source License

@Override
public void moveCollectionToMyCOllections(String gooruOid, String folderId, String searchType,
        String collectionTitle, final HashMap<String, String> urlparams) {
    AppClientFactory.getInjector().getResourceService().moveCollectionToMyCOllections(getCollectionGooruId(),
            folderId, this.collectionTitle, new SimpleAsyncCallback<CollectionDo>() {
                @Override/*ww  w  . j  a v  a2 s  . co  m*/
                public void onSuccess(CollectionDo result) {
                    if (result != null && result.getStatusCode() == 200) {
                        FolderDo folderDo = getFolderDo(result);
                        HashMap<String, String> params = new HashMap<String, String>();
                        if (urlparams != null && urlparams.get("o3") != null) {
                            params.put("o3", urlparams.get("o3"));
                        }
                        if (urlparams != null && urlparams.get("o2") != null) {
                            params.put("o2", urlparams.get("o2"));
                        }
                        if (urlparams != null && urlparams.get("o1") != null) {
                            params.put("o1", urlparams.get("o1"));
                        }
                        params.put("id", getCollectionGooruId());
                        params.put("view", "Folder");
                        String NameTokenValue = AppClientFactory.getPlaceManager().getCurrentPlaceRequest()
                                .getNameToken();
                        if (NameTokenValue.equalsIgnoreCase(PlaceTokens.MYCONTENT)) {
                            getView().hidePopup();
                            AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.MYCONTENT, params);
                        } else {
                            getView().displaySuccessPopup("My Content", getCollectionGooruId(), params,
                                    "collection", folderDo);
                        }
                    } else {
                        getView().hidePopup();
                        Window.enableScrolling(false);
                        AlertContentUc alertContentUc = new AlertContentUc(i18n.GL0061(),
                                result.getErrorMessage());
                    }
                }
            });
}

From source file:org.ednovo.gooru.client.mvp.gsearch.collection.SearchCollectionView.java

License:Open Source License

/**
 * To render Collection search results.//from   w  ww .j av  a2  s .  co  m
 * 
 * @return collectionSearchWidget{@link Widget}
 */
@Override
public Widget renderSearchResult(final CollectionSearchResultDo collectionSearchResultDo) {
    final CollectionSearchWidget collectionSearchWidget = new CollectionSearchWidget(collectionSearchResultDo);
    collectionSearchWidget.getRemixBtn().addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            Window.enableScrolling(false);
            if (AppClientFactory.isAnonymous()) {
                LoginPopupUc loginPopupUc = new LoginPopupUc() {
                    @Override
                    public void onLoginSuccess() {
                        Window.enableScrolling(false);
                        displayRemixPopup(collectionSearchResultDo, collectionSearchWidget);
                    }
                };
                loginPopupUc.show();
                loginPopupUc.setGlassEnabled(true);
            } else {
                displayRemixPopup(collectionSearchResultDo, collectionSearchWidget);
            }
        }
    });
    collectionSearchWidget.getElement().setId(collectionSearchResultDo.getGooruOid());
    return collectionSearchWidget;
}

From source file:org.ednovo.gooru.client.mvp.gsearch.resource.SearchResourcePresenter.java

License:Open Source License

@Override
public void displayAddResourcePoup(ResourceSearchResultDo resourceSearchResultDo,
        CollectionResourceWidget collectionResourceWidget) {
    shelfMainPresenter.SetDefaultTypeAndVersion();
    searchAddResourceToCollectionPresenter.DisableMyCollectionsPanelData(false);
    searchAddResourceToCollectionPresenter.getLoadingImage();
    searchAddResourceToCollectionPresenter.getUserShelfData(resourceSearchResultDo, "coursebuilder",
            collectionResourceWidget);// w  w  w.  ja v a2s . c  o m
    addToPopupSlot(searchAddResourceToCollectionPresenter);
    Window.enableScrolling(false);
}

From source file:org.ednovo.gooru.client.mvp.gsearch.resource.SearchResourcePresenter.java

License:Open Source License

public void showRatingAndReviewPopup(ResourceSearchResultDo searchResultDo) {
    Window.enableScrolling(false);
    Element element = Document.get().getElementById("fixedFilterSearchID");
    if (element != null) {
        element.setAttribute("style", "opacity:0.1;z-index:1;");
    }/*from   www. j a  v a2 s.  c  o  m*/
    ratingAndReviewPopup.displayPopup(searchResultDo.getResourceTitle(), searchResultDo.getGooruOid(), null);
    addToPopupSlot(ratingAndReviewPopup);
}

From source file:org.ednovo.gooru.client.mvp.gsearch.resource.SearchResourceView.java

License:Open Source License

/**
 * To render Collection search results./*from ww  w  .j  ava2  s.c  o m*/
 * 
 * @return collectionSearchWidget{@link Widget}
 */
@Override
public Widget renderSearchResult(final ResourceSearchResultDo resourceSearchResultDo) {
    final CollectionResourceWidget collectionResourceWidget = new CollectionResourceWidget(
            resourceSearchResultDo);
    collectionResourceWidget.getAddResoruce().addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            Window.enableScrolling(false);
            if (AppClientFactory.isAnonymous()) {
                LoginPopupUc loginPopupUc = new LoginPopupUc() {
                    @Override
                    public void onLoginSuccess() {
                        callRemixPopup(resourceSearchResultDo, collectionResourceWidget);
                    }
                };
                loginPopupUc.show();
                loginPopupUc.setGlassEnabled(true);
            } else {
                callRemixPopup(resourceSearchResultDo, collectionResourceWidget);
            }
        }
    });

    collectionResourceWidget.getAncViewMore().addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            Window.enableScrolling(false);
            Element element = Document.get().getElementById("fixedFilterSearchID");
            if (element != null) {
                element.setAttribute("style", "opacity:0.1;");
            }
            getUiHandlers().displayUsersList(resourceSearchResultDo);
        }
    });
    collectionResourceWidget.getElement().setId(resourceSearchResultDo.getGooruOid());
    setCollectionResourceWidget(collectionResourceWidget);
    collectionResourceWidget.setUpdateReviewCount(resourceSearchResultDo.getRatings().getReviewCount());
    collectionResourceWidget.getRatingWidgetView().getRatingCountLabel().addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (collectionResourceWidget.getUpdateReviewCount() > 0) {
                getUiHandlers().showRatingAndReviewPopup(resourceSearchResultDo);
            }
        }
    });
    return collectionResourceWidget;
}

From source file:org.ednovo.gooru.client.mvp.gsearch.SearchAbstractPresenter.java

License:Open Source License

@Override
protected void onReset() {
    super.onReset();
    if (AppClientFactory.getPlaceManager().refreshPlace()) {
        if (setFilter) {
            searchDo.setPageNum(1);/*  w ww  .  j av  a2  s  .  c om*/
            getSearchService().getSearchFilters(getCurrentPlaceToken(),
                    new SimpleAsyncCallback<SearchFilterDo>() {
                        @Override
                        public void onSuccess(SearchFilterDo searchFilterDo) {
                            getView().setSearchFilter(searchFilterDo);
                        }
                    });
            setFilter = false;
        } else {
            initiateSearch();
        }
    }
    if (getPlaceManager().getRequestParameter("callback") != null
            && getPlaceManager().getRequestParameter("callback").equalsIgnoreCase("signup")) {
        // To show SignUp (Registration popup)
        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);
    }

    int flag = AppClientFactory.getLoggedInUser().getViewFlag();
    final String loginType = AppClientFactory.getLoggedInUser().getLoginType() != null
            ? AppClientFactory.getLoggedInUser().getLoginType()
            : "";
    if (!AppClientFactory.isAnonymous() && flag == 0 && !loginType.equalsIgnoreCase("Credential")) {
        AlmostDoneUc update = new AlmostDoneUc(AppClientFactory.getLoggedInUser().getEmailId(),
                AppClientFactory.getLoggedInUser());
        update.setGlassEnabled(true);
        update.show();
        update.center();
    }

    Document doc = Document.get();
    doc.getElementById("uvTab").getStyle().setDisplay(Display.BLOCK);
    AppClientFactory.fireEvent(new HomeEvent(HeaderTabType.NONE));
}

From source file:org.ednovo.gooru.client.mvp.gsearch.SearchAbstractPresenter.java

License:Open Source License

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

From source file:org.ednovo.gooru.client.mvp.gsearch.util.SuccessPopupForResource.java

License:Open Source License

public void enableTopFilters() {
    Element element = Document.get().getElementById("fixedFilterSearchID");
    if (element != null) {
        element.removeAttribute("style");
    }//from   w ww  .  j  ava 2  s . c om
    Window.enableScrolling(true);
}