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.uc.DeleteContentPopup.java

License:Open Source License

/**
 * 
 * @param event
 */
@UiHandler("closeBtn")
public void onColseButtonClicked(ClickEvent event) {
    hide();
    Window.enableScrolling(true);
}

From source file:org.ednovo.gooru.client.uc.EmailShareUc.java

License:Open Source License

/**
 * Class constructor , create a new pop up
 * @param socialDo, Object of SocialShareDo. 
 *//*w  ww .j a va2 s.  c om*/
public EmailShareUc(SocialShareDo socialDo) {
    super(false);
    setWidget(uiBinder.createAndBindUi(this));
    UcCBundle.INSTANCE.css().ensureInjected();
    HomeCBundle.INSTANCE.css().ensureInjected();
    this.socialShareDo = socialDo;
    setSocialShareAsyncCallback(new SimpleAsyncCallback<Void>() {

        @Override
        public void onSuccess(Void result) {
        }

    });
    this.getElement().getStyle().setZIndex(999999);
    this.setGlassStyleName(HomeCBundle.INSTANCE.css().loginPopupGlassStyle());
    fromValidation.setText(GL0215);
    toValidation.setText(GL0216);
    lblEmailFriend.setText(GL0222);
    lblFrom.setText(GL0223 + GL_SPL_SEMICOLON);
    lblTo.setText(GL0224 + GL_SPL_SEMICOLON);
    lblSendMeCopy.setText(GL0225);
    lblSubject.setText(GL0226 + GL_SPL_SEMICOLON);
    lblMessage.setText(GL0227 + GL_SPL_SEMICOLON);
    btnSend.setText(GL0228);
    cancelLbl.setText(GL0142);

    fromTxt.setMaxLength(50);

    mandatoryErrorLbl.setVisible(false);
    mandatoryErrorRichTextArea.setVisible(false);

    fromValidation.setVisible(false);
    toValidation.setVisible(false);

    noteTxt.setText(GL1636);
    if (AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken()
            .equals(PlaceTokens.EDIT_CLASSPAGE)) {
        noteTxt.setVisible(false);
    } else {
        noteTxt.setVisible(true);
    }

    if (!AppClientFactory.isAnonymous()) {
        loggedEmailId = AppClientFactory.getLoggedInUser().getFirstName() + " "
                + AppClientFactory.getLoggedInUser().getLastName();
    } else {
        loggedEmailId = "";
    }
    cancelLbl.getElement().setId("lblCancel");
    toTxt.getElement().setId("tbTo");
    subTxt.getElement().setId("tbSubject");
    fromTxt.getElement().setId("tbFrom");
    msgTxa.getElement().setId("taMessage");
    btnSend.getElement().setId("btnSend");
    //fromTxt.getElement().getStyle().setBorderWidth(0, Unit.PX);
    fromTxt.setText(loggedEmailId);
    //fromTxt.setReadOnly(true);
    //      toTxt.getElement().setAttribute("placeholder", GL1184_1);
    toTxt.setPlaceholder(GL1184_1);
    fromTxt.addBlurHandler(new CheckProfanityInOnBlur(fromTxt, null, fromValidation));
    subTxt.addBlurHandler(new CheckProfanityInOnBlur(subTxt, null, mandatoryErrorLbl));
    msgTxa.addBlurHandler(new CheckProfanityInOnBlur(null, msgTxa, mandatoryErrorRichTextArea));
    if (AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.PROFILE_PAGE)) {
        if (socialShareDo.getIsSearchShare()) {
            //            subTxt.setText("Gooru -"+socialShareDo.getTitle());
            subTxt.setText(StringUtil.generateMessage(GL0218, socialShareDo.getTitle()));
            //            msgTxa.setHTML(socialShareDo.getTitle() +"<div><br/></div>"+"<div>" +socialShareDo.getBitlylink() + "</div><div><br/></div>"+ "<div>"+"Sent using Gooru. Visit www.goorulearning.org for more great resources and collections. It's free!"+"</div>");
            msgTxa.setHTML(StringUtil.generateMessage(GL0219, socialShareDo.getTitle(),
                    socialShareDo.getDecodeRawUrl(),
                    AppClientFactory.getLoggedInUser().getSettings().getHomeEndPoint()));
        } else {
            //            subTxt.setText("Check out "+socialShareDo.getTitle()+" Gooru profile and fantastic collections");
            subTxt.setText(StringUtil.generateMessage(GL0220, socialShareDo.getTitle()));
            //            msgTxa.setHTML(socialShareDo.getTitle() +" is an active member of the Gooru community! Take a look and browse through all their great collections - " +socialShareDo.getBitlylink()
            //                  + "<div><br/></div>"+ "<div>"+"Gooru is a free search engine for learning used by thousands of teachers around the world to discover, organize and create teaching materials."+ "</div><div><br/></div>"+ "<div>"+"Experience Gooru today at http://goorulearning.org/"+"</div>");
            msgTxa.setHTML(
                    StringUtil.generateMessage(GL0221, socialShareDo.getTitle(), socialShareDo.getBitlylink(),
                            AppClientFactory.getLoggedInUser().getSettings().getHomeEndPoint()));
        }
    } else if (AppClientFactory.getCurrentPlaceToken().equals(PlaceTokens.EDIT_CLASSPAGE)) {
        lblEmailFriend.setText(GL0222_1);
        subTxt.setText(StringUtil.generateMessage(GL0218_1, socialShareDo.getCategoryType(),
                "\"" + socialShareDo.getTitle() + "\""));
        msgTxa.setHTML(StringUtil.generateMessage(GL0219_1, socialShareDo.getCategoryType(),
                socialShareDo.getTitle(), socialShareDo.getBitlylink(), socialShareDo.getDecodeRawUrl(),
                AppClientFactory.getLoggedInUser().getSettings().getHomeEndPoint()));
    } else {
        //         subTxt.setText("Gooru -"+socialShareDo.getTitle());
        subTxt.setText(StringUtil.generateMessage(GL0218, socialShareDo.getTitle()));
        //         msgTxa.setHTML(socialShareDo.getTitle() +"<div><br/></div>"+"<div>" +socialShareDo.getBitlylink() + "</div><div><br/></div>"+ "<div>"+"Sent using Gooru. Visit www.goorulearning.org for more great resources and collections. It's free!"+"</div>");
        msgTxa.setHTML(
                StringUtil.generateMessage(GL0219, socialShareDo.getTitle(), socialShareDo.getDecodeRawUrl(),
                        AppClientFactory.getLoggedInUser().getSettings().getHomeEndPoint()));
    }

    isCheckedValue = false;
    isvalid = true;
    Window.enableScrolling(false);
    this.setGlassEnabled(true);
    this.center();
    msgTxa.addInitializeHandler(new InitializeHandler() {
        @Override
        public void onInitialize(InitializeEvent event) {
            Document document = IFrameElement.as(msgTxa.getElement()).getContentDocument();
            BodyElement body = document.getBody();
            body.setAttribute("style", "font-family: Arial;font-size:12px;");
        }
    });

}

