Esempio n. 1
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();
  }