Esempio n. 1
0
 protected void doAttach(ValidationGroup validationGroup) {
   validationGroup.add(nameField, StringValidators.REQUIRE_NON_EMPTY_STRING);
   validationGroup.add(descriptionField, StringValidators.REQUIRE_NON_EMPTY_STRING);
   validationGroup.add(fileField, StringValidators.FILE_MUST_BE_FILE);
   validationGroup.add(charsetField, StringValidators.REQUIRE_NON_EMPTY_STRING);
   validationGroup.add(kindField, StringValidators.REQUIRE_NON_EMPTY_STRING);
 }
  private void buildValidationPanel() {
    validationPanel = new ValidationPanel();
    validationPanel.setInnerComponent(this);

    ValidationGroup group = validationPanel.getValidationGroup();

    group.add(titleTextField, new ColumnTitleValidator(table));
    group.add(timestampText, new IntervalBoundValidator());

    validationPanel.addChangeListener(
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent e) {
            dialogControls.setOkButtonEnabled(!validationPanel.isProblem());
          }
        });
  }
Esempio n. 3
0
  public static ValidationPanel createValidationPanel(final EqualStringPanel innerPanel) {
    final ValidationPanel validationPanel = new ValidationPanel();
    validationPanel.setInnerComponent(innerPanel);

    ValidationGroup group = validationPanel.getValidationGroup();
    validationPanel.addChangeListener(
        new ChangeListener() {

          @Override
          public void stateChanged(ChangeEvent e) {
            innerPanel.okButton.setEnabled(!validationPanel.isProblem());
          }
        });
    // Node field
    group.add(innerPanel.textField, new RegexValidator(innerPanel));

    return validationPanel;
  }