Ejemplo n.º 1
0
 public void setResourcePlayLink() {
   Anchor resourceAnchor = new Anchor();
   resourceAnchor.setHref(getResourceLink());
   resourceAnchor.setStyleName("");
   resourceAnchor.getElement().appendChild(resourceImageContainer.getElement());
   resourceThumbContainer.insert(resourceAnchor, 0);
 }
Ejemplo n.º 2
0
  public DeviceUc(SimplePanel wrapperPanel, HeaderUc headerUc) {
    initWidget(uiBinder.createAndBindUi(this));
    this.headerUc = headerUc;
    this.wrapperPanel = wrapperPanel;

    androidSectiondiv.getElement().setId("pnlAndroidSectiondiv");
    ipadSectiondiv.getElement().setId("pnlIpadSectiondiv");

    msglinkPanel.getElement().setId("pnlMsglinkPanel");
    msgPanel.getElement().setId("pnlMsgPanel");
    closeAndriodBtn.getElement().setId("imgCloseAndriodBtn");

    closeIpadBtn.getElement().setId("imgCloseIpadBtn");
    gooruPanel.getElement().setId("pnlGooruPanel");
    ednovoPanel.getElement().setId("pnlEdnovoPanel");
    appstorePanel.getElement().setId("pnlAppstorePanel");
    viewAnchor.getElement().setId("lnkViewAnchor");

    setUiText();

    if (isIpad && !StringUtil.IPAD_MESSAGE_Close_Click) {
      ipadSectiondiv.setVisible(true);
      androidSectiondiv.setVisible(false);
      ipadSectiondiv.getElement().setAttribute("style", "margin-top:-20px;");
      wrapperPanel.getElement().setAttribute("style", "margin-top:0px;");
      headerUc.getElement().getFirstChildElement().setAttribute("style", "position:relative;");
    } else if (isAndriod && !StringUtil.IPAD_MESSAGE_Close_Click) {
      ipadSectiondiv.setVisible(false);
      androidSectiondiv.setVisible(true);
      androidSectiondiv.getElement().setAttribute("style", "margin-top:-20px;");
      wrapperPanel.getElement().setAttribute("style", "margin-top:0px;");
      headerUc.getElement().getFirstChildElement().setAttribute("style", "position:relative;");
    }
  }
Ejemplo n.º 3
0
  @Inject
  public AddCollectionView() {
    setWidget(uiBinder.createAndBindUi(this));
    hideText.setText(i18n.GL0592());
    hideText.getElement().setId("lblHideText");
    hideText.getElement().setAttribute("alt", i18n.GL0592());
    hideText.getElement().setAttribute("title", i18n.GL0592());

    addcollectionText.getElement().setInnerHTML(i18n.GL0690());
    addcollectionText.getElement().setId("pnlAddcollectionText");
    addcollectionText.getElement().setAttribute("alt", i18n.GL0690());
    addcollectionText.getElement().setAttribute("title", i18n.GL0690());

    renameText.setText(i18n.GL0593());
    renameText.getElement().setId("lblRenameText");
    renameText.getElement().setAttribute("alt", i18n.GL0593());
    renameText.getElement().setAttribute("title", i18n.GL0593());

    addToShelfCollectionButton.setText(i18n.GL0590());
    addToShelfCollectionButton.getElement().setId("btnAddToShelfCollectionButton");
    addToShelfCollectionButton.getElement().setAttribute("alt", i18n.GL0590());
    addToShelfCollectionButton.getElement().setAttribute("title", i18n.GL0590());

    collectionAddedSuccessMessageContainer.setVisible(false);
    getAddToShelfCollectionButton().addClickHandler(new OnAddCollectionClick());
    collectionTitleInCoverPage.addKeyUpHandler(new onKeyErrorMsg());
    workSpaceLink.setText(i18n.GL0589());
    workSpaceLink.getElement().setId("lnkWorkSpaceLink");
    workSpaceLink.getElement().setAttribute("alt", i18n.GL0589());
    workSpaceLink.getElement().setAttribute("title", i18n.GL0589());

    addToCollectionWidgetContainer.getElement().setId("pnlAddToCollectionWidgetContainer");
    collectionAddImageContainer.getElement().setId("pnlCollectionAddImageContainer");
    addResourceInsteadLabelContainerInCollectionImage
        .getElement()
        .setId("pnlAddResourceInsteadLabelContainerInCollectionImage");
    collectionAddedSuccessMessageContainer
        .getElement()
        .setId("pnlCollectionAddedSuccessMessageContainer");
    successMessageLabelText.getElement().setId("lblSuccessMessageLabelText");
    addCollectionInsteadLabelContainer.getElement().setId("pnlAddCollectionInsteadLabelContainer");
    collectionTitleInCoverPage.getElement().setId("txtCollectionTitleInCoverPage");
    StringUtil.setAttributes(collectionTitleInCoverPage, true);
    addingLabel.getElement().setId("lblAddingLabel");
    addErrorLabel.getElement().setId("errlblAddErrorLabel");
    hideButton.getElement().setId("epnlHideButton");
  }
