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);
  }
Esempio n. 3
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()));
  }
Esempio n. 4
0
 public void useAppLogo(boolean useLogo) {
   appNameImage.setVisible(useLogo);
   appNameLabel.setVisible(!useLogo);
 }
Esempio n. 5
0
  public Tab(String name, boolean isClosable) {
    initWidget(uiBinder.createAndBindUi(this));

    nameLabel.setText(name);
    closeButton.setVisible(isClosable);
  }