Example usage for com.google.gwt.user.client.ui HTMLPanel HTMLPanel

List of usage examples for com.google.gwt.user.client.ui HTMLPanel HTMLPanel

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HTMLPanel HTMLPanel.

Prototype

private HTMLPanel(Element elem) 

Source Link

Document

Construct a new HTMLPanel with the specified element.

Usage

From source file:org.ednovo.gooru.client.mvp.home.library.assign.AssignPopupVc.java

License:Open Source License

/**
 * /*from   ww w  .  j  a v  a2  s .  co m*/
 */
public AssignPopupVc(String collectionIdVal, String collectionTitle, String collectionDescription) {
    super(false);

    res = AssignPopUpCBundle.INSTANCE;
    AssignPopUpCBundle.INSTANCE.css().ensureInjected();
    add(uiBinder.createAndBindUi(this));
    this.setGlassEnabled(true);
    swithUrlLbl.setText(GL0639);
    swithToEmbedLbl.setText(GL0640);
    AppClientFactory.getEventBus().addHandler(SetLoginStatusEvent.TYPE, setLoginStatusHandler);

    setLabelsAndIds();
    setHandlers();

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

    htmlLoginPanel.setVisible(false);

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

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

                @Override
                public void onFailure(Throwable caught) {

                }

                @Override
                public void onSuccess(CollectionDo result) {

                    toAssignStr = result.getGooruOid();

                    if (result.getGooruOid() != null) {

                        collectionDoGlobal = result;

                        if (AppClientFactory.isAnonymous()) {
                            hideContainers();

                        } else {
                            loadListContainers();

                        }

                    }

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

                }
            });
    generateShareLink(collectionIdVal, collectionTitle, collectionDescription);
    setShareUrlGenerationAsyncCallback(new SimpleAsyncCallback<Map<String, String>>() {

        @Override
        public void onSuccess(Map<String, String> result) {
            embedBitlyLink = result.get("decodeRawUrl");
        }
    });
    Window.enableScrolling(false);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99, false));
    this.center();
}

From source file:org.ednovo.gooru.client.mvp.home.library.LibraryMenuNav.java

License:Open Source License

