public void makeFlagButtonActive() {
   String button = getFlagButton().getElement().getAttribute("button");
   if (button != null && button.equalsIgnoreCase("active")) {
     if (getFlagButton()
         .getStyleName()
         .contains(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrangeActive())) {
       getFlagButton()
           .removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrangeActive());
       getFlagButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrange());
     } else {
       getFlagButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonActive());
       getFlagButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonNormal());
     }
     getFlagButton().getElement().removeAttribute("button");
   } else {
     if (getFlagButton()
         .getStyleName()
         .contains(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrange())) {
       getFlagButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrange());
       getFlagButton()
           .addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrangeActive());
     } else {
       getFlagButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonNormal());
       getFlagButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonActive());
     }
     getFlagButton().getElement().setAttribute("button", "active");
   }
 }
 public void deselectInfoButton() {
   String button = getInfoButton().getElement().getAttribute("button");
   if (button != null && button.equalsIgnoreCase("active") && isInfoButtonEnabled()) {
     getInfoButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().infoButtonActive());
     getInfoButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().infoButtonNormal());
     getInfoButton().getElement().removeAttribute("button");
   }
 }
 public void deselectShareButton() {
   String shareButtonVal = getShareButton().getElement().getAttribute("button");
   if (shareButtonVal != null
       && shareButtonVal.equalsIgnoreCase("active")
       && isShareButtonEnabled()) {
     getShareButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().shareButtonActive());
     getShareButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().shareButtonNormal());
     getShareButton().getElement().removeAttribute("button");
   }
 }
 /**
  * @function getResourceDefaultImage
  * @created_date : Jan 2, 2014
  * @description
  * @parm(s) : @param resourceType
  * @parm(s) : @return
  * @return : String
  * @throws : <Mentioned if any exceptions>
  */
 public String getResourceDefaultImage(String resourceType) {
   if (resourceType.equalsIgnoreCase("Video")) {
     return PlayerBundle.INSTANCE.getPlayerStyle().videoResourceDefault();
   } else if (resourceType.equalsIgnoreCase("Interactive")) {
     return PlayerBundle.INSTANCE.getPlayerStyle().interactiveResourceDefault();
   } else if (resourceType.equalsIgnoreCase("Website")
       || resourceType.equalsIgnoreCase("Webpage")
       || resourceType.equalsIgnoreCase("Exam")
       || resourceType.equalsIgnoreCase("Challenge")) {
     return PlayerBundle.INSTANCE.getPlayerStyle().websiteResourceDefault();
   } else if (resourceType.equalsIgnoreCase("Slide") || resourceType.equalsIgnoreCase("Image")) {
     return PlayerBundle.INSTANCE.getPlayerStyle().imageResourceDefault();
   } else if (resourceType.equalsIgnoreCase("Textbook")
       || resourceType.equalsIgnoreCase("lesson")
       || resourceType.equalsIgnoreCase("Handout")
       || resourceType.equalsIgnoreCase("Text")) {
     return PlayerBundle.INSTANCE.getPlayerStyle().textResourceDefault();
   } else if (resourceType.equalsIgnoreCase("Question")) {
     return PlayerBundle.INSTANCE.getPlayerStyle().questionResourceDefault();
   } else if (resourceType.equalsIgnoreCase("Audio")) {
     return PlayerBundle.INSTANCE.getPlayerStyle().audioResourceDefault();
   } else if (resourceType.equalsIgnoreCase("Other")) {
     return PlayerBundle.INSTANCE.getPlayerStyle().otherResourceDefault();
   } else {
     return PlayerBundle.INSTANCE.getPlayerStyle().websiteResourceDefault();
   }
 }
 public void makeShareButtonActive() {
   String button = getShareButton().getElement().getAttribute("button");
   if (button != null && button.equalsIgnoreCase("active")) {
     getShareButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().shareButtonActive());
     getShareButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().shareButtonNormal());
     getShareButton().getElement().removeAttribute("button");
   } else {
     getShareButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().shareButtonNormal());
     getShareButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().shareButtonActive());
     getShareButton().getElement().setAttribute("button", "active");
   }
 }
 public void enableFlagButton(boolean isFlagButtonEnable) {
   setFlagButtonEnabled(isFlagButtonEnable);
   getFlagButton().getElement().removeAttribute("button");
   if (isFlagButtonEnable) {
     getFlagButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonDisable());
     getFlagButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonActive());
     getFlagButton()
         .removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrangeActive());
     getFlagButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrange());
     getFlagButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonNormal());
   } else {
     getFlagButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonActive());
     getFlagButton()
         .removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().navigationButtonNormal());
     getFlagButton()
         .removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrangeActive());
     getFlagButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrange());
     getFlagButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonDisable());
   }
 }
 public void enableInfoButton(boolean isInfoButtonEnable) {
   setInfoButtonEnabled(isInfoButtonEnable);
   getInfoButton().getElement().removeAttribute("button");
   if (isInfoButtonEnable) {
     getInfoButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().infoButtonDisabled());
     getInfoButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().infoButtonActive());
     getInfoButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().infoButtonNormal());
   } else {
     getInfoButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().infoButtonActive());
     getInfoButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().infoButtonNormal());
     getInfoButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().infoButtonDisabled());
   }
 }
 public void deselectFlagButton() {
   String flagButtonVal = getFlagButton().getElement().getAttribute("button");
   if (flagButtonVal != null
       && flagButtonVal.equalsIgnoreCase("active")
       && isFlagButtonEnabled()) {
     if (getFlagButton()
             .getStyleName()
             .contains(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrangeActive())
         || getFlagButton()
             .getStyleName()
             .contains(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrange())) {
       getFlagButton()
           .removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrangeActive());
       getFlagButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrange());
     } else {
       getFlagButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonActive());
       getFlagButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonNormal());
     }
     getFlagButton().getElement().removeAttribute("button");
   }
 }
  /** @param collectionItemDo */
  @UiConstructor
  public ResourceFrameBreakerView(final CollectionItemDo collectionItemDo, boolean isGoogleFile) {
    initWidget(uiBinder.createAndBindUi(this));
    PlayerBundle.INSTANCE.getPlayerStyle().ensureInjected();
    this.collectionItemDo = collectionItemDo;
    if (!isGoogleFile) {
      setLabelsAndIds();
      supportTip.setStyleName(PlayerBundle.INSTANCE.getPlayerStyle().supportTip());
      supportTip.setText(i18n.GL1453());
      supportTip.getElement().setId("lblSupportTip");
      supportTip.getElement().setAttribute("alt", i18n.GL1453());
      supportTip.getElement().setAttribute("title", i18n.GL1453());
      btnResourceLink.addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().btnResourceLink());
    } else {
      btnResourceLink.removeFromParent();
    }
    imgFieldTrip.setUrl(collectionItemDo.getResource().getThumbnailUrl());
    if (collectionItemDo.getResource().getResourceFormat() != null) {
      defaultResourceCategory = collectionItemDo.getResource().getResourceFormat().getDisplayName();
    }
    if (defaultResourceCategory != null) {
      if (defaultResourceCategory.equalsIgnoreCase("Lesson")
          || defaultResourceCategory.equalsIgnoreCase("Textbook")
          || defaultResourceCategory.equalsIgnoreCase("Handout")) {
        defaultResourceCategory =
            defaultResourceCategory
                .replaceAll("Lesson", "Text")
                .replaceAll("Textbook", "Text")
                .replaceAll("Handout", "Text")
                .replaceAll("lesson", "Text")
                .replaceAll("textbook", "Text")
                .replaceAll("handout", "Text");
      }
      if (defaultResourceCategory.equalsIgnoreCase("Slide")) {
        defaultResourceCategory =
            defaultResourceCategory.replaceAll("Slide", "Image").replaceAll("slide", "Image");
      }
      if (defaultResourceCategory.equalsIgnoreCase("Exam")
          || defaultResourceCategory.equalsIgnoreCase("Challenge")
          || defaultResourceCategory.equalsIgnoreCase("Website")) {
        defaultResourceCategory =
            defaultResourceCategory
                .replaceAll("Exam", "Webpage")
                .replaceAll("Challenge", "Webpage")
                .replaceAll("exam", "Webpage")
                .replaceAll("challenge", "Webpage");
      }
    }
    imgFieldTrip.addErrorHandler(
        new ErrorHandler() {

          @Override
          public void onError(ErrorEvent event) {
            imgFieldTrip.setUrl(DEFULT_IMAGE_PREFIX + defaultResourceCategory.toLowerCase() + PNG);
          }
        });
    if (collectionItemDo.getResource().getResourceFormat() != null) {
      resourceCategory.addStyleName(
          getResourceTypeImage(
              collectionItemDo.getResource().getResourceFormat().getDisplayName()));
    }
  }
 /*
  * Default constructor
  */
 public ResourceFrameBreakerView() {
   initWidget(uiBinder.createAndBindUi(this));
   PlayerBundle.INSTANCE.getPlayerStyle().ensureInjected();
   setLabelsAndIds();
 }
 public ResourcePlayerHeaderView() {
   initWidget(uiBinder.createAndBindUi(this));
   PlayerBundle.INSTANCE.getPlayerStyle().ensureInjected();
 }
 public void makeFlagButtonOrange() {
   getFlagButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonActive());
   getFlagButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonNormal());
   getFlagButton().removeStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonDisable());
   getFlagButton().addStyleName(PlayerBundle.INSTANCE.getPlayerStyle().flagButtonOrange());
 }