Ejemplo n.º 4
0
  @UiConstructor
  public ImageAnchor(String imageUrl) {

    image = new Image(imageUrl);
    image.getElement().getStyle().setBorderStyle(BorderStyle.NONE);
    image.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);

    subtitle = new Label();
    subtitle.setVisible(false);

    anchor = new Anchor();
    initWidget(anchor);
    anchor.setHref("javascript:;");
    anchor.getElement().appendChild(image.getElement());
    anchor.getElement().appendChild(subtitle.getElement());
    // Removes the dotted outline
    anchor.getElement().getStyle().setProperty("outline", "0");
  }
Ejemplo n.º 5
0
  public UserPortalMainTab(TabData tabData, AbstractTabPanel tabPanel) {
    super(tabData, tabPanel);

    root = new HTMLPanel("li", ""); // $NON-NLS-1$ //$NON-NLS-2$
    hyperlink = new Anchor();
    hyperlink
        .getElement()
        .getStyle()
        .setProperty(
            "fontFamily",
            "'Open Sans', Helvetica, Arial, sans-serif !important"); //$NON-NLS-1$ //$NON-NLS-2$
    root.add(hyperlink);
    root.setVisible(true);
    accessible = true;
  }
Ejemplo n.º 6
0
  public ImageAnchorLabel(String text, String imageUrl, TEXT_POSITION position) {

    contentPanel = new FlexTable();
    initWidget(contentPanel);
    contentPanel.setSize("100%", "25px");

    anchor = new Anchor(text);

    image = new Image(imageUrl);
    image.setSize("16px", "16px");

    setOrientation(position);
    anchor.getElement().getStyle().setPadding(3.0, Unit.PX);
    anchor.setStyleName("dashboard-locationPanel-normalText");
  }
Ejemplo n.º 7
0
 /**
  * @function setUiText
  * @created_date : 26-Feb-2015
  * @description
  * @parm(s) :
  * @return : void
  * @throws : <Mentioned if any exceptions>
  */
 public void setUiText() {
   msgPanel.getElement().setInnerHTML(i18n.GL1983());
   msgPanel.getElement().setAttribute("alt", i18n.GL1983());
   msgPanel.getElement().setAttribute("title", i18n.GL1983());
   msglinkPanel.getElement().setInnerHTML(i18n.GL1984());
   msglinkPanel.getElement().setAttribute("alt", i18n.GL1984());
   msglinkPanel.getElement().setAttribute("title", i18n.GL1984());
   gooruPanel.getElement().setInnerHTML(i18n.GL0733());
   gooruPanel.getElement().setAttribute("alt", i18n.GL0733());
   gooruPanel.getElement().setAttribute("title", i18n.GL0733());
   ednovoPanel.getElement().setInnerHTML(i18n.GL1985());
   ednovoPanel.getElement().setAttribute("alt", i18n.GL1985());
   ednovoPanel.getElement().setAttribute("title", i18n.GL1985());
   appstorePanel.getElement().setInnerHTML(i18n.GL1986());
   appstorePanel.getElement().setAttribute("alt", i18n.GL1986());
   appstorePanel.getElement().setAttribute("title", i18n.GL1986());
   viewAnchor.setText(i18n.GL1428());
   viewAnchor.getElement().setAttribute("alt", i18n.GL1428());
   viewAnchor.getElement().setAttribute("title", i18n.GL1428());
 }
 public ExportAsLocalFileDialog(String data) {
   super();
   Button okButton;
   Anchor a;
   String url;
   vp = new VerticalPanel();
   setWidget(vp);
   setText("Export as Local File");
   vp.add(new Label("Click on the link below to save your circuit"));
   url = getBlobUrl(data);
   a = new Anchor("my circuit.txt", url);
   a.getElement().setAttribute("Download", "my circuit.txt");
   vp.add(a);
   vp.add(okButton = new Button("OK"));
   okButton.addClickHandler(
       new ClickHandler() {
         public void onClick(ClickEvent event) {
           closeDialog();
         }
       });
   this.center();
 }
 public MatrixGenerationInputView() {
   super();
   initWidget(uiBinder.createAndBindUi(this));
   fileManagerAnchor.getElement().getStyle().setCursor(Cursor.POINTER);
 }