From source file:org.ednovo.gooru.client.uc.EmailShareUc.java

License:Open Source License

/**
 * Hide {@link EmailShareUc} popup//w  w  w  .j av a  2s.co  m
 * @param clickEvent instOLance of {@link ClickEvent}
 */
@UiHandler("cancelLbl")
public void onCancelClickEvent(ClickEvent event) {
    this.hide();
    String placeToken = AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken();
    if (!placeToken.equals(PlaceTokens.COLLECTION_PLAY) || !placeToken.equals(PlaceTokens.PREVIEW_PLAY)
            || !placeToken.equals(PlaceTokens.RESOURCE_PLAY)) {
        Window.enableScrolling(true);
    }
}

From source file:org.ednovo.gooru.client.uc.EmailShareUc.java

License:Open Source License

/**
 * Validates and send the data./*from w w w  .j av a2  s .c o  m*/
 * @param clickEvent instance of {@link ClickEvent}
 */
@UiHandler("btnSend")
public void onSendBtnClickEvent(ClickEvent event) {
    isvalid = true;
    /*      if(fromTxt.getText() != null || !fromTxt.getText().equals("")){
             String EMAIL_REGEX = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$";
             Boolean from = fromTxt.getText().matches(EMAIL_REGEX);
             if(from){
    isvalid = true;
             }else{
    toValidation.setText(GL1027);
    toValidation.setVisible(true);
    isvalid = false;
             }
          }*/
    if (!toTxt.getText().trim().equals("")) {
        String EMAIL_REGEX = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$";
        String strEmails = toTxt.getText().trim();
        String emailIds[] = strEmails.split("\\s*,\\s*");
        if (strEmails.contains(",")) {
            emailIds = strEmails.split("\\s*,\\s*");
        } else if (strEmails.contains(";")) {
            emailIds = strEmails.split("\\s*;\\s*");
        }

        for (int i = 0; i < emailIds.length; i++) {
            boolean to = emailIds[i].matches(EMAIL_REGEX);
            if (to) {
                isvalid = true;
            } else {
                toValidation.setText(StringUtil.generateMessage(GL1019, emailIds[i]));
                toValidation.setVisible(true);
                isvalid = false;
                break;
            }
        }
    }
    if ((toTxt.getText() != null && !toTxt.getText().isEmpty()) && !toTxt.getText().contains(AT_SYMBOL)) {
        toValidation.setText(GL1027);
        toValidation.setVisible(true);
        isvalid = false;

    }
    /*      if (fromTxt.getText().equals("")) {
             fromValidation.setText(GL0215);
             fromValidation.setVisible(true);
             isvalid = false;
          }*/
    if (toTxt.getText().equals("") || toTxt.getText().trim().equals("")) {
        toValidation.setText(GL0216);
        toValidation.setVisible(true);
        isvalid = false;
    }
    /*      if ((fromTxt.getText() != null && !fromTxt.getText().isEmpty())
    && !fromTxt.getText().contains(AT_SYMBOL)) {
            
             fromValidation.setText(GL1027);
             fromValidation.setVisible(true);
             isvalid = false;
          }*/
    if (isvalid) {
        final Map<String, String> parms = new HashMap<String, String>();
        parms.put("text", subTxt.getValue());
        AppClientFactory.getInjector().getResourceService().checkProfanity(parms,
                new SimpleAsyncCallback<Boolean>() {
                    @Override
                    public void onSuccess(Boolean value) {
                        isHavingBadWordsInTextbox = value;
                        if (value) {
                            SetStyleForProfanity.SetStyleForProfanityForTextBox(subTxt, mandatoryErrorLbl,
                                    value);
                        } else {
                            parms.put("text", msgTxa.getText());
                            AppClientFactory.getInjector().getResourceService().checkProfanity(parms,
                                    new SimpleAsyncCallback<Boolean>() {

                                        @Override
                                        public void onSuccess(Boolean result) {
                                            isHavingBadWordsInRichText = result;
                                            if (result) {
                                                SetStyleForProfanity.SetStyleForProfanityForRichTextArea(msgTxa,
                                                        mandatoryErrorRichTextArea, result);
                                            } else {
                                                if (count == 0) {
                                                    if (!isHavingBadWordsInRichText
                                                            && !isHavingBadWordsInTextbox) {
                                                        AppClientFactory.getInjector().getClasspageService()
                                                                .socialShareEmail(fromTxt.getText(),
                                                                        toTxt.getText(), cfm, subTxt.getText(),
                                                                        msgTxa.getHTML(),
                                                                        new SimpleAsyncCallback<Void>() {

                                                                            @Override
                                                                            public void onSuccess(Void result) {
                                                                                hide();
                                                                                String placeToken = AppClientFactory
                                                                                        .getPlaceManager()
                                                                                        .getCurrentPlaceRequest()
                                                                                        .getNameToken();
                                                                                if (!(placeToken.equals(
                                                                                        PlaceTokens.COLLECTION_PLAY)
                                                                                        || !placeToken.equals(
                                                                                                PlaceTokens.PREVIEW_PLAY)
                                                                                        || placeToken.equals(
                                                                                                PlaceTokens.RESOURCE_PLAY))) {
                                                                                    Window.enableScrolling(
                                                                                            true);
                                                                                }
                                                                                new SentEmailSuccessVc(
                                                                                        toTxt.getText());
                                                                            }
                                                                        });
                                                    }
                                                }
                                                count++;
                                            }

                                        }
                                    });
                        }
                    }
                });
    }
    /*   if (isvalid  && !isHavingBadWordsInRichText && !isHavingBadWordsInTextbox) {
          AppClientFactory
          .getInjector()
          .getClasspageService()
          .socialShareEmail(fromTxt.getText(), toTxt.getText(), cfm,
       subTxt.getText(), msgTxa.getHTML(),
       new SimpleAsyncCallback<Void>() {
            
    @Override
    public void onSuccess(Void result) {
       hide();
       String placeToken = AppClientFactory.getPlaceManager().getCurrentPlaceRequest().getNameToken();
       if(!(placeToken.equals(PlaceTokens.COLLECTION_PLAY) || !placeToken.equals(PlaceTokens.PREVIEW_PLAY)||placeToken.equals(PlaceTokens.RESOURCE_PLAY))) {
          Window.enableScrolling(true);
       }
       new SentEmailSuccessVc(toTxt.getText());
    }
            
          });
            
       }*/
}

