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.assessments.play.collection.info.AssessmentsResourceView.java

License:Open Source License

private HTMLPanel getCourseNames() {
    HTMLPanel cousreContainer = new HTMLPanel("");
    List<String> coursesList = resourceSearchResultDo.getCourseNames();
    if (coursesList != null && coursesList.size() > 0) {
        Label courseName = new Label(coursesList.get(0));
        courseName.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().getCourseTitle());
        cousreContainer.add(courseName);
        if (coursesList.size() > 1) {
            Label courseCount = new Label("+" + (coursesList.size() - 1));
            courseCount.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().getCourseCount());
            cousreContainer.add(courseCount);
            Widget Coursewidget = getToolTipwidgets(coursesList);
            courseCount.addMouseOverHandler(new MouseOverShowToolTip(Coursewidget));
            courseCount.addMouseOutHandler(new MouseOutHideToolTip());
        }/*from   w  w  w  . ja v a2  s . c  o  m*/
        cousreContainer.add(getSeparator());
    }
    return cousreContainer;
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.collection.info.AssessmentsResourceView.java

License:Open Source License

private HTMLPanel getSeparator() {
    HTMLPanel separator = new HTMLPanel(SEPARATOR);
    separator.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().sourceSepartor());
    return separator;
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.collection.preview.end.AssessmentsPreviewEndView.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();/*from  w ww  .ja v  a2 s  .com*/
    thumbnailContainer.add(resourceAnchor);
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.collection.preview.home.AssessmentsPreviewHomeView.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(i18n.GL0632());
    collectionReplayButton.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().collectionreplayText());

    collectionHTMLPanel.add(collectionReplayButton);

    resourceAnchor.getElement().appendChild(collectionHTMLPanel.getElement());
    thumbnailContainer.clear();/*from  ww w .  j  a v  a 2  s .c o m*/
    thumbnailContainer.add(resourceAnchor);
}

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

License:Open Source License

