Пример #1
0
 @Override
 public void setHasMoreStories(boolean hasMore) {
   if (!hasMore) {
     aLoadMore.setText("No more stories to load");
   } else {
     aLoadMore.setText("Load more");
   }
 }
 @Override
 public void updatePathLink() {
   if (presenter.currentCMSContentSummary != null) {
     String path = presenter.currentCMSContentSummary.getPath();
     if (path != null && !path.equals("")) {
       pathLink.setText(path);
     } else {
       pathLink.setText("/");
     }
   } else {
     pathLink.setText("/");
   }
 }
Пример #3
0
  /**
   * Sets the question for this widget.
   *
   * @param questionDef the question definition object.
   */
  public void setQuestion(QuestionDef questionDef) {
    this.questionDef = questionDef;

    if (questionDef != null) fieldHyperlink.setText(questionDef.getText());
    else {
      horizontalPanel.remove(fieldHyperlink);
      horizontalPanel.remove(sgstField);

      // Removing and adding of fieldHyperlink is to prevent a wiered bug from
      // happening where focus is taken off, brought back and the hyperlink
      // displays no more text.
      horizontalPanel.add(fieldHyperlink);
      fieldHyperlink.setText("");
    }
  }
Пример #4
0
  @Override
  public void displayUsers(Map<Integer, String> users) {
    usersList.clear();

    for (Integer userId : users.keySet()) {
      HTMLPanel panel = new HTMLPanel("");

      Anchor linkToEdit = new Anchor();

      linkToEdit.setText(users.get(userId));

      PlaceRequest placeToGo =
          new PlaceRequest.Builder()
              .nameToken(NameTokens.USER)
              .with(NameTokens.PARAM_ID, String.valueOf(userId))
              .build();
      linkToEdit.setHref("#" + tokenFormatter.toPlaceToken(placeToGo));

      Button deleteButton = new Button();
      deleteButton.setText("X");
      deleteButton.addClickHandler(clickEvent -> getUiHandlers().deleteUser(userId));

      panel.add(linkToEdit);
      panel.add(deleteButton);

      usersList.add(panel);
    }
  }
Пример #5
0
 @Override
 public void onSuccess(final User user) {
   this.user = user;
   if (user != null) {
     anchor.setText(user.getName());
   }
 }
Пример #6
0
 @Override
 public void setText(String text) {
   super.setText(text);
   if (text == null) {
     text = "";
   }
   this.text = text;
 }
Пример #7
0
  public Logined() {
    this.loginedRes = GWT.create(LoginedResources.class);
    loginedRes.style().ensureInjected();
    initWidget(ourUiBinder.createAndBindUi(this));

    logout.setText(constants.logout());
    setHelloMessage();
  }
 /** {@inheritDoc} */
 @Override
 public void setPrefix(String prefix) {
   prefixHeader.setText(prefix);
   deletePrefixLabel.setText("Delete prefix " + prefix + ":");
   deleteButton.setText("Delete " + prefix);
   uploadPrefix.setValue(prefix);
   settingsPrefix.setValue(prefix);
 }
 private void initPathLink() {
   FlowPanel container = new FlowPanel();
   Label pathLabel = new Label();
   pathLabel.setText("Path:");
   pathLink = new Anchor();
   pathLink.setText("/");
   container.add(pathLabel);
   container.add(pathLink);
   listGrid.getLeftToolbar().add(container);
 }
Пример #10
0
 @Override
 public void onFailure(final Throwable error) {
   if (error instanceof HTTPException) {
     final HTTPException exception = (HTTPException) error;
     if (exception.getCode() == 401) {
       anchor.setText("Login");
       anchor.setHref(exception.getMessage());
       login = exception.getMessage();
     }
   }
 }