protected void setTaxonomyDataforStandards(String subjectname, final String subjectCode, String courseIdRefresh,
        ArrayList<StandardCourseDo> courseDoList) {
    if (courseDoList != null) {
        for (final StandardCourseDo standardsCourseDo : courseDoList) {

            if (subjectname.equalsIgnoreCase(STANDARDS)) {
                dynamicContainer.clear();
                final Label courseTitle = new Label(standardsCourseDo.getLabel());
                courseTitle.setStyleName(libraryStyleUc.courseOption());
                courseTitle.getElement().setAttribute("style", "width: 50%;");
                final String standardsId = standardsCourseDo.getCodeId().toString();

                dynamicContainer.add(courseTitle);

                HTMLEventPanel panel = new HTMLEventPanel(dynamicContainer.getElement().getInnerHTML());
                panel.setStyleName(libraryStyleUc.twoColumnContainer());
                panel.getElement().setAttribute("style", "width: 200%;clear: both;height: 0px;");

                final HTMLPanel subDropMenu = new HTMLPanel("");
                subDropMenu.setStyleName(libraryStyleUc.subDropdown());
                subDropMenu.getElement().setAttribute("style",
                        "background: white;top: 0px;left: -1px;border: 1px solid #ddd;");
                for (final CourseDo courseDo : standardsCourseDo.getCourse()) {
                    Label unitsTitle = new Label(courseDo.getLabel());
                    unitsTitle.setStyleName(libraryStyleUc.unitOption());
                    final String courseId = courseDo.getCodeId().toString();
                    courseDoMap.put(courseId, courseDo);
                    unitsTitle.addClickHandler(new ClickHandler() {

                        @Override
                        public void onClick(ClickEvent event) {
                            setHeaderBrowserTitle(standardsCourseDo.getLabel());
                            //MixpanelUtil.mixpanelEvent("Library_"+STANDARDS+"_"+standardsCourseDo.getLabel());
                            MixpanelUtil.mixpanelEvent("standardlibrary_select_course");
                            Map<String, String> params = new HashMap<String, String>();
                            params.put(LIBRARY_PAGE, "course-page");
                            params.put(SUBJECT, STANDARDS);
                            params.put("courseId", courseId);
                            params.put("standardId", standardsId);
                            if (courseTitle.getText().contains("Texas")) {
                                params.put("libtype", "TEKS");
                            }//from   www  . ja  va 2  s . c om
                            AppClientFactory.getPlaceManager().revealPlace(getPlaceToken(), params);

                        }
                    });
                    subDropMenu.add(unitsTitle);
                }
                subDropMenu.getElement().getStyle().setDisplay(Display.NONE);

                panel.addMouseOverHandler(new MouseOverHandler() {

                    @Override
                    public void onMouseOver(MouseOverEvent event) {
                        subDropMenu.getElement().getStyle().setDisplay(Display.INLINE_BLOCK);

                    }
                });
                panel.addMouseOutHandler(new MouseOutHandler() {

                    @Override
                    public void onMouseOut(MouseOutEvent event) {
                        subDropMenu.getElement().getStyle().setDisplay(Display.NONE);

                    }
                });

                panel.add(subDropMenu);
                standardData.add(panel);
            }

        }
        if (!AppClientFactory.isAnonymous()) {
            try {
                getStandardPrefCode(
                        AppClientFactory.getLoggedInUser().getMeta().getTaxonomyPreference().getCode());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    if (courseIdRefresh != null) {
        if (subjectname.equals(SCIENCE)) {
            isScienceHovered = true;
        } else if (subjectname.equals(MATH)) {
            isMathHovered = true;
        } else if (subjectname.equals(SOCIAL)) {
            isSocialHovered = true;
        } else if (subjectname.equals(LANGUAGE)) {
            isLanguageHovered = true;
        } else if (subjectname.equals(STANDARDS)) {
            isStandatdHover = true;
        }

        setTabSelection(subjectname);
        AppClientFactory.fireEvent(new OpenSubjectCourseEvent(subjectname, courseDoMap.get(courseIdRefresh)));
    }
}

From source file:org.ednovo.gooru.client.mvp.home.library.LibraryTopicListView.java

License:Open Source License

/**
 * //from  w  ww  .j  a v  a  2 s.  c o m
 * @function setConceptData 
 * 
 * @created_date : 04-Dec-2013
 * 
 * @description
 * 
 * 
 * @parm(s) : 
 * 
 * @return : void
 *
 * @throws : <Mentioned if any exceptions>
 *
 */
public void setConceptData(final ConceptDo conceptDo, Integer topicId, final String lessonId,
        String lessonLabel, String lessonCode) {
    setConceptDo(conceptDo);
    this.lessonCode = lessonCode;
    String subjectName = AppClientFactory.getPlaceManager().getRequestParameter(SUBJECT_NAME);
    if (this.topicId == topicId) {
        if (subjectName != null && subjectName.equalsIgnoreCase(STANDARDS)) {
            standardsDescription.clear();
            InlineLabel headerLbl = new InlineLabel(GL1363 + GL_SPL_SEMICOLON + " ");
            headerLbl.getElement().getStyle().setFontWeight(FontWeight.BOLD);
            if (lessonLabel.length() > 400) {
                lessonLabel = lessonLabel.substring(0, 400) + "...";
            }
            InlineLabel textLbl = new InlineLabel(lessonLabel);
            standardsDescription.add(headerLbl);
            standardsDescription.add(textLbl);
            standardsDescription.setVisible(true);
        } else {
            standardsDescription.setVisible(false);
        }

        String id = null;
        if (conceptDo.getId() != null) {
            id = conceptDo.getId();
        } else if (conceptDo.getGooruOid() != null) {
            id = conceptDo.getGooruOid();
        }
        if (id != null) {
            collectionInfo.setVisible(true);
            resourcesInside.setVisible(true);
            noCollectionLbl.setVisible(false);

            try {
                collectionImage
                        .setUrl(StringUtil.formThumbnailName(conceptDo.getThumbnails().getUrl(), "-160x120."));
                collectionImage.addErrorHandler(new ErrorHandler() {
                    @Override
                    public void onError(ErrorEvent event) {
                        collectionImage.setUrl(DEFAULT_COLLECTION_IMAGE);
                    }
                });
                if (imageHandler != null) {
                    imageHandler.removeHandler();
                }
                if (titleHandler != null) {
                    titleHandler.removeHandler();
                }
                imageHandler = collectionImage.addClickHandler(new CollectionOpenClickHandler(lessonId));
                titleHandler = collectionTitleLbl.addClickHandler(new CollectionOpenClickHandler(lessonId));
            } catch (Exception e) {
                collectionImage.setUrl(DEFAULT_COLLECTION_IMAGE);
            }

            try {
                collectionTitleLbl.setHTML(conceptDo.getTitle());
                String description = conceptDo.getGoals();
                if (description != null && description.length() >= 97) {
                    String browesr = BrowserAgent.getWebBrowserClient();
                    if (browesr.contains("chrome") || browesr.contains("safari")) {
                        description = description.substring(0, 97) + "...";
                    } else {
                        description = description.substring(0, 85) + "...";
                    }
                }
                collectionDescriptionLbl.setHTML(description);
            } catch (Exception ex) {

            }
            setMetaDataInfo(conceptDo);
            resourcesInside.clear();
            ArrayList<LibraryCollectionItemDo> libraryResources = conceptDo.getCollectionItems();
            if (libraryResources != null) {
                int resourceCount = libraryResources.size();
                int resources = resourceCount <= 4 ? resourceCount : 4;
                final Label resourceCountLbl = new Label(resources + " " + GL_GRR_OF + " " + GL_GRR_THE + " "
                        + resourceCount + " " + GL1094.toLowerCase());
                resourcesInside.add(resourceCountLbl);
                for (int i = 0; i < resources; i++) {
                    try {
                        final LibraryCollectionItemDo libraryItem = libraryResources.get(i);
                        final LibraryResourceDo libraryResourceDo = libraryItem.getResource();

                        String categoryString = "";
                        if (libraryResourceDo.getCategory() != null) {
                            categoryString = libraryResourceDo.getCategory();
                        } else if (libraryResourceDo.getResourceFormat() != null) {
                            categoryString = libraryResourceDo.getResourceFormat().getDisplayName();
                        }

                        final String category = categoryString;
                        final HTMLEventPanel resourcePanel = new HTMLEventPanel("");
                        resourcePanel.setStyleName(libraryStyle.resourceImage());

                        final Image resourceImage = new Image();
                        resourceImage.setWidth("80px");
                        resourceImage.setHeight("60px");
                        try {
                            String resourceTitle = libraryResourceDo.getTitle().replaceAll("\\<[^>]*>", "");
                            libraryResourceDo.setTitle(resourceTitle);
                        } catch (Exception e) {
                        }
                        resourceImage.setAltText(libraryResourceDo.getTitle());
                        resourceImage.setTitle(libraryResourceDo.getTitle());

                        final String categoryImage = categoryString;

                        String sourceAttribution = "";
                        if (libraryResourceDo.getResourceSource() != null
                                && libraryResourceDo.getResourceSource().getAttribution() != null) {
                            sourceAttribution = libraryResourceDo.getResourceSource().getAttribution();
                        }
                        final String attribution = sourceAttribution;
                        resourceImage.addMouseOverHandler(new MouseOverHandler() {

                            @Override
                            public void onMouseOver(MouseOverEvent event) {
                                toolTipPopupPanel.clear();
                                toolTipPopupPanel.setWidget(new LibraryTopicCollectionToolTip(
                                        libraryResourceDo.getTitle(), categoryImage, attribution));
                                toolTipPopupPanel.setStyleName("");
                                toolTipPopupPanel.setPopupPosition(
                                        event.getRelativeElement().getAbsoluteLeft() - 2,
                                        event.getRelativeElement().getAbsoluteTop() + 55);
                                toolTipPopupPanel.show();
                            }
                        });

                        resourceImage.addMouseOutHandler(new MouseOutHandler() {

                            @Override
                            public void onMouseOut(MouseOutEvent event) {
                                toolTipPopupPanel.hide();
                            }
                        });
                        try {
                            if (libraryResourceDo.getResourceType() != null && libraryResourceDo
                                    .getResourceType().getName().equalsIgnoreCase("video/youtube")) {
                                String youTubeIbStr = ResourceImageUtil
                                        .getYoutubeVideoId(libraryResourceDo.getUrl());
                                String thumbnailUrl = ResourceImageUtil.youtubeImageLink(youTubeIbStr,
                                        Window.Location.getProtocol());
                                resourceImage.setUrl(thumbnailUrl);
                            } else {
                                resourceImage.setUrl(libraryResourceDo.getThumbnails().getUrl());
                            }
                            resourceImage.addErrorHandler(new ErrorHandler() {
                                @Override
                                public void onError(ErrorEvent event) {
                                    resourceImage.setUrl(DEFULT_IMAGE_PREFIX
                                            + getDetaultResourceImage(category.toLowerCase()) + PNG);
                                }
                            });
                        } catch (Exception e) {
                            resourceImage.setUrl(DEFULT_IMAGE_PREFIX
                                    + getDetaultResourceImage(category.toLowerCase()) + PNG);
                            resourceImage.setAltText(libraryResourceDo.getTitle());
                            resourceImage.setTitle(libraryResourceDo.getTitle());
                        }

                        resourcePanel.addClickHandler(new ClickHandler() {
                            @Override
                            public void onClick(ClickEvent event) {
                                String page = AppClientFactory.getPlaceManager().getRequestParameter(PAGE,
                                        "landing");
                                if (page.equals(COURSE_PAGE)) {
                                    MixpanelUtil.mixpanelEvent("CoursePage_Plays_Resource");
                                } else {
                                    MixpanelUtil.mixpanelEvent("LandingPage_Plays_Resource");
                                }
                                Map<String, String> params = new HashMap<String, String>();
                                params.put("id", conceptDo.getGooruOid());

                                String resourceId = libraryItem.getCollectionItemId();
                                if (resourceId == null) {
                                    resourceId = libraryResourceDo.getCollectionItemId();
                                }
                                params.put("rid", resourceId);
                                params.put("subject", AppClientFactory.getPlaceManager()
                                        .getRequestParameter("subject", "featured"));
                                params.put("lessonId", lessonId);
                                if (getPlaceToken().equals(PlaceTokens.RUSD_LIBRARY)) {
                                    params.put("library", getPlaceToken());
                                }
                                String standardId = AppClientFactory.getPlaceManager()
                                        .getRequestParameter(STANDARD_ID);
                                if (standardId != null) {
                                    params.put("rootNodeId", standardId);
                                }

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

                        final HTMLPanel resourceCategoryIcon = new HTMLPanel("");
                        resourceCategoryIcon.addStyleName(UcCBundle.INSTANCE.css().resourceName());
                        resourceCategoryIcon
                                .addStyleName(getDetaultResourceImage(category.toLowerCase()) + SMALL);
                        resourcePanel.add(resourceImage);
                        resourcePanel.add(resourceCategoryIcon);
                        resourcesInside.add(resourcePanel);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
        } else {
            collectionInfo.setVisible(false);
            resourcesInside.setVisible(false);
            noCollectionLbl.setVisible(true);
        }
    }
    loadingImage.setVisible(false);
    collectionViewer.setVisible(true);
}

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

License:Open Source License

public void setReplyLink() {
    Anchor resourceAnchor = new Anchor();
    resourceAnchor.setHref(getReplayLink());
    resourceAnchor.setStyleName("");
    HTMLPanel collectionHTMLPanel = new HTMLPanel("");
    resourceAnchor.addClickHandler(new ReplayCollectionEvent());
    collectionHTMLPanel.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().collectionreplay());
    Label collectionReplayButton = new Label(i18n.GL0632());
    collectionReplayButton.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().collectionreplayText());
    collectionHTMLPanel.add(collectionReplayButton);
    resourceAnchor.getElement().appendChild(collectionHTMLPanel.getElement());
    //thumbnailContainer.clear();
    //thumbnailContainer.add(resourceAnchor);
}

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

License:Open Source License

public void setReplyLink() {
    Anchor resourceAnchor = new Anchor();
    resourceAnchor.setHref(getReplayLink());
    resourceAnchor.setStyleName("");
    HTMLPanel collectionHTMLPanel = new HTMLPanel("");
    resourceAnchor.addClickHandler(new ReplayCollectionEvent());
    collectionHTMLPanel.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().collectionreplay());
    Label collectionReplayButton = new Label(GL0632);
    collectionReplayButton.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().collectionreplayText());
    collectionHTMLPanel.add(collectionReplayButton);
    resourceAnchor.getElement().appendChild(collectionHTMLPanel.getElement());
    thumbnailContainer.clear();/*from   ww w  .j  av a2s . co m*/
    thumbnailContainer.add(resourceAnchor);
}

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

License:Open Source License

/**
 * //from   ww w.j a v  a 2  s . c om
 */
public AssignPopupPlayerVc(String collectionIdVal) {
    super(false);

    res = AssignPopUpCBundle.INSTANCE;
    AssignPopUpCBundle.INSTANCE.css().ensureInjected();
    add(uiBinder.createAndBindUi(this));
    this.setGlassEnabled(true);
    donothaveAccountText.getElement().setInnerHTML(GL0634);
    donothaveAccountText.getElement().setAttribute("style", "float: left;margin-left: 22%;");
    ancSignUp.setText(GL0207 + GL_SPL_EXCLAMATION);
    swithUrlLbl.setText(GL0639);
    swithToEmbedLbl.setText(GL0640);
    ancSignUp.getElement().setAttribute("style", "float: left;margin-left: 2%;");

    setLabelsAndIds();
    setHandlers();

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

    htmlLoginPanel.setVisible(false);

    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) {
                        MixpanelUtil.Preview_Click_Assign_successful();
                        String collectionId = "";
                        if (result.getGooruOid() != null) {
                            collectionId = result.getGooruOid();
                        } else {
                            collectionId = "4b4bb39d-2892-4dd6-bd7f-5fd1227751de";
                        }
                        toAssignStr = collectionId;
                        if (collectionId != null) {
                            collectionDoGlobal = result;
                            if (AppClientFactory.isAnonymous()) {
                                hideContainers();
                            } else {
                                loadListContainers();
                            }
                            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.play.collection.preview.home.PreviewHomeView.java

License:Open Source License

public void setReplyLink() {
    Anchor resourceAnchor = new Anchor();
    resourceAnchor.setHref(getReplayLink());
    resourceAnchor.setStyleName("");
    resourceAnchor.addClickHandler(new ReplayCollectionEvent());
    HTMLPanel collectionHTMLPanel = new HTMLPanel("");
    collectionHTMLPanel.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().collectionreplay());

    Label collectionReplayButton = new Label(GL0632);
    collectionReplayButton.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().collectionreplayText());

    collectionHTMLPanel.add(collectionReplayButton);

    resourceAnchor.getElement().appendChild(collectionHTMLPanel.getElement());
    thumbnailContainer.clear();//www . java  2 s . co  m
    thumbnailContainer.add(resourceAnchor);
}

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

License:Open Source License

/**
 * //from  www.  j av a 2s. co  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.play.collection.preview.metadata.PreviewPlayerMetadataView.java

License:Open Source License

/**
 * @function deleteComment /*w  w  w .  jav a2 s .  c o m*/
 * 
 * @created_date : 03-Jan-2014
 * 
 * @description
 * 
 * @parm(s) : @param commentUid
 * 
 * @return : void
 *
 * @throws : <Mentioned if any exceptions>
 *
 */
private void deleteComment(final String commentUid) {
    Iterator<Widget> widgets = commentsContainer.iterator();
    while (widgets.hasNext()) {
        Widget widget = widgets.next();
        if (widget instanceof CommentWidgetChildView
                && ((CommentWidgetChildView) widget).getCommentUid().equals(commentUid)) {
            CommentWidgetChildView commentWidgetChildView = ((CommentWidgetChildView) widget);
            int index = commentsContainer.getWidgetIndex(commentWidgetChildView);
            commentsContainer.remove(index);
            final HTMLPanel deletePanel = new HTMLPanel(GL0555);
            deletePanel.setStyleName(playerStyle.deleteMsg());
            commentsContainer.insert(deletePanel, index);
            new FadeInAndOut(deletePanel.getElement(), 1000);
            Timer timer = new Timer() {
                @Override
                public void run() {
                    int deleteIndex = commentsContainer.getWidgetIndex(deletePanel);
                    commentsContainer.remove(deleteIndex);
                    getUiHandlers().deleteCommentFromCollection(collectionDo.getGooruOid(), commentUid,
                            commentsContainer.getWidgetCount() + "", 1 + "");
                }
            };
            timer.schedule(1000);
            totalHitCount += DECREMENT_BY_ONE;
            setCommentsText(DECREMENT_BY_ONE);
        }
    }
}

From source file:org.ednovo.gooru.client.mvp.play.collection.share.email.PrintSummaryPage.java

License:Open Source License

private void setOeQuestionsData(int i, String questionText, String questionAnswer) {
    final HTMLPanel oeQuestionDiv = new HTMLPanel("");
    final Label oeQuestionNumber = new Label("" + (i + 1));
    questionText = questionText.replaceAll("</p>", " ").replaceAll("<p>", "")
            .replaceAll("<br data-mce-bogus=\"1\">", "").replaceAll("<br>", "").replaceAll("</br>", "");
    final HTML oeQuestionSummary = new HTML(questionText);
    final HTML oeQuestionAnswer = new HTML(questionAnswer);
    oeQuestionDiv.getElement().setAttribute("style", cp0015);
    oeQuestionNumber.getElement().setAttribute("style", cp0017);
    oeQuestionSummary.getElement().setAttribute("style", cp0018);
    oeQuestionAnswer.getElement().setAttribute("style", cp0019);
    oeQuestionDiv.add(oeQuestionNumber);
    oeQuestionDiv.add(oeQuestionSummary);
    oeQuestionDiv.add(oeQuestionAnswer);
    //oeQuestionDiv.getElement().setAttribute("style",PlayerMessageProperties.cp0016);
    oeQuestionsBox.add(oeQuestionDiv);/* ww  w.j a va2s.c  o  m*/
}