Esempio n. 1
0
  public void createUI() {

    setHTML("Addon Id: " + module.getAddonId());
    setStyleName("addon_" + module.getAddonId());
    StyleUtils.applyInlineStyle(this, module);

    if (!module.isVisible()) {
      DOM.setStyleAttribute(getElement(), "visibility", "hidden");
    }
    getElement().setId(module.getId());
  }
Esempio n. 2
0
  private Widget createInnerButton(IPlayerServices playerServices) {

    Widget button = null;

    IPlayerCommands pageService = null;
    if (playerServices != null) {
      pageService = playerServices.getCommands();
    }

    ButtonType type = module.getType();

    if (ButtonType.checkAnswers == type) {
      button = new CheckAnswersButton(playerServices);
    } else if (ButtonType.cancel == type) {
      button = new ClosePopupButton(pageService);
    } else if (ButtonType.nextPage == type) {
      button = new NextPageButton(playerServices);
    } else if (ButtonType.popup == type) {
      button =
          new PopupButton(module.getOnClick(), this, pageService, module.getAdditionalClasses());
    } else if (ButtonType.prevPage == type) {
      button = new PrevPageButton(playerServices);
    } else if (ButtonType.gotoPage == type) {
      button = new GotoPageButton(module.getOnClick(), module.getPageIndex(), playerServices);
    } else if (ButtonType.reset == type) {
      button = new ResetButton(pageService);
    } else {
      button = new StandardButton(module, playerServices);
    }

    if (button instanceof ButtonBase) {
      ButtonBase pushButton = (ButtonBase) button;
      StyleUtils.applyInlineStyle(pushButton, module);

      pushButton.setText(module.getText());
    }

    if (playerServices != null) {
      button.setVisible(module.isVisible());
    }

    return button;
  }