/**
 *
 *//*from   w w w .  ja va  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(i18n.GL0634());
    donothaveAccountText.getElement().setAttribute("style", "float: left;margin-left: 22%;");
    ancSignUp.setText(i18n.GL0207() + i18n.GL_SPL_EXCLAMATION());

    swithUrlLbl.setText(i18n.GL0639());
    swithToEmbedLbl.setText(i18n.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 SimpleAsyncCallback<CollectionDo>() {
                    @Override
                    public void onSuccess(CollectionDo result) {
                        MixpanelUtil.Preview_Click_Assign_successful();
                        String collectionId = "";
                        if (result.getGooruOid() != null) {
                            collectionId = result.getGooruOid();
                        }
                        toAssignStr = collectionId;
                        if (collectionId != null) {
                            collectionDoGlobal = result;
                            if (AppClientFactory.isAnonymous()) {
                                hideContainers();
                            } else {
                                loadListContainers();
                            }
                            generateShareLink(toAssignStr);
                        }
                        loadingImageLabel.setVisible(false);
                        popupContentAssign.setVisible(true);
                    }
                });
    } catch (Exception ex) {
        AppClientFactory.printSevereLogger("AssignPopupPlayerVc : Constructor : " + ex.getMessage());
    }
    setShareUrlGenerationAsyncCallback(new SimpleAsyncCallback<Map<String, String>>() {
        @Override
        public void onSuccess(Map<String, String> result) {
            if (result.containsKey("decodeRawUrl")) {
                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();
    ScrollPopupUtil.ScrollPopupUtilWidget(assignPopupContent, false);
}

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

License:Open Source License

/**
 *
 *//*w  ww . j ava 2  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(i18n.GL0638());
    sharetext.getElement().setId("pnlSharetext");
    sharetext.getElement().setAttribute("alt", i18n.GL0638());
    sharetext.getElement().setAttribute("title", i18n.GL0638());

    swithUrlLbl.setText(i18n.GL0639());
    swithUrlLbl.getElement().setId("lblSwithUrlLbl");
    swithUrlLbl.getElement().setAttribute("alt", i18n.GL0639());
    swithUrlLbl.getElement().setAttribute("title", i18n.GL0639());

    swithToEmbedLbl.setText(i18n.GL0640());
    swithToEmbedLbl.getElement().setId("lblSwithToEmbedLbl");
    swithToEmbedLbl.getElement().setAttribute("alt", i18n.GL0640());
    swithToEmbedLbl.getElement().setAttribute("title", i18n.GL0640());

    setLabelsAndIds();
    shareContainer = new ShareViewUc("", "");
    ftmPanel = new HTMLPanel("");
    loadingImageLabel.setVisible(true);
    popupContentAssign.setVisible(false);
    try {
        AppClientFactory.getInjector().getClasspageService().getSCollIdClasspageById(collectionIdVal,
                new SimpleAsyncCallback<CollectionDo>() {
                    @Override
                    public void onSuccess(CollectionDo result) {
                        if (result != null) {
                            String collectionId = "";
                            if (result.getGooruOid() != null) {
                                collectionId = result.getGooruOid();
                            }
                            toAssignStr = collectionId;
                            if (collectionId != null) {
                                collectionDoGlobal = result;
                                generateShareLink(toAssignStr);
                            }
                            loadingImageLabel.setVisible(false);
                            popupContentAssign.setVisible(true);
                        }
                    }
                });
    } catch (Exception ex) {
        AppClientFactory.printSevereLogger("SharePlayerVc : Constructor : " + ex.getMessage());
    }
    setShareUrlGenerationAsyncCallback(new SimpleAsyncCallback<Map<String, String>>() {
        @Override
        public void onSuccess(Map<String, String> result) {
            if (result != null && result.size() > 0)
                if (result.containsKey("decodeRawUrl")) {
                    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.setHeight("500px");
    this.show();
    this.center();
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.resource.body.AssessmentsResourcePlayerMetadataView.java

License:Open Source License

@Override
public void displayResourceTags(List<ResourceTagsDo> resourceTagsList) {
    tagsContainer.clear();/*  ww  w  .jav a  2  s . c  o m*/
    if (resourceTagsList != null && resourceTagsList.size() > 0) {
        FlowPanel toolTipwidgets = new FlowPanel();
        for (int i = 0; i < resourceTagsList.size(); i++) {
            if (i < 3) {
                String tagsdefaultLabel = i18n.GL1664() + " : ";
                String tagLabel = resourceTagsList.get(i).getLabel() != null
                        ? resourceTagsList.get(i).getLabel()
                        : "";
                HTMLPanel tagPanel = new HTMLPanel("");
                if (resourceTagsList.get(i).getLabel() != null && resourceTagsList.get(i).getLabel()
                        .toLowerCase().contains(i18n.GL1664().toLowerCase())) {
                    tagLabel = resourceTagsList.get(i).getLabel().toLowerCase()
                            .replace(tagsdefaultLabel.toLowerCase(), "");
                    tagLabel = tagLabel.substring(0, 1).toUpperCase() + tagLabel.substring(1);
                }
                tagPanel.setStyleName("eductaionalUseDesign");
                tagPanel.getElement().setInnerHTML(tagLabel);
                tagsContainer.add(tagPanel);
            } else {
                HTMLPanel tagPanel = new HTMLPanel("");
                String tagsdefaultLabel = i18n.GL1664() + " : ";
                String tagLabel = resourceTagsList.get(i).getLabel() != null
                        ? resourceTagsList.get(i).getLabel()
                        : "";
                if (resourceTagsList.get(i).getLabel() != null && resourceTagsList.get(i).getLabel()
                        .toLowerCase().contains(i18n.GL1664().toLowerCase())) {
                    tagLabel = resourceTagsList.get(i).getLabel().toLowerCase()
                            .replace(tagsdefaultLabel.toLowerCase(), "");
                    tagLabel = tagLabel.substring(0, 1).toUpperCase() + tagLabel.substring(1);
                }
                tagPanel.getElement().setInnerHTML(tagLabel);
                toolTipwidgets.add(tagPanel);
            }
        }
        if (resourceTagsList.size() > 3) {
            DownToolTipWidgetUc toolTipUc = new DownToolTipWidgetUc(
                    new Label("+" + (resourceTagsList.size() - 3)), toolTipwidgets);
            toolTipUc.setStyleName("educationalUseMoretags");
            tagsContainer.add(toolTipUc);
        }

    }
}