From source file:org.ednovo.gooru.client.uc.FlaggingPopUp.java

License:Open Source License

@UiHandler("closeButton")
public void onClickOfcloseButton(ClickEvent event) {
    Window.enableScrolling(true);
    this.hide();
}

From source file:org.ednovo.gooru.client.uc.StandardsPopupVc.java

License:Open Source License

/**
 * //from   w  w w . java 2s . com
 * @param standards
 */
public StandardsPopupVc(List<Map<String, String>> standards) {
    super(false);
    this.res = UcCBundle.INSTANCE;
    res.css().ensureInjected();
    add(binder.createAndBindUi(this));
    this.setGlassEnabled(true);
    standardsText.getElement().setInnerHTML(GL0575);
    this.standards = standards;
    this.iterator = standards.iterator();
    this.getElement().setAttribute("style", "z-index:99999");
    Window.enableScrolling(false);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99, false));

    setStandards();

    this.center();
}

From source file:org.ednovo.gooru.client.uc.StandardsPopupVc.java

License:Open Source License

/**
 * Added click handler to hide the login popup.
 * //from   www  . j ava  2s. c  om
 * @param clickEvent
 *            instance of {@link ClickEvent}
 */
@UiHandler("cancelButton")
public void onCancelClicked(ClickEvent clickEvent) {

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

    hide();
}

