public InlineValidationResult runValidation() {
   InlineValidationResult validation = validator.getValidation(textBox);
   if (validation.isInvalid()) {
     errorLabel.setText(validation.getMessage());
     errorLabel.setVisible(true);
   } else {
     errorLabel.setText("");
     errorLabel.setVisible(false);
   }
   return validation;
 }
  public WebProtegeDialogTextFieldValidationManager(
      ValueBoxBase<String> textBox,
      final WebProtegeDialogInlineValidator<ValueBoxBase<String>> validator) {
    this.textBox = textBox;
    this.errorLabel = new InlineLabel();
    this.validator = validator;
    textBox.addKeyUpHandler(
        new KeyUpHandler() {
          public void onKeyUp(KeyUpEvent event) {
            if (validator.shouldCheckOnKeyUp()) {
              runValidation();
            }
          }
        });
    textBox.addValueChangeHandler(
        new ValueChangeHandler<String>() {
          public void onValueChange(ValueChangeEvent<String> stringValueChangeEvent) {
            if (validator.shouldCheckOnValueChange()) {
              runValidation();
            }
          }
        });

    errorLabel.addStyleName("web-protege-red-foreground");
    errorLabel.setText("");
    errorLabel.setVisible(false);
  }
Ejemplo n.º 3
0
 @Override
 public void enableUserOptions(CurrentUser currentUser) {
   userOptions.setVisible(true);
   menuBar.setVisible(true);
   UserDto userDto = currentUser.getUser();
   name.setText(userDto.getFirstName());
 }
 /* (non-Javadoc)
  * @see org.ednovo.gooru.client.mvp.classpage.teach.edit.content.IsEditClassContentView#setCourseData(org.ednovo.gooru.application.shared.model.folder.FolderDo)
  */
 @Override
 public void setCourseData(FolderDo result) {
   coursePanelVisiblity(true);
   if (result != null) {
     titleLbl.setText(result.getTitle());
     titleLbl.getElement().setId(result.getGooruOid());
     titleLbl.getElement().setAttribute("alt", result.getTitle());
     titleLbl.getElement().setAttribute("title", result.getTitle());
   }
 }
Ejemplo n.º 5
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);
  }
Ejemplo n.º 6
0
  private TestFlows() {
    FlowPanel root = new FlowPanel();
    Util.addText(root.getElement(), "Div root");

    FlowPanel div1 = new FlowPanel();
    Util.addText(div1.getElement(), "Div1");
    root.add(div1);

    FlowPanel div2 = new FlowPanel();
    Util.addText(div2.getElement(), "Div2");
    div1.add(div2);

    InlineLabel span1 = new InlineLabel();
    span1.setText("Span1");
    div1.add(span1);

    FlowPanel anon = new FlowPanel();
    Util.addText(anon.getElement(), "Div anon");
    root.add(anon);

    FlowPanel div3 = new FlowPanel();
    Util.addText(div3.getElement(), "Div3");
    anon.add(div3);

    FlowPanel div4 = new FlowPanel();
    Util.addText(div4.getElement(), "Div4");
    div3.add(div4);

    InlineLabel span2 = new InlineLabel();
    span2.setText("Span2");
    div3.add(span2);

    Util.addText(div1.getElement(), " Div1 end");
    Util.addText(div3.getElement(), " Div3 end");
    Util.addText(anon.getElement(), " Div anon end");
    Util.addText(root.getElement(), " Div root end");

    initWidget(root);
  }
Ejemplo n.º 7
0
  /**
   * Sets a new {@link ListFilter} to be shown.
   *
   * @param listFilter new {@link ListFilter}
   */
  public void setListFilter(ListFilter listFilter) {
    if (listFilter == null) {
      listFilter = new ListFilter();
    }

    ListFiltersConstants constants = I18n.getListFiltersConstants();

    ReadState read = ReadState.get(listFilter.getRead());
    readState.setText(constants.getString("readState_" + read.name()));

    Date fromDate = listFilter.getStartFrom();
    if (fromDate != null) {
      fromLabel.setVisible(true);
      from.setVisible(true);
      from.setValue(fromDate);
    } else {
      fromLabel.setVisible(false);
      from.setVisible(false);
    }

    Date toDate = listFilter.getEndTo();
    if (toDate != null) {
      toLabel.setVisible(true);
      to.setVisible(true);
      to.setValue(toDate);
    } else {
      toLabel.setVisible(false);
      to.setVisible(false);
    }

    ListFilterOrder order = listFilter.getOrder();
    if (order == null) {
      order = ListFilterOrder.getDefault();
    }

    ordered.setText(constants.getString("listFilterOrder_" + order.name()));
  }
  public com.google.gwt.user.client.ui.Widget createAndBindUi(
      final com.google.gwt.requestfactory.ui.client.LoginWidget owner) {

    com.google.gwt.requestfactory.ui.client.LoginWidget_BinderImpl_GenBundle
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay =
            (com.google.gwt.requestfactory.ui.client.LoginWidget_BinderImpl_GenBundle)
                GWT.create(
                    com.google.gwt.requestfactory.ui.client.LoginWidget_BinderImpl_GenBundle.class);
    com.google.gwt.requestfactory.ui.client.LoginWidget_BinderImpl_GenCss_style style =
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style();
    com.google.gwt.dom.client.SpanElement name = null;
    java.lang.String domId0 = com.google.gwt.dom.client.Document.get().createUniqueId();
    java.lang.String domId1 = com.google.gwt.dom.client.Document.get().createUniqueId();
    com.google.gwt.user.client.ui.InlineLabel logoutLink =
        (com.google.gwt.user.client.ui.InlineLabel)
            GWT.create(com.google.gwt.user.client.ui.InlineLabel.class);
    com.google.gwt.user.client.ui.HTMLPanel f_HTMLPanel1 =
        new com.google.gwt.user.client.ui.HTMLPanel(
            "<div> <span id='"
                + domId0
                + "'>Not logged in</span> | <span id='"
                + domId1
                + "'></span> </div>");

    logoutLink.setText("Sign out");
    logoutLink.addStyleName("" + style.link() + "");

    UiBinderUtil.TempAttachment attachRecord0 = UiBinderUtil.attachToDom(f_HTMLPanel1.getElement());
    name = com.google.gwt.dom.client.Document.get().getElementById(domId0).cast();
    name.removeAttribute("id");
    com.google.gwt.user.client.Element domId1Element =
        com.google.gwt.dom.client.Document.get().getElementById(domId1).cast();
    attachRecord0.detach();
    f_HTMLPanel1.addAndReplaceElement(logoutLink, domId1Element);

    final com.google.gwt.event.dom.client.ClickHandler
        handlerMethodWithNameVeryUnlikelyToCollideWithUserFieldNames1 =
            new com.google.gwt.event.dom.client.ClickHandler() {
              public void onClick(com.google.gwt.event.dom.client.ClickEvent event) {
                owner.handleClick(event);
              }
            };
    logoutLink.addClickHandler(handlerMethodWithNameVeryUnlikelyToCollideWithUserFieldNames1);

    owner.name = name;
    clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style().ensureInjected();

    return f_HTMLPanel1;
  }
  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());
  }