From source file:org.ednovo.gooru.client.mvp.assessments.play.resource.body.FlashAndVideoPlayerWidget.java

License:Open Source License

public FlashAndVideoPlayerWidget(String resourceUrl, String videoStartTime, String videoEndTime) {
    int startTimeInSeconds = 0;
    int endTimeInSeconds = 0;
    String startTimeEndTime = "";
    if (videoStartTime == null && videoEndTime == null) {
        startTimeEndTime = "start=0&end=0;";
    }//from w  w w.  jav a2 s  .com
    if (videoStartTime != null) {
        startTimeInSeconds = getStartOrEndTime(videoStartTime);
        startTimeEndTime = "start=" + startTimeInSeconds;
    }
    if (videoEndTime != null) {
        endTimeInSeconds = getStartOrEndTime(videoEndTime);
        startTimeEndTime = startTimeEndTime + "&end=" + endTimeInSeconds + ";";
    }
    int windowHeight = Window.getClientHeight();
    if (AppClientFactory.getCurrentPlaceToken().equalsIgnoreCase(PlaceTokens.RESOURCE_PLAY)) {
        windowHeight = windowHeight - 116;
    } else {
        windowHeight = windowHeight - 193;
    }
    String tabView = AppClientFactory.getPlaceManager().getRequestParameter("tab", null);
    int autoPlay = tabView != null && tabView.equalsIgnoreCase("narration") ? 0 : 1;
    String embeddableHtmlString = null;

    PlaceRequest collectionRequest = AppClientFactory.getPlaceManager().getCurrentPlaceRequest();
    String chkViewParam = collectionRequest.getParameter("view", null);
    if (chkViewParam != null && chkViewParam.equalsIgnoreCase("fullScreen")) {
        windowHeight = windowHeight + 71;
    }

    String sourceUrl = getProtocal() + "//www.youtube.com/v/" + resourceUrl + "?" + startTimeEndTime
            + "rel=0&amp;enablejsapi=1&amp;version=3&amp;autoplay=0&amp;start=1";
    String sourceUrl1 = getProtocal() + "//www.youtube.com/embed/" + resourceUrl + "?" + startTimeEndTime
            + "rel=0&amp;enablejsapi=1&amp;version=3&amp;autoplay=0&amp;start=1";

    if (BrowserAgent.isDevice()) {
        embeddableHtmlString = "<iframe id=\"playerid\" src=\"" + sourceUrl1
                + "\" frameborder=\"0\" allowfullscreen=\"\" style=\"width:100%;height:" + windowHeight
                + "px\"></iframe>";
    } else {
        embeddableHtmlString = "<embed id=\"playerid\" type=\"application/x-shockwave-flash\" src=\""
                + sourceUrl + "\"" + " width=\"100%\" height=\"" + windowHeight
                + "px\" quality=\"high\" allowfullscreen=\"true\" allowscriptaccess=\"always\" autoplay=\"0\" wmode=\"transparent\">";
    }

    HTMLPanel resourcePreviewPanel = new HTMLPanel(embeddableHtmlString);
    resourcePreviewPanel.setStyleName("resourcePreviewWebResourceContainer");
    resourcePreviewPanel.setSize("100%", windowHeight + "px");
    resourcePreviewPanel.getElement().getStyle().setPosition(Position.RELATIVE);
    initWidget(resourcePreviewPanel);

}

From source file:org.ednovo.gooru.client.mvp.authentication.uc.SignupCourseLabel.java

License:Open Source License

/**
 * Class constructor/*from  w ww.j a va 2s  .  c o m*/
 * @param label name of the {@link Label}
 * @param collectionDo instance of {@link CollectionDo}
 */
