/**
  * Sets the value of the current field component.
  *
  * @param value The value to set
  */
 public void setValue(Object value) {
   if (fieldComponent != null) {
     if (fieldComponent instanceof Field) {
       Field field = ((Field) fieldComponent);
       field.setValue(value);
       if (field instanceof Select) {
         ((Select) fieldComponent).select(value);
       }
     } else if (fieldComponent instanceof FilterContainer) {
       ((FilterContainer) fieldComponent).setValue(value);
     }
   }
 }
Example #2
0
  private void populateKindergartenSelect() {
    Select kindergartenSelect = this.getView().getKindergarten();
    kindergartenSelect.addItem(ApplicationConstants.SELECT_ALL);
    kindergartenSelect.setItemCaption(
        ApplicationConstants.SELECT_ALL,
        this.getMessage("kindergarten.select.all", this.getLocale()));
    kindergartenSelect.select(ApplicationConstants.SELECT_ALL);

    for (KindergartenDTO kindergarten : kindergartenService.getAll()) {
      kindergartenSelect.addItem(kindergarten.getId());
      kindergartenSelect.setItemCaption(kindergarten.getId(), kindergarten.getName());
    }
  }
  @SuppressWarnings("serial")
  @Override
  public void afterPropertiesSet() throws Exception {
    setHeight("200px");
    setWidth("700px");

    crossNameOptionGroup = new OptionGroup();
    sequenceNumCheckBox = new CheckBox();
    sequenceNumCheckBox.setImmediate(true);
    sequenceNumCheckBox.addListener(
        new Property.ValueChangeListener() {
          @Override
          public void valueChange(ValueChangeEvent event) {
            enableSpecifyLeadingZerosComponents(sequenceNumCheckBox.booleanValue());
          }
        });

    specifyPrefixLabel = new Label();
    prefixTextField = new TextField();
    prefixTextField.setWidth("500px");

    howManyDigitsLabel = new Label();
    leadingZerosSelect = new Select();
    for (int i = 1; i <= MAX_LEADING_ZEROS; i++) {
      leadingZerosSelect.addItem(Integer.valueOf(i));
    }
    leadingZerosSelect.setNullSelectionAllowed(false);
    leadingZerosSelect.select(Integer.valueOf(1));
    leadingZerosSelect.setWidth("50px");

    specifySuffixLabel = new Label();
    suffixTextField = new TextField();
    suffixTextField.setWidth("500px");

    nextNameInSequenceLabel = new Label();
    generatedNameLabel = new Label();

    generateButton = new Button();
    generateButton.setData(GENERATE_BUTTON_ID);
    generateButton.addListener(new CrossingManagerImportButtonClickListener(this));

    layoutComponents();
    initializeToggableComponents();
  }