Ejemplo n.º 10
0
 @Override
 public void setTitle(String text) {
   title.setText(text);
 }
Ejemplo n.º 11
0
 @Override
 public void setRemainCount(String text) {
   remainCount.setText(text);
 }
Ejemplo n.º 12
0
 public void setAppName(String appName) {
   appNameLabel.setText(appName);
 }
Ejemplo n.º 13
0
 public void setUserName(String userName) {
   userNameLabel.setText(userName);
 }
Ejemplo n.º 14
0
 // Display the information in the model object
 private void display() {
   songNameDisplayLabel.setText(model.getName());
 }
Ejemplo n.º 15
0
  public Tab(String name, boolean isClosable) {
    initWidget(uiBinder.createAndBindUi(this));

    nameLabel.setText(name);
    closeButton.setVisible(isClosable);
  }
Ejemplo n.º 16
0
  public void setResponse(SurveyResponse surveyResponse, ElementHandlerCallback callback) {
    date.setText(surveyResponse.getResponseDate().toString());
    campaign.setText(surveyResponse.getCampaignName());
    survey.setText(surveyResponse.getSurveyName());
    username.setText(surveyResponse.getUserName());
    NumberFormat locationFormat = NumberFormat.getFormat("####.000");
    String latString = locationFormat.format(surveyResponse.getLatitude());
    String longString = locationFormat.format(surveyResponse.getLongitude());
    location.setText(latString + ", " + longString);

    for (PromptResponse promptResponse : surveyResponse.getPromptResponses()) {
      Widget responseDisplayWidget = null;
      switch (promptResponse.getPromptType()) {
        case PHOTO:
          String raw = promptResponse.getResponseRaw();
          if (raw.equals("SKIPPED") || raw.equals("NOT_DISPLAYED")) {
            responseDisplayWidget = new HTML(raw);
          } else {
            // generate urls for thumbnail and full sized photo and pass to widget
            String thumbUrl =
                AwUrlBasedResourceUtils.getImageUrl(
                    promptResponse.getResponseRaw(),
                    surveyResponse.getUserName(),
                    surveyResponse.getCampaignId(),
                    AwUrlBasedResourceUtils.ImageSize.SMALL);
            final String fullSizedImageUrl =
                AwUrlBasedResourceUtils.getImageUrl(
                    promptResponse.getResponseRaw(),
                    surveyResponse.getUserName(),
                    surveyResponse.getCampaignId(),
                    AwUrlBasedResourceUtils.ImageSize.ORIGINAL);
            Image img = new Image(thumbUrl);
            img.setStyleName(style.promptImage());

            // Locking in the width and height here stops the Image from resizing on image
            // load which causes the InfoWindow to refresh and flicker
            img.setPixelSize(AwConstants.MAPS_THUMBNAIL_WIDTH, AwConstants.MAPS_THUMBNAIL_HEIGHT);

            // Let's the calling code do whatever with the image, specifically used to avoid
            // dependencies
            // on the google maps API
            if (callback != null) {
              callback.addingElement(img.getElement(), fullSizedImageUrl);
            }

            FlowPanel panel = new FlowPanel();
            panel.add(img);
            responseDisplayWidget = panel;
          }
          break;
          // TODO: special case timestamp?
        default:
          // anything other than a photo, just copy it verbatim
          responseDisplayWidget = new HTML(promptResponse.getResponsePrepared());
          break;
      }

      // set up and style question
      HTML question = new HTML(promptResponse.getText());
      question.setStyleName(style.promptQuestion());

      // add style to response
      responseDisplayWidget.setStyleName(style.promptResponse());

      // add question and response to styled div
      FlowPanel panel = new FlowPanel();
      panel.setStyleName(style.prompt());
      panel.add(question);
      panel.add(responseDisplayWidget);

      // add the whole thing to prompt list
      prompts.add(panel);
    }
  }
Ejemplo n.º 17
0
 public Header(String userName, String userIdS, String logoutUrl) {
   initWidget(binder.createAndBindUi(this));
   userNickname.setText(userName);
   userId.setDefaultValue(userIdS);
   signOutLink.setHref(logoutUrl);
 }