Ejemplo n.º 10
0
 public void setFontSize(double size, Unit unit) {
   anchor.getElement().getStyle().setFontSize(size, unit);
 }
  /**
   * Create a widget containing text and a link that triggers the execution of a command.
   *
   * @param view the view where the alert should be added
   * @param text the text content of the alert
   * @param commands the command that should be executed when the link is clicked
   */
  private void addTextAndLinkAlert(
      final ViewDef view, final String text, final UICommand... commands) {
    // Create a flow panel containing the text and the link:
    final FlowPanel alertPanel = new FlowPanel();
    int start = 0;

    for (final UICommand command : commands) {
      // Find the open and close positions of the link within the message:
      final int openIndex = text.indexOf("<a>", start); // $NON-NLS-1$
      final int closeIndex = text.indexOf("</a>", start); // $NON-NLS-1$
      if (openIndex == -1 || closeIndex == -1 || closeIndex < openIndex) {
        break;
      }

      // Extract the text before, inside and after the tags:
      final String beforeText = text.substring(start, openIndex);
      final String betweenText = text.substring(openIndex + 3, closeIndex);
      start = closeIndex + 4;

      // Create the label for the text before the tag:
      final Label beforeLabel = new Label(beforeText);
      beforeLabel
          .getElement()
          .getStyle()
          .setProperty("display", "inline"); // $NON-NLS-1$ //$NON-NLS-2$
      alertPanel.add(beforeLabel);

      // Create the anchor:
      final Anchor betweenAnchor = new Anchor(betweenText);
      betweenAnchor
          .getElement()
          .getStyle()
          .setProperty("display", "inline"); // $NON-NLS-1$ //$NON-NLS-2$
      alertPanel.add(betweenAnchor);

      // Add a listener to the anchor so that the command is executed when
      // it is clicked:
      betweenAnchor.addClickHandler(
          new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
              command.execute();
            }
          });
    }

    if (start < text.length()) {
      final String afterText = text.substring(start);
      // Create the label for the text after the tag:
      final Label afterLabel = new Label(afterText);
      afterLabel
          .getElement()
          .getStyle()
          .setProperty("display", "inline"); // $NON-NLS-1$ //$NON-NLS-2$
      alertPanel.add(afterLabel);
    }

    if (start > 0) {
      // Add the alert to the view:
      view.addAlert(alertPanel);
    }
  }
Ejemplo n.º 12
0
 public BrandBuilderImpl(Anchor element) {
   this.root = element.getElement();
 }
  public void setView(UserFollowDo userFollowDo) {
    profileThumbnailImage.setUrl(userFollowDo.getProfileImageUrl());
    profileThumbnailImage.addErrorHandler(
        new ErrorHandler() {

          @Override
          public void onError(ErrorEvent event) {
            profileThumbnailImage.setUrl("images/settings/setting-user-image.png");
          }
        });

    // userNameLabel.setText(userFollowDo.getUsername());
    userNameLabel.getElement().setId(userFollowDo.getGooruUid());

    int collectionCount = userFollowDo.getSummary().getCollection();
    userCollections.setText(
        collectionCount + (collectionCount == 1 ? " Collection" : " Collections"));
    userCollections
        .getElement()
        .setAttribute(
            "alt", collectionCount + (collectionCount == 1 ? " Collection" : " Collections"));
    userCollections
        .getElement()
        .setAttribute(
            "title", collectionCount + (collectionCount == 1 ? " Collection" : " Collections"));

    userFollowDetails.setText(
        userFollowDo.getSummary().getFollowers()
            + (userFollowDo.getSummary().getFollowers() == 1 ? " Follower" : " Followers")
            + " | "
            + userFollowDo.getSummary().getFollowing()
            + " Following");
    userFollowDetails
        .getElement()
        .setAttribute(
            "alt",
            userFollowDo.getSummary().getFollowers()
                + (userFollowDo.getSummary().getFollowers() == 1 ? " Follower" : " Followers")
                + " | "
                + userFollowDo.getSummary().getFollowing()
                + " Following");
    userFollowDetails
        .getElement()
        .setAttribute(
            "title",
            userFollowDo.getSummary().getFollowers()
                + (userFollowDo.getSummary().getFollowers() == 1 ? " Follower" : " Followers")
                + " | "
                + userFollowDo.getSummary().getFollowing()
                + " Following");

    String gooruUid = userNameLabel.getElement().getId();
    Anchor anchor = new Anchor();
    String userName = userFollowDo.getUsername();

    String token = "#" + PlaceTokens.PROFILE_PAGE + "&id=" + gooruUid + "&user="******"style", "font-size: 18px !important");
    anchor.setTarget("_blank");
    userNameLabel.setText("");
    userNameLabel.getElement().setAttribute("alt", "");
    userNameLabel.getElement().setAttribute("title", "");
    //		boolean isEnabled =  userFollowDo.getCustomFields() != null &&
    // userFollowDo.getCustomFields().get(0).getOptionalValue() != null &&
    // userFollowDo.getCustomFields().get(0).getOptionalValue().equalsIgnoreCase("true") ? true :
    // false;
    boolean isEnabled = false;
    if (userFollowDo.getCustomFields() != null) {
      for (int i = 0; i < userFollowDo.getCustomFields().size(); i++)
        if (userFollowDo
            .getCustomFields()
            .get(i)
            .getOptionalKey()
            .equalsIgnoreCase("show_profile_page")) {
          isEnabled =
              userFollowDo.getCustomFields().get(i).getOptionalValue().equalsIgnoreCase("true")
                  ? true
                  : false;
        }
    }
    if (isEnabled) {
      userNameLabel.getElement().appendChild(anchor.getElement());
    } else {
      userNameLabel.setText(userFollowDo.getUsername());
      userNameLabel.getElement().setAttribute("alt", userFollowDo.getUsername());
      userNameLabel.getElement().setAttribute("title", userFollowDo.getUsername());
      userNameLabel.getElement().getStyle().setCursor(Cursor.DEFAULT);
    }
  }