public SignupCourseLabel(int codeId, String codeName, ProfileDo profileDo, String imageUrl,
        final String subjectName) {
    SignUpCBundle.INSTANCE.css().ensureInjected();
    addDomHandler(this, ClickEvent.getType());
    this.profileDo = profileDo;
    this.addStyleName(SignUpCBundle.INSTANCE.css().courseOption());

    final Image courseImage = new Image(imageUrl);
    courseImage.setAltText(codeName);
    courseImage.setTitle(codeName);
    courseImage.addErrorHandler(new ErrorHandler() {

        @Override
        public void onError(ErrorEvent event) {
            if (subjectName.equalsIgnoreCase(SCIENCE_LBL)) {
                courseImage.setUrl("images/course/" + SCIENCE_LBL.replaceAll(" ", "_") + "-default-course.gif");
            } else if (subjectName.equalsIgnoreCase(MATH_LBL)) {
                courseImage.setUrl("images/course/" + MATH_LBL.replaceAll(" ", "_") + "-default-course.gif");
            } else if (subjectName.equalsIgnoreCase(SOCIAL_LBL)) {
                courseImage.setUrl("images/course/" + SOCIAL_LBL.replaceAll(" ", "_") + "-default-course.gif");
            } else if (subjectName.equalsIgnoreCase(ELA_LBL)) {
                courseImage.setUrl("images/course/" + ELA_LBL.replaceAll(" ", "_") + "-default-course.gif");
            } else {
                courseImage.setUrl("images/course/default-course.png");
            }

        }
    });

    this.add(courseImage);
    HTMLPanel coursePanel = new HTMLPanel("");
    coursePanel.addStyleName(SignUpCBundle.INSTANCE.css().title());

    codeName = codeName.contains("English Language Arts") ? codeName.replaceAll("English Language Arts", "ELA")
            : codeName;
    Label courseLabel = new Label(
            codeName.trim().length() >= 20 ? codeName.trim().substring(0, 17) + "..." : codeName.trim());
    courseLabel.addStyleName(SignUpCBundle.INSTANCE.css().verticallyCentered());
    coursePanel.add(courseLabel);
    this.add(coursePanel);

    setCodeDo(codeId);
}

From source file:org.ednovo.gooru.client.mvp.authentication.uc.SignUpGradeCourseView.java

License:Open Source License

public SignUpGradeCourseView(UserDo userDo) {
    this.userDo = userDo;
    SignUpCBundle.INSTANCE.css().ensureInjected();
    setWidget(uiBinder.createAndBindUi(this));
    signupBgPanel.setWidth("700px");
    metaDataSelectionPanel.getElement().getStyle().setPadding(15, Unit.PX);
    lblTitle.setText(GL0186 + GL_SPL_EXCLAMATION);
    scienceCourseContainer = new HTMLPanel("");
    mathCourseContainer = new HTMLPanel("");
    socialCourseContainer = new HTMLPanel("");
    elaCourseContainer = new HTMLPanel("");

    //      artsHumanitiesContainer = new HTMLPanel("");
    //      techologyEngineeringContainer = new HTMLPanel("");

    imgLoading.setVisible(true);/*from  w  w  w.j av a 2  s.  co m*/
    imgLoading.setUrl("images/core/B-Dot.gif");

    setRegisterGradeList();
    setRegisterCourseList();

    lblErrorMessage.setVisible(false);
    lblErrorMessage.setText(GL0500);
    lblErrorMessage.getElement().getStyle().clearMarginLeft();
    lblErrorMessage.getElement().getStyle().clearWidth();
    lblErrorMessage.getElement().getStyle().setFloat(Float.RIGHT);
    lblErrorMessage.getElement().getStyle().setFontStyle(FontStyle.ITALIC);
    lblErrorMessage.getElement().getStyle().setWidth(205, Unit.PX);
    Window.enableScrolling(false);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(98, false));
    this.setGlassEnabled(true);
    this.removeStyleName("gwt-PopupPanel");
    // this.getElement().getStyle().setZIndex(99999);
    this.addStyleName(SignUpCBundle.INSTANCE.css().popupBackground());
    this.setGlassStyleName(SignUpCBundle.INSTANCE.css().signUpPopUpGlassCss());
    this.show();
    this.center();
    congratsLbl.getElement().setInnerHTML(GL1159 + GL_SPL_EXCLAMATION);
    accountCreatedText.getElement().setInnerHTML(GL1160);
    imgLoading.setAltText(GL0110);
    imgLoading.setTitle(GL0110);
    skipBtn.setText(GL1004);
    submitBtn.setText(GL0486);
}