Пример #11
0
  public void stopSelection() {
    if (horizontalPanel.getWidgetIndex(fieldHyperlink) != -1) return;

    String val = sgstField.getText();
    if (val.trim().length() == 0) val = EMPTY_VALUE;
    fieldHyperlink.setText(val);
    horizontalPanel.remove(sgstField);
    horizontalPanel.add(fieldHyperlink);
    QuestionDef qtn = formDef.getQuestionWithText(txtField.getText());
    if (qtn != null) itemSelectionListener.onItemSelected(this, qtn);
  }
Пример #12
0
 @Override
 public void setModel(final Store model) {
   link.setText(model.getName());
   link.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           groceryListWidget.filterOn(model);
         }
       });
 }
Пример #13
0
 @Override
 public void addProperty(EntryDto dto) {
   if (dto.getValue().toLowerCase().startsWith("http")) {
     Anchor a = new Anchor();
     a.setTarget("_blank");
     a.setHref(dto.getValue());
     a.setText(dto.getValue());
     properties.addProperty(new Label(dto.getKey()), a.asWidget());
   } else {
     properties.addProperty(dto.getKey(), dto.getValue());
   }
 }
Пример #14
0
  /** @see org.overlord.apiman.dt.ui.client.local.pages.AbstractPlanPage#renderPage() */
  @Override
  protected void renderPage() {
    super.renderPage();
    description.setText(planBean.getDescription());
    createdOn.setText(Formatting.formatShortDate(planBean.getCreatedOn()));
    createdBy.setText(planBean.getCreatedBy());
    String toUserHref =
        navHelper.createHrefToPage(
            UserServicesPage.class,
            MultimapUtil.fromMultiple("user", planBean.getCreatedBy())); // $NON-NLS-1$
    createdBy.setHref(toUserHref);

    version.setText(versionBean.getVersion());
    versionCreatedOn.setText(Formatting.formatShortDate(versionBean.getCreatedOn()));
    versionCreatedBy.setText(versionBean.getCreatedBy());
    toUserHref =
        navHelper.createHrefToPage(
            UserServicesPage.class,
            MultimapUtil.fromMultiple("user", versionBean.getCreatedBy())); // $NON-NLS-1$
    versionCreatedBy.setHref(toUserHref);
  }
Пример #15
0
 @Override
 protected void onUpdateHeader(BlockHeaderWidget header) {
   Task task = getObject();
   header.setDragHandle(task.getReference());
   Image statusImage = null;
   if (task.isClosed()) {
     statusImage = Img.bundle.tskClosed().createImage();
     statusImage.setTitle("Closed.");
   } else if (task.isBlocked()) {
     statusImage = Img.bundle.tskBlocked().createImage();
     statusImage.setTitle("Blocked by " + task.getImpediment().getReferenceAndLabel() + ".");
   } else if (task.isOwnerSet()) {
     statusImage = Img.bundle.tskClaimed().createImage();
     statusImage.setTitle("Claimed by " + task.getOwner().getName() + ".");
   }
   statusIcon.setWidget(statusImage);
   if (requirementLabel != null) {
     Requirement req = task.getRequirement();
     requirementLabel.setText(req.getReference() + " " + req.getLabel());
   }
   if (ownerLabel != null)
     ownerLabel.setText(task.isOwnerSet() ? task.getOwner().getName() : null);
   header.setCenter(task.getLabel());
 }
Пример #16
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");
  }
