List of usage examples for com.google.gwt.user.client Window enableScrolling
public static void enableScrolling(boolean enable)
From source file:org.ednovo.gooru.client.mvp.shelf.collection.tab.resource.CollectionResourceTabView.java
License:Open Source License
public void setNewResourcePanel(final CollectionItemDo collectionItemDo) { this.collectionItemDo = collectionItemDo; // Refresh on adding : Shelf refreshes but the code below throws an // index out of bouds exception. If this is fixed. New resources will // get added// ww w. ja v a 2 s.c o m collectionItemDo.setCollection(this.collectionDo); Label sequenceLbl = new Label(collectionItemDo.getItemSequence() + ""); sequenceLbl.setStyleName(getCss().shelfResourceSequenceNumber()); int sequencePostion = collectionItemDo.getItemSequence(); sequencePostion = sequencePostion >= sequenceVerPanel.getWidgetCount() ? sequenceVerPanel.getWidgetCount() - 1 : sequencePostion; sequenceVerPanel.insert(sequenceLbl, sequencePostion); resetSequence(); final ShelfCollectionResourceChildView shelfCollectionResourceVc = new ShelfCollectionResourceChildView( this, collectionItemDo); Window.Location.reload(); shelfCollectionResourceVc.getEditInfoLbl().addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { shelfCollectionResourceVc.getResourceEditButtonContainer().getElement().getStyle() .setVisibility(Visibility.HIDDEN); shelfCollectionResourceVc.getEditButton().setVisible(false); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99, false)); if (collectionItemDo.getResource().getCategory().equalsIgnoreCase("Question")) { editQuestionPopupWidget = new EditQuestionPopupWidget(collectionItemDo); editQuestionPopupWidget.getAddQuestion().getElement().getStyle().setDisplay(Display.NONE); editQuestionPopupWidget.getUpdateQuestionImageView().getUploadImage() .addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { getUiHandlers() .updateQustionImage(collectionItemDo.getResource().getGooruOid()); } }); editQuestionPopupWidget.getUpdateQuestionImageView().getRemoveImage() .addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { editQuestionPopupWidget.hide(); deleteConfirmationPopupVc = new ConfirmationPopupVc(MESSAGE_HEADER, MESSAGE_CONTENT) { @Override public void onDelete(ClickEvent clickEvent) { getUiHandlers().removeQuestionImage( collectionItemDo.getResource().getGooruOid()); } public void hide() { super.hide(); Window.enableScrolling(true); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true)); editQuestionPopupWidget.show(); } }; } }); editQuestionPopupWidget.getAddQuestion().addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { getUiHandlers().updateQustionImage(collectionItemDo.getResource().getGooruOid()); } }); // } else if(collectionItemDo.getResource().getResourceType().getDescription().equals("web resource") || collectionItemDo.getResource().getResourceType().getDescription().equals("video")){ } else if (collectionItemDo.getResource().getResourceType().getName().equals("resource/url") || collectionItemDo.getResource().getResourceType().getName().equals("video/youtube")) { editResoruce = new EditResourcePopupVc(collectionItemDo) { @Override public void updateResource(CollectionItemDo collectionItemDo) { getUiHandlers().updateResourceInfo(collectionItemDo); } @Override public void resourceImageUpload() { getUiHandlers().imageEditResourceUpload(); } }; } else { MixpanelUtil.Resource_Action_Edit_Info(); ownResourcePopupVc = new EditUserOwnResourcePopupVc(collectionItemDo) { @Override public void resourceImageUpload() { getUiHandlers().imageEditUserOwnResourceUpload(); } @Override public void updateUserOwnResource(String resourceFilePath, String resMediaFileName, String resOriginalFileName, String titleStr, String desc, String categoryStr, String thumbnailUrlStr) { title = titleStr; description = desc; category = categoryStr; thumbnailUrl = thumbnailUrlStr; JSONObject jsonObject = setEditUserResourceJsonObject(resOriginalFileName, resMediaFileName, title, desc, category, thumbnailUrlStr); getUiHandlers().editUserOwnResource(jsonObject.toString(), collectionItemDo.getResource().getGooruOid()); // getUiHandlers().getUserResourceMediaFileName(resourceFilePath); } }; } } }); collectionResourcePanelVc.addDraggable(shelfCollectionResourceVc, collectionItemDo.getItemSequence()); }
From source file:org.ednovo.gooru.client.mvp.shelf.collection.tab.resource.CollectionResourceTabView.java
License:Open Source License
@Override public void hideUpdateResourcePopup() { editResoruce.hide();/*from ww w .ja v a 2s . c om*/ Window.enableScrolling(true); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true)); }
From source file:org.ednovo.gooru.client.mvp.shelf.collection.tab.resource.CollectionResourceTabView.java
License:Open Source License
@Override public void hideUpdateOwnResourcePopup() { ownResourcePopupVc.hide();/*from w w w . j a v a 2s .c o m*/ Window.enableScrolling(true); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true)); }
From source file:org.ednovo.gooru.client.mvp.shelf.collection.tab.resource.CollectionResourceTabView.java
License:Open Source License
@Override public void hideUpdateResourceQuestionPopup() { AppClientFactory.fireEvent(new GetEditPageHeightEvent(editQuestionPopupWidget, true)); editQuestionPopupWidget.hide();//from w w w . j av a 2s . co m Window.enableScrolling(true); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true)); }
From source file:org.ednovo.gooru.client.mvp.shelf.collection.tab.resource.CollectionResourceTabView.java
License:Open Source License
public void displayUpdateQuestionView(String imageUrl, String fileNameWithOutRepository) { UpdateQuestionImageView updateQuestionImage = new UpdateQuestionImageView(); updateQuestionImage.getUpdateQuestionImage().setUrl(imageUrl); updateQuestionImage.setThumbnailImageUrl(fileNameWithOutRepository); editQuestionPopupWidget.getQuestionImageContainer().clear(); editQuestionPopupWidget.getQuestionImageContainer().add(updateQuestionImage); updateQuestionImage.getUploadImage().addClickHandler(new ClickHandler() { @Override/*w w w . j av a 2 s . c o m*/ public void onClick(ClickEvent event) { getUiHandlers().updateQustionImage(editQuestionPopupWidget.collectionItemId); } }); updateQuestionImage.getRemoveImage().addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { editQuestionPopupWidget.hide(); deleteConfirmationPopupVc = new ConfirmationPopupVc(MESSAGE_HEADER, MESSAGE_CONTENT) { @Override public void onDelete(ClickEvent clickEvent) { getUiHandlers().removeQuestionImage(editQuestionPopupWidget.collectionItemId); } public void hide() { super.hide(); Window.enableScrolling(true); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true)); editQuestionPopupWidget.show(); } }; } }); }
From source file:org.ednovo.gooru.client.mvp.shelf.collection.tab.resource.CollectionResourceTabView.java
License:Open Source License
@Override public void removeUpdateQuestionView() { deleteConfirmationPopupVc.hide();//from w w w. j a va2 s . c om Window.enableScrolling(true); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true)); editQuestionPopupWidget.show(); editQuestionPopupWidget.getUpdateQuestionImageView().removeFromParent(); editQuestionPopupWidget.getAddQuestion().getElement().getStyle().setDisplay(Display.BLOCK); }
From source file:org.ednovo.gooru.client.mvp.shelf.collection.tab.resource.exists.ExistsResourceView.java
License:Open Source License
public ExistsResourceView() { setWidget(uiBinder.createAndBindUi(this)); setModal(true);/* ww w . j a va 2 s. co m*/ Window.enableScrolling(false); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99, false)); alreadyExistsText.getElement().setInnerHTML(GL0932 + GL_SPL_EXCLAMATION); resourceExistsText.getElement().setInnerHTML(GL0933 + GL_SPL_EXCLAMATION); resourceThumbnailImg.setUrl("images/thumbimg-I.png"); resourceTitleLbl.setText(GL0935); addExistsResourceBtnLbl.setText(GL0590); cancelExistsResourcePopupBtnLbl.setText(GL0142); loadingTextLbl.setText(GL0591.toLowerCase()); addExistsResourceBtnLbl.getElement().setId("lblAdd"); cancelExistsResourcePopupBtnLbl.getElement().setId("lblCancel"); cancelExistsResourcePopupBtnLbl.addClickHandler(new CloseExistsClickHandler()); addExistsResourceBtnLbl.addClickHandler(new AddExistsClickHandler()); loadingTextLbl.getElement().getStyle().setFontStyle(FontStyle.ITALIC); loadingTextLbl.getElement().getStyle().setTextAlign(TextAlign.CENTER); buttonContainer.setVisible(true); loadingTextLbl.setVisible(false); }
From source file:org.ednovo.gooru.client.mvp.shelf.collection.tab.resource.item.CopyConfirmPopupVc.java
License:Open Source License
public void hide() { popupPanel.hide(); Window.enableScrolling(true); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true)); }
From source file:org.ednovo.gooru.client.mvp.shelf.collection.tab.resource.item.EditQuestionPopupVc.java
License:Open Source License
@UiHandler("btnCancel") public void cancelPopUp(ClickEvent clickEvent) { AppClientFactory.fireEvent(new GetEditPageHeightEvent(this, true)); hide();/*from w ww . j av a 2 s .c o m*/ Window.enableScrolling(true); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(0, true)); }
From source file:org.ednovo.gooru.client.mvp.shelf.collection.tab.resource.item.EditResourcePopupVc.java
License:Open Source License
public EditResourcePopupVc(CollectionItemDo collectionItemDo) { super();//from w ww . ja v a2s. co m // this.getElement().getStyle().setWidth(450, Unit.PX); // this.getElement().getStyle().setHeight(788, Unit.PX); this.collectionItemDo = collectionItemDo; setContent(GL0949, uiBinder.createAndBindUi(this)); addResourceBtn.addClickHandler(new AddClickHandler()); addResourceBtn.getElement().getStyle().setFloat(Float.LEFT); uploadImageLbl.addClickHandler(new OnEditImageClick()); titleTextBox.addKeyUpHandler(new TitleKeyUpHandler()); descriptionTxtAera.addKeyUpHandler(new DescriptionKeyUpHandler()); titleTextBox.getElement().setAttribute("maxlength", "50"); descriptionTxtAera.getElement().setAttribute("maxlength", "300"); mandatoryUrlLbl.setVisible(false); mandatoryTitleLbl.setVisible(false); mandatoryCategoryLbl.setVisible(false); descCharcterLimit.setVisible(false); leftArrowLbl.setVisible(false); rightArrowLbl.setVisible(false); setThumbnailImage.setVisible(true); resourceTypePanel.setVisible(false); loadingTextLbl.getElement().getStyle().setFontStyle(FontStyle.ITALIC); generateImageLbl.setVisible(false); saveButtonContainer.setVisible(true); loadingTextLbl.setVisible(false); panelContentRights.setVisible(false); mandatoryTitleLblForSwareWords.setVisible(false); mandatoryDescLblForSwareWords.setVisible(false); rightsChkBox.addClickHandler(new rightsChecked()); rightsChkBox.getElement().setId("chkRights"); setModal(true); Window.enableScrolling(false); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99, false)); mandatoryTitleLbl.setText(GL0173); descCharcterLimit.getElement().setInnerText(GL0143); mandatoryCategoryLbl.setText(GL1515); thumbnailLbl.getElement().setInnerText(GL0911); titleTextPanel.getElement().setInnerText(GL0318 + GL_SPL_STAR); videoPanel.getElement().setInnerHTML(GL0918); interactivePanel.getElement().setInnerHTML(GL0919); websitePanel.getElement().setInnerHTML(GL1396); textsPanel.getElement().setInnerHTML(GL1044); audioPanel.getElement().setInnerHTML(GL1045); imagePanel.getElement().setInnerHTML(GL1046); generateImageLbl.setText(GL0922); orLbl.getElement().setInnerText(GL_GRR_Hyphen + GL0209.toLowerCase() + GL_GRR_Hyphen); uploadImageLbl.setText(GL0912); refreshLblPanel.getElement().setInnerText(GL0923); rightsLbl.setText(GL0869); agreeText.setText(GL0870); commuGuideLinesAnr.setText(GL0871); termsAndPolicyAnr.setText(" " + GL0872 + GL_GRR_COMMA); privacyAnr.setText(" " + GL0873); andText.setText(" " + GL_GRR_AND + " "); copyRightAnr.setText(" " + GL0875); additionalText.setText(GL0874); addResourceBtn.setText(GL0141); cancelResourcePopupBtnLbl.setText(GL0142); loadingTextLbl.setText(GL0808.toLowerCase()); // otherPanel.getElement().setInnerHTML(MessageProperties.GL1047); resourceFormat.getElement().setInnerHTML(GL0906); resDescription.getElement().setInnerHTML(GL0904); urlTextPanel.getElement().setInnerHTML(GL0915); mandatoryUrlLbl.setText(GL0916); displayResourceInfo(); show(); center(); AppClientFactory.fireEvent(new GetEditPageHeightEvent(this, false)); getResourceMetaInfo(collectionItemDo.getResource().getUrl()); copyRightAnr.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Window.enableScrolling(false); copyRightPolicy = new CopyRightPolicyVc() { @Override public void openParentPopup() { Window.enableScrolling(false); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(98, false)); } }; copyRightPolicy.show(); copyRightPolicy.setSize("902px", "300px"); copyRightPolicy.center(); copyRightPolicy.getElement().getStyle().setZIndex(999); } }); termsAndPolicyAnr.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Window.enableScrolling(false); termsOfUse = new TermsOfUse() { @Override public void openParentPopup() { Window.enableScrolling(false); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(98, false)); } }; termsOfUse.show(); termsOfUse.setSize("902px", "300px"); termsOfUse.center(); termsOfUse.getElement().getStyle().setZIndex(999); } }); privacyAnr.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Window.enableScrolling(false); termsAndPolicyVc = new TermsAndPolicyVc(false) { @Override public void openParentPopup() { Window.enableScrolling(false); AppClientFactory.fireEvent(new SetHeaderZIndexEvent(98, false)); } }; termsAndPolicyVc.show(); termsAndPolicyVc.setSize("902px", "300px"); termsAndPolicyVc.center(); termsAndPolicyVc.getElement().getStyle().setZIndex(999); } }); commuGuideLinesAnr.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Window.open("http://support.goorulearning.org/hc/en-us/articles/200688506", "_blank", ""); } }); titleTextBox.addBlurHandler(new CheckProfanityInOnBlur(titleTextBox, null, mandatoryTitleLblForSwareWords)); descriptionTxtAera.addBlurHandler( new CheckProfanityInOnBlur(null, descriptionTxtAera, mandatoryDescLblForSwareWords)); }