From source file:org.ednovo.gooru.client.uc.ThankYouToolTip.java

License:Open Source License

@UiHandler("okButton")
public void onClickOfOkButton(ClickEvent event) {
    Window.enableScrolling(true);
    this.hide();

}

From source file:org.ednovo.gooru.client.uc.tooltip.DiscoverToolTipUc.java

License:Open Source License

/**
 * Because this class has a default constructor, it can
 * be used as a binder template. In other words, it can be used in other
 * *.ui.xml files as follows://w  ww. ja v a2  s. c o  m
 * <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
 *   xmlns:g="urn:import:**user's package**">
 *  <g:**UserClassName**>Hello!</g:**UserClassName>
 * </
 * ui:UiBinder>
 * Note that depending on the widget that is used, it may be necessary to
 * implement HasHTML instead of HasText.
 */
public DiscoverToolTipUc() {
    initWidget(uiBinder.createAndBindUi(this));
    panelCode.getElement().setId("pnlPanelCode");
    lblDistrictLibrary.getElement().setInnerHTML(i18n.GL0515());
    lblDistrictLibrary.getElement().setId("epnlLblDistrictLibrary");
    lblDistrictLibrary.getElement().setAttribute("alt", i18n.GL0515());
    lblDistrictLibrary.getElement().setAttribute("title", i18n.GL0515());

    dropdownImg.getElement().setId("pnlDropdownImg");
    dropdownImgLib.getElement().setId("pnlDropdownImgLib");

    lblGooruLibrary.setText(i18n.GL0516());
    lblGooruLibrary.getElement().setId("lblLblGooruLibrary");
    lblGooruLibrary.getElement().setAttribute("alt", i18n.GL0516());
    lblGooruLibrary.getElement().setAttribute("title", i18n.GL0516());

    //lblPartnerLibrary.add(new Label(i18n.GL1751()));
    lblPartnerLibrary.setText(i18n.GL1751());
    lblPartnerLibrary.getElement().setId("epnlLblPartnerLibrary");

    partnerLibContainer.getElement().addClassName("setVisible");
    partnerLibContainer.getElement().setId("epnlPartnerLibContainer");

    districtLibContainer.getElement().addClassName("setVisible");
    districtLibContainer.getElement().setId("epnlDistrictLibContainer");

    lblPartnerLibrary.addMouseOverHandler(new OpenPartnerMenu());
    partnerLibContainer.addMouseOutHandler(new ClosePartnerMenu());

    lblGooruLibrary.addMouseOverHandler(new CloseOtherMenus());
    lblDistrictLibrary.addMouseOverHandler(new OpenDistrictMenus());

    tooltipPanel.getElement().setId("pnlTooltipPanel");

    final HashMap<String, String> publicPartnerList = getPublicLibraryPartners();
    UlPanel ulPanel = new UlPanel();
    ulPanel.addStyleName("dropdown-menu");
    ulPanel.addStyleName("dropdowDisplay");
    ulPanel.addStyleName("partnersDropdown");
    for (final Object key : publicPartnerList.keySet()) {
        final Anchor partnerTitle = new Anchor(key.toString());
        LiPanel liPanel = new LiPanel();
        /*   partnerTitle.addStyleName("courseOption");*/
        partnerTitle.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                MixpanelUtil.mixpanelEvent("Community_Library_Click_" + publicPartnerList.get(key));
                setHeaderBrowserTitle(partnerTitle.getText());
                AppClientFactory.getPlaceManager().revealPlace(publicPartnerList.get(key));
            }
        });
        liPanel.add(partnerTitle);
        ulPanel.add(liPanel);
    }
    districtLibContainer.add(ulPanel);

    getPartners();

    /*      this.addMouseOutHandler(new MouseOutHandler() {
                     
             @Override
             public void onMouseOut(MouseOutEvent event) {
     //hide();
             }
          });*/

    lblGooruLibrary.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            Window.enableScrolling(true);
            AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.DISCOVER);
        }
    });

    Boolean isIpad = !!Navigator.getUserAgent().matches("(.*)iPad(.*)");
    Boolean isAndriod = !!Navigator.getUserAgent().matches("(.*)Android(.*)");
    Boolean isWinDskp = !!Navigator.getUserAgent().matches("(.*)NT(.*)");

    UAgentInfo detector = new UAgentInfo(Navigator.getUserAgent());

    /*   if(isIpad && !StringUtil.IPAD_MESSAGE_Close_Click){
          panelCode.getElement().getFirstChildElement().setAttribute("style", "position:relative;margin-top:-53px;");
          districtLibContainer.getElement().setAttribute("style", "margin-top:-4px;");
          partnerLibContainer.getElement().setAttribute("style", "margin-top:20px;");
       }else if(isAndriod && !StringUtil.IPAD_MESSAGE_Close_Click){
          panelCode.getElement().getFirstChildElement().setAttribute("style", "position:relative;margin-top:-53px;");
          districtLibContainer.getElement().setAttribute("style", "margin-top:-4px;");
          partnerLibContainer.getElement().setAttribute("style", "margin-top:20px;");
       }else{
          panelCode.getElement().getFirstChildElement().removeAttribute("style");
          districtLibContainer.getElement().removeAttribute("style");
          partnerLibContainer.getElement().removeAttribute("style");
       }*/

    /*      Window.addWindowScrollHandler(new ScrollHandler() {
             @Override
             public void onWindowScroll(ScrollEvent event) {
    partnerLibContainer.getElement().getStyle().setMarginTop(event.getScrollTop()+100, Unit.PX);
    //districtLibContainer.getElement().getStyle().setMarginTop(event.getScrollTop()+23, Unit.PX);
             }
          });*/

}

From source file:org.gwm.samples.gwmdemo.client.GwmDemo.java

License:Apache License

public void onModuleLoad() {
    instance = this;
    buildUI();
    menuFrame.setSize(150, 300);
    Window.enableScrolling(false);
}