Пример #17
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 void setId() {
    saveBtn.setText(i18n.GL0141());
    saveBtn.getElement().setId("saveBtnId");
    saveBtn.getElement().setAttribute("alt", i18n.GL0141());
    saveBtn.getElement().setAttribute("title", i18n.GL0141());

    errorLabel.getElement().setId("errorLblId");
    saveLblText.setText(i18n.GL3426());
    saveLblText.getElement().setId("saveLblTxtId");
    saveLblText.setVisible(false);

    assignedCourse.setText(i18n.GL3440());
    courseAssigned.setText(i18n.GL3441());
    studentsNotes.setText(i18n.GL3442());
    createCourseBtn.setText(i18n.GL3443());
    lessonPacingPanel.setText(i18n.GL3444());
    minimumScrPanel.setText(i18n.GL3445());
    miniNotesPanel.setText(i18n.GL3446());
    pacingWorks.setText(i18n.GL3447());
    pacingNotes.setText(i18n.GL3448());
    assessmentsLbl.setText(i18n.GL3449());
    collectionLbl.setText(i18n.GL3450());
    contentRedirectionLbl.setText(i18n.GL3593());
  }
 /** {@inheritDoc} */
 @Override
 public void setPrefixHref(String href) {
   prefixHeader.setHref(href);
   mainlink.setText(href);
   mainlink.setHref(href);
 }
  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);
    }
  }
Пример #21
0
 public void setText(String text) {
   anchor.setText(text);
 }
Пример #22
0
 @Override
 public void setActivateText(boolean showActivate) {
   activateStatus.setText((showActivate) ? "Activate Status" : "Deactivate Status");
 }
Пример #23
0
 @Override
 public void setText(String text) {
   hyperlink.setText(text);
 }
Пример #24
0
  @Override
  public void onPlaceChange(PlaceChangeEvent event) {
    Place newPlace = event.getNewPlace();

    // select the link corresponding to the place
    for (Link link : links) {
      if (link.isPlaceMatchLink(newPlace)) {
        link.getLink().addStyleName(res.style().menuLinkSelected());
      } else {
        link.getLink().removeStyleName(res.style().menuLinkSelected());
      }
    }

    // clear the source list because we are going to update it with the raw source file
    // corresponding to the new
    // place
    sourceList.clear();

    if (newPlace instanceof PlaceWithSources) {
      exampleLink.setVisible(true);
      sourceLink.setVisible(true);

      PlaceWithSources<?> place = (PlaceWithSources<?>) newPlace;

      sourceList.addItem("Example", place.getSourceFilename());

      String[] rawFilenames = place.getRawSourceFilenames();

      if (null != rawFilenames && rawFilenames.length > 0) {
        // add the raw source files to the list and show the list
        String text = sourceLink.getText();
        if (!text.endsWith(":")) {
          sourceLink.setText(text + ":");
        }
        sourceList.setVisible(true);
        int indexRawSource = 0;
        // starting at 1 because the first item is the example
        int i = 1;
        for (String filename : rawFilenames) {
          sourceList.addItem(filename, filename);
          if (place.isRawSource() && filename.equals(place.getFilename())) {
            indexRawSource = i;
          }
          i++;
        }
        sourceList.setSelectedIndex(indexRawSource);
      } else {
        // no raw source file, we hide the list
        String text = sourceLink.getText();
        if (text.endsWith(":")) {
          sourceLink.setText(text.substring(0, text.length() - 1));
        }
        sourceList.setVisible(false);
      }

      if (null == place.getFilename()) {
        sourceLink.removeStyleName(res.style().sourceLinkSelected());
        exampleLink.addStyleName(res.style().sourceLinkSelected());
        container.getElement().getStyle().clearBackgroundColor();
        container.getElement().getStyle().clearProperty("border");
      } else {
        exampleLink.removeStyleName(res.style().sourceLinkSelected());
        sourceLink.addStyleName(res.style().sourceLinkSelected());
        container.getElement().getStyle().setBackgroundColor("#eee");
        container.getElement().getStyle().setProperty("border", "1px solid #c3c3c3");
      }
    } else {
      // should not happen
      exampleLink.setVisible(false);
      sourceLink.setVisible(false);
      sourceList.setVisible(false);
    }
  }
Пример #25
0
 public void selectQuestion(QuestionDef questionDef) {
   fieldHyperlink.setText(questionDef.getText());
   itemSelectionListener.onItemSelected(this, questionDef);
 }
Пример #26
0
 public void setActive(boolean active) {
   link.setText(active ? deactivateText : activateText);
 }