Beispiel #1
0
  /**
   * LanguageSelect constructor.
   *
   * @param inPreferences {@link PreferencesHelper}
   * @param inConfigManager {@link ConfigManager}
   * @param inUser {@link User}
   */
  public LanguageSelect(
      final PreferencesHelper inPreferences,
      final ConfigManager inConfigManager,
      final User inUser) {
    super();
    // initialize language form prefs (1) or config admin (2)
    // final String lActiveLanguage = inPreferences.getLocale(inUser,
    // new Locale(inConfigManager.getLanguage())).getLanguage();

    setStyleName("ripla-language-select"); // $NON-NLS-1$
    setSizeUndefined();

    layout = new HorizontalLayout();
    setCompositionRoot(layout);
    layout.setHeight(22, Unit.PIXELS);
    layout.setSpacing(true);

    final Label lLabel =
        new Label(
            Activator.getMessages().getMessage("toolbar.label.language"),
            ContentMode.HTML); // $NON-NLS-1$
    lLabel.setStyleName("ripla-toolbar-label"); // $NON-NLS-1$
    lLabel.setSizeUndefined();
    layout.addComponent(lLabel);
    layout.setComponentAlignment(lLabel, Alignment.MIDDLE_LEFT);
    layout.setExpandRatio(lLabel, 1);

    select = createSelect();
    select.addValueChangeListener(
        new Property.ValueChangeListener() {
          @Override
          public void valueChange(final ValueChangeEvent inEvent) {
            final Locale lNew = ((LocaleAdapter) select.getValue()).getLocale();
            final Locale lOld = VaadinSession.getCurrent().getLocale();
            if (!lOld.equals(lNew)) {
              VaadinSession.getCurrent().setLocale(lNew);
              if (listener != null) {
                listener.processAction(
                    new IToolbarAction() {
                      @Override
                      public void run() {
                        LOG.trace("Setting language preference to {}.", lNew.getLanguage());
                        VaadinSession.getCurrent()
                            .getAttribute(IRiplaEventDispatcher.class)
                            .dispatch(
                                org.ripla.interfaces.IRiplaEventDispatcher.Event.REFRESH,
                                new HashMap<String, Object>());
                      }
                    });
              }
            }
          }
        });
    layout.addComponent(select);
  }
  public VentanaAltaConsultaSesion(
      final IPacientes iPacientes, Observer observer, Evaluacion evaluacion) {
    this.iPacientes = iPacientes;
    this.observer = observer;
    this.evaluacion = evaluacion;
    setModal(true);
    setCaption("Ingeso de consulta/sesión");
    layout.setMargin(true);

    fecha = new PopupDateField();
    fecha.setValue(Calendar.getInstance().getTime());
    layout.addComponent(fecha);

    textArea.setInputPrompt("observaciones");
    layout.addComponent(textArea);

    //		containerTipoConsulta = new BeanItemContainer<TipoConsulta>(TipoConsulta.class,
    //				TipoConsulta.getAll());
    containerTipoConsulta =
        new BeanItemContainer<TipoConsulta>(
            TipoConsulta.class, Arrays.asList(TipoConsulta.values()));

    comboBoxTipoConsulta = new ComboBox();
    comboBoxTipoConsulta.setContainerDataSource(containerTipoConsulta);
    comboBoxTipoConsulta.setItemCaptionPropertyId("descripcion");
    comboBoxTipoConsulta.setItemCaptionMode(ItemCaptionMode.PROPERTY);
    comboBoxTipoConsulta.setImmediate(true);
    comboBoxTipoConsulta.addValueChangeListener(
        new ValueChangeListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            if (event.getProperty() != null) {
              TipoConsulta tipoConsulta = (TipoConsulta) event.getProperty().getValue();
              layoutAdicional.removeAllComponents();
              if (tipoConsulta != null) {
                if (tipoConsulta.equals(TipoConsulta.TERAPIA_FISICA)) {
                  layoutAdicional.addComponent(opcionesTerapiaFisica);
                } else if (tipoConsulta.equals(TipoConsulta.GIMNASIO)) {
                  layoutAdicional.addComponent(opcionesGimnasio);
                }
              }
            }
          }
        });

    layout.addComponent(comboBoxTipoConsulta);
    cargarTipoTerapiaFisica();
    cargarTipoGimnasio();
    layout.addComponent(layoutAdicional);
    layout.addComponent(this.obtenerBotonGuardar());
    this.setContent(layout);
  }
 private ComboBox createType(Object itemId) {
   ComboBox select = new ComboBox();
   for (AttribType type : AttribType.values()) {
     select.addItem(type.name());
   }
   select.setValue(AttribType.gauge);
   select.setNullSelectionAllowed(false);
   select.setData(itemId);
   select.setBuffered(false);
   select.setImmediate(true);
   select.addValueChangeListener(validateOnValueChangeListener);
   return select;
 }
  private void siapkanPilihanPA() {
    lpa = DosenKaryawanPersistence.getDosen();
    java.util.Collections.sort(lpa);
    beanDosenPA.addAll(lpa);
    cbPA.setContainerDataSource(beanDosenPA);
    cbPA.addValueChangeListener(
        new ValueChangeListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            dosenPA = (DosenKaryawan) event.getProperty().getValue();
          }
        });
  }
  private void siapkanPilihanProdi() {
    beanProdi.addAll(GenericPersistence.findList(ProgramStudi.class));
    cbProdi.setContainerDataSource(beanProdi);
    // cbProdi.setNullSelectionAllowed(false);
    // cbProdi.setTextInputAllowed(false);
    cbProdi.addValueChangeListener(
        new ValueChangeListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            prodi = (ProgramStudi) event.getProperty().getValue();
          }
        });
  }
  private ComboBox createSelect(String caption) {
    final ComboBox cb = new ComboBox();
    cb.setImmediate(true);
    cb.addContainerProperty(CAPTION, String.class, "");
    cb.setItemCaptionPropertyId(CAPTION);
    cb.setCaption(caption);
    cb.addValueChangeListener(
        new ValueChangeListener() {

          @Override
          public void valueChange(ValueChangeEvent event) {
            Notification.show(
                "Value now:" + cb.getValue() + " " + cb.getItemCaption(cb.getValue()));
          }
        });
    return cb;
  }
  private ComboBox buildEventTypeComboBox() {

    ComboBox cb = new ComboBox();
    cb.addItem("THREAT");
    cb.addItem("PATCH");
    cb.addItem("SCAN");
    cb.addItem("CLIENT");
    cb.setValue("THREAT");
    cb.setNullSelectionAllowed(false);

    cb.addValueChangeListener(
        new Property.ValueChangeListener() {

          private static final long serialVersionUID = 3133483459264825026L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            String item = (String) event.getProperty().getValue();

            // System.out.println("Selected Item "+item);

            if (item.equals("THREAT")) {
              fieldCombo.removeAllItems();
              fieldCombo.addItems(threatFields);
              fieldCombo.setValue(threatFields[0]);
            } else if (item.equals("PATCH")) {
              fieldCombo.removeAllItems();
              fieldCombo.addItems(patchFields);
              fieldCombo.setValue(patchFields[0]);
            } else if (item.equals("SCAN")) {
              fieldCombo.removeAllItems();
              fieldCombo.addItems(scanFields);
              fieldCombo.setValue(scanFields[0]);
            } else if (item.equals("CLIENT")) {
              fieldCombo.removeAllItems();
              fieldCombo.addItems(clientFields);
              fieldCombo.setValue(clientFields[0]);
            }
          }
        });

    return cb;
  }
    void displayVersions(String path) {
      List<PageVersion> pageVersions = pageService.getPageVersions(path);
      if (pageVersions.size() > 0) {
        final ComboBox pageSelection = new ComboBox();
        content.addComponent(pageSelection);
        pageSelection.setNullSelectionAllowed(false);
        pageSelection.setStyleName("version-selection-box");
        pageSelection.setTextInputAllowed(false);

        pageSelection.addValueChangeListener(
            new ValueChangeListener() {
              private static final long serialVersionUID = 1L;

              @Override
              public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
                selectedVersion = (PageVersion) pageSelection.getValue();
                if (selectedVersion != null) {
                  Page page =
                      pageService.getPageByVersion(beanItem.getPath(), selectedVersion.getName());
                  page.setPath(beanItem.getPath());
                  previewForm.setBean(page);
                  previewLayout.setTitle(page.getSubject());
                  ((PagePreviewFormLayout) previewLayout).displayPageInfo(page);
                }
              }
            });

        pageSelection.setItemCaptionMode(ItemCaptionMode.EXPLICIT);
        pageSelection.setNullSelectionAllowed(false);

        for (int i = 0; i < pageVersions.size(); i++) {
          PageVersion version = pageVersions.get(i);
          pageSelection.addItem(version);
          pageSelection.setItemCaption(version, getVersionDisplay(version, i));
        }

        if (pageVersions.size() > 0) {
          pageSelection.setValue(pageVersions.get(pageVersions.size() - 1));
        }
      }
    }
  @Override
  protected void setup() {

    Button b = new Button("Swap data provider");
    b.addClickListener(
        event -> {
          if (biggerData) {
            combo.setItems("Item 3");
          } else {
            combo.setItems("Item 1", "Item 2", "Item 3", "Item 4");
          }
          biggerData = !biggerData;
        });

    combo = new ComboBox<>();
    combo.setItems("Item 1", "Item 2", "Item 3", "Item 4");
    combo.addValueChangeListener(event -> log.log("Value is now: " + combo.getValue()));
    addComponent(log);
    addComponent(b);
    addComponent(combo);
    addComponent(new Button("Dummy for TestBench"));
  }
  protected void replaceToCombo(String key, Container container, String defaultValue) {
    final TextField field = (TextField) map.get(key);
    HorizontalLayout layout = (HorizontalLayout) field.getParent();
    field.setVisible(false);
    final ComboBox comboBox = new ComboBox("", container);
    comboBox.setImmediate(true);
    comboBox.setNullSelectionAllowed(false);

    comboBox.addValueChangeListener(
        new Property.ValueChangeListener() {
          @Override
          public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
            field.setValue((String) comboBox.getValue());
          }
        });

    if (container.containsId(field.getValue())) {
      comboBox.select(field.getValue());
    } else {
      field.setValue(defaultValue);
      comboBox.select(defaultValue);
    }
    layout.addComponent(comboBox, 1);
  }
Beispiel #11
0
  @Override
  protected void init(final VaadinRequest request) {
    final TabSheet tabLayout = new TabSheet();
    final VerticalLayout layout = new VerticalLayout();
    layout.addComponent(tabLayout);
    setContent(layout);

    final BinderCollection<MarathonData> binders = new BinderCollection<MarathonData>();

    binders.commitHandler();

    final FormLayout competitionParameters = new FormLayout();
    binders.appendBinder(showOverviewData(competitionParameters));
    tabLayout.addTab(competitionParameters, "Übersicht");

    final FormLayout phaseATabContent = new FormLayout();
    binders.appendBinder(showPhaseData(phaseATabContent, Phase.A));
    tabLayout.addTab(phaseATabContent, "Phase A");

    final FormLayout phaseDTabContent = new FormLayout();
    binders.appendBinder(showPhaseData(phaseDTabContent, Phase.D));
    tabLayout.addTab(phaseDTabContent, "Phase D");

    final FormLayout phaseETabContent = new FormLayout();
    binders.appendBinder(showPhaseData(phaseETabContent, Phase.E));
    tabLayout.addTab(phaseETabContent, "Phase E");

    final VerticalLayout outputLayout = new VerticalLayout();
    final FormLayout outputParameters = new FormLayout();

    final BeanItemContainer<String> driverDataSource = new BeanItemContainer<String>(String.class);
    final ComboBox selectDriverCombo = new ComboBox("Fahrer", driverDataSource);
    selectDriverCombo.setNewItemsAllowed(false);
    selectDriverCombo.setImmediate(true);
    outputLayout.addComponent(selectDriverCombo);
    binders.appendBinder(
        new DataBinder<MarathonData>() {

          private MarathonData data;

          @Override
          public void bindData(final MarathonData data) {
            this.data = data;
            driverDataSource.removeAllItems();
            driverDataSource.addAll(data.getDrivers().keySet());
          }

          @Override
          public void commitHandler() {}

          @Override
          public MarathonData getCurrentData() {
            return data;
          }
        });

    // new Button("Erstelle PDF");

    outputLayout.setSizeFull();
    outputLayout.addComponent(outputParameters);
    outputLayout.setExpandRatio(outputParameters, 0);

    final MarathonData marathonData = loadMarathonData("default");
    binders.bindData(marathonData);

    final StreamResource source =
        new StreamResource(
            new StreamSource() {

              @Override
              public InputStream getStream() {
                final ByteArrayOutputStream os = new ByteArrayOutputStream();
                new GeneratePdf()
                    .makePdf(os, binders.getCurrentData(), (String) selectDriverCombo.getValue());
                return new ByteArrayInputStream(os.toByteArray());
              }
            },
            makeOutputFilename());
    source.setMIMEType("application/pdf");
    final BrowserFrame pdf = new BrowserFrame("Output", source);
    pdf.setSizeFull();
    outputLayout.addComponent(pdf);
    outputLayout.setExpandRatio(pdf, 1);
    tabLayout.addTab(outputLayout, "Resultat");
    tabLayout.setSizeFull();
    layout.setExpandRatio(tabLayout, 1);

    layout.setSizeFull();

    selectDriverCombo.addValueChangeListener(
        new ValueChangeListener() {

          @Override
          public void valueChange(final ValueChangeEvent event) {
            binders.commitHandler();
            saveMarathonData(binders.getCurrentData());
            source.setFilename(makeOutputFilename());
            pdf.markAsDirty();
          }
        });

    final Button saveButton =
        new Button(
            "Übernehmen",
            new ClickListener() {
              @Override
              public void buttonClick(final ClickEvent event) {
                binders.commitHandler();
                saveMarathonData(binders.getCurrentData());
                source.setFilename(makeOutputFilename());
                pdf.markAsDirty();
              }
            });
    layout.addComponent(saveButton);
  }
  @Override
  public void init() {
    final String WIDTH = "350px";
    labelErrorQuantity =
        new Label() {
          {
            setVisible(false);
            addStyleName("form-error");
            setContentMode(ContentMode.HTML);
          }
        };
    labelErrorPrice =
        new Label() {
          {
            setVisible(false);
            addStyleName("form-error");
            setContentMode(ContentMode.HTML);
          }
        };
    labelGeneralError =
        new Label() {
          {
            setVisible(false);
            addStyleName("form-error");
            setContentMode(ContentMode.HTML);
          }
        };
    inputGoodsQuantity =
        new TextField("Jumlah") {
          {
            setWidth(function.FORM_WIDTH);
            setImmediate(true);
          }
        };
    inputGoodsQuantity.addValueChangeListener(this);

    inputGoodsSelect =
        new ComboBox("Nama Barang") {
          {
            setImmediate(true);
            setWidth(function.FORM_WIDTH);
          }
        };
    inputGoodsSelect.addValueChangeListener(this);

    inputGoodsPrice = new TextField("Harga Barang");
    inputGoodsPrice.setImmediate(true);
    inputGoodsPrice.setWidth(function.FORM_WIDTH);

    inputDeletionDate =
        new DateField("Tanggal") {
          {
            setWidth(function.FORM_WIDTH);
            setImmediate(true);
          }
        };
    inputDeletionDate.addValueChangeListener(this);

    information = new TextArea("Informasi");
    information.setMaxLength(function.MAX_TEXTAREA_LENGTH);
    information.setWidth(function.FORM_WIDTH);
    labelPriceGuide = new Label("");
    labelPriceGuide.setContentMode(ContentMode.HTML);

    labelSatuan = new Label("Satuan");

    buttonReset = new Button("Reset");
    buttonReset.addClickListener(this);

    buttonSubmit = new Button("Simpan");
    buttonSubmit.addClickListener(this);
    buttonSubmit.addStyleName("primary");
    buttonCancel = new Button("Batal");
    buttonCancel.addClickListener(this);
    buttonUpdate = new Button("Simpan Perubahan");
    buttonUpdate.addClickListener(this);

    buttonNext = new Button(">>");
    buttonNext.addClickListener(this);
    buttonNext.setWidth("50px");
    buttonNext.setEnabled(false);
    buttonPrev = new Button("<<");
    buttonPrev.addClickListener(this);
    buttonPrev.setWidth("50px");
    buttonPrev.setEnabled(false);
    buttonPrev.setDescription("Sebelumnya");

    buttonAdd = new Button("Tambah");
    buttonAdd.addClickListener(this);
    buttonAdd.setWidth("130px");
    buttonAdd.setDescription("Tambah Input Baru");

    buttonRemove = new Button("");
    buttonRemove.setIcon(new ThemeResource("icons/image/icon-delete.png"));
    buttonRemove.addClickListener(this);
    buttonRemove.setDescription("Hapus Data");

    construct();
  }
  private void initUI() {
    addStyleName(Reindeer.WINDOW_LIGHT);
    setModal(true);
    setHeight("90%");
    setWidth("60%");
    center();

    HorizontalLayout bottom = new HorizontalLayout();
    bottom.setStyleName(ExplorerLayout.THEME);
    bottom.setSizeFull();
    // bottom.setMargin(true);
    bottom.setSpacing(true);
    bottom.addStyleName(Runo.LAYOUT_DARKER);
    this.setContent(bottom);

    scheduleEventFieldGroup = new FieldGroup();
    scheduleEventFieldGroup.setBuffered(true);
    if (currentBeanItem != null) {
      scheduleEventFieldGroup.setItemDataSource(currentBeanItem);
    }

    line = new GridLayout(4, 20);
    line.addStyleName("v-gridlayout");
    line.setWidth("100%");
    line.setSpacing(true);
    line.setMargin(true);

    final Label lbTitle = CommonFieldHandler.createLable("计划名称:");
    line.addComponent(lbTitle);
    line.setComponentAlignment(lbTitle, Alignment.MIDDLE_RIGHT);
    final TextField txtTitle = new TextField();
    txtTitle.setWidth("80%");
    scheduleEventFieldGroup.bind(txtTitle, "name");
    line.addComponent(txtTitle, 1, 0, 3, 0);
    line.setComponentAlignment(txtTitle, Alignment.MIDDLE_LEFT);

    Label label2 = CommonFieldHandler.createLable("开始时间:");
    line.addComponent(label2, 0, 1, 0, 1);
    line.setComponentAlignment(label2, Alignment.MIDDLE_RIGHT);
    // 创建一个时间后台变化的listener
    BlurListener startTimeListener = createTimeReCountListener();
    DateField startDateField = CommonFieldHandler.createDateField("", false);
    scheduleEventFieldGroup.bind(startDateField, "startDate");
    startDateField.addBlurListener(startTimeListener);
    line.addComponent(startDateField, 1, 1, 1, 1);
    line.setComponentAlignment(startDateField, Alignment.MIDDLE_LEFT);

    Label label3 = CommonFieldHandler.createLable("估算时间:");
    line.addComponent(label3, 2, 1, 2, 1);
    line.setComponentAlignment(label3, Alignment.MIDDLE_RIGHT);
    HorizontalLayout hlay = new HorizontalLayout();
    final TextField estimateField = new TextField();
    estimateField.setValue("1");
    estimateField.setWidth("60px");
    estimateField.setNullSettingAllowed(false);
    BlurListener timeReCountListener = createTimeReCountListener();
    estimateField.addBlurListener(timeReCountListener);
    scheduleEventFieldGroup.bind(estimateField, "estimate");
    hlay.addComponent(estimateField);
    Map<Object, String> data = new HashMap();
    data.put(0, "天");
    data.put(1, "时");
    data.put(2, "分");
    // WW_TODO 估算时间单位
    ComboBox unit_cb = createComboBox(data, "55px");
    scheduleEventFieldGroup.bind(unit_cb, "estimateUnit");
    hlay.addComponent(unit_cb);
    line.addComponent(hlay, 3, 1, 3, 1);
    line.setComponentAlignment(hlay, Alignment.MIDDLE_LEFT);

    Label label4 = CommonFieldHandler.createLable("到期时间:");
    line.addComponent(label4, 0, 2, 0, 2);
    line.setComponentAlignment(label4, Alignment.MIDDLE_RIGHT);
    completionDateField = CommonFieldHandler.createDateField("", false);
    line.addComponent(completionDateField, 1, 2, 1, 2);
    line.setComponentAlignment(completionDateField, Alignment.MIDDLE_LEFT);
    scheduleEventFieldGroup.bind(completionDateField, "completionDate");
    //		line.setExpandRatio(completionDateField, 1.0f);

    Label label6 = CommonFieldHandler.createLable("消耗时间:");
    line.addComponent(label6, 2, 2, 2, 2);
    line.setComponentAlignment(label6, Alignment.MIDDLE_RIGHT);
    TextField gs1 = new TextField();
    gs1.setValue("20%");
    gs1.setInputPrompt("50%");
    scheduleEventFieldGroup.bind(gs1, "useup");
    line.addComponent(gs1, 3, 2, 3, 2);
    line.setComponentAlignment(gs1, Alignment.MIDDLE_LEFT);

    Label label5 = CommonFieldHandler.createLable("优先级:");
    //		label.setWidth("80px");
    line.addComponent(label5, 0, 3, 0, 3);
    line.setComponentAlignment(label5, Alignment.MIDDLE_RIGHT);
    Map<Object, String> dtp = new HashMap();
    dtp.put(0, "底");
    dtp.put(1, "中");
    dtp.put(2, "高");
    ComboBox selectPriority = createComboBox(dtp, "100px");
    //		NativeSelect select = new NativeSelect();
    //		select.addItem("无");
    //		select.addItem("0(最低)");
    //		String itemId = "1(中)";
    //		select.addItem(itemId);
    //		select.addItem("2(高)");
    selectPriority.setNullSelectionAllowed(false);
    selectPriority.select(2);
    scheduleEventFieldGroup.bind(selectPriority, "priority");
    line.addComponent(selectPriority, 1, 3, 1, 3);
    line.setComponentAlignment(selectPriority, Alignment.MIDDLE_LEFT);

    Label label1 = CommonFieldHandler.createLable("完成百分比:");
    line.addComponent(label1, 2, 3, 2, 3);
    line.setComponentAlignment(label1, Alignment.MIDDLE_RIGHT);
    TextField tf = new TextField();
    tf.setInputPrompt("50%");
    line.addComponent(tf, 3, 3, 3, 3);
    line.setComponentAlignment(tf, Alignment.MIDDLE_LEFT);

    Label label7 = CommonFieldHandler.createLable("关联日程:");
    line.addComponent(label7, 0, 4, 0, 4);
    line.setComponentAlignment(label7, Alignment.MIDDLE_RIGHT);
    CheckBox relatedCalendar_cb = new CheckBox();
    relatedCalendar_cb.setValue(false);
    line.addComponent(relatedCalendar_cb, 1, 4, 1, 4);
    line.setComponentAlignment(relatedCalendar_cb, Alignment.MIDDLE_LEFT);
    scheduleEventFieldGroup.bind(relatedCalendar_cb, "relatedCalendar");

    Label lbStatus = CommonFieldHandler.createLable("计划状态:");
    lbStatus.setWidth("20px");
    line.addComponent(lbStatus, 2, 4, 2, 4);
    line.setComponentAlignment(lbStatus, Alignment.MIDDLE_RIGHT);
    Map<Object, String> sta = new HashMap();
    sta.put(0, "新建");
    sta.put(1, "完成");
    sta.put(2, "关闭");
    sta.put(3, "取消");
    ComboBox sectStatus = createComboBox(sta, "100px");
    sectStatus.setNullSelectionAllowed(false);
    scheduleEventFieldGroup.bind(sectStatus, "status");
    line.addComponent(sectStatus, 3, 4, 3, 4);
    line.setComponentAlignment(sectStatus, Alignment.MIDDLE_LEFT);

    Label label8 = CommonFieldHandler.createLable("关联外部任务:");
    label8.setWidth("20px");
    line.addComponent(label8, 0, 5, 0, 5);
    line.setComponentAlignment(label8, Alignment.MIDDLE_RIGHT);
    CheckBox cb = new CheckBox();
    cb.setValue(true);
    line.addComponent(cb, 1, 5, 1, 5);
    line.setComponentAlignment(cb, Alignment.MIDDLE_LEFT);
    scheduleEventFieldGroup.bind(cb, "relatedTask");

    Label label9 = CommonFieldHandler.createLable("外部任务类型:");
    label9.setWidth("20px");
    line.addComponent(label9, 2, 5, 2, 5);
    line.setComponentAlignment(label9, Alignment.MIDDLE_RIGHT);
    Map<Object, String> oat = new HashMap();
    oat.put(0, "外包任务");
    oat.put(1, "外包任务-类型2");
    ComboBox select2 = createComboBox(oat, "150px");
    //		NativeSelect select2 = new NativeSelect();
    //		select2.addItem("外包任务");
    //		select2.addItem("外包任务-类型2");
    select2.setNullSelectionAllowed(false);
    scheduleEventFieldGroup.bind(select2, "type");
    line.addComponent(select2, 3, 5, 3, 5);
    line.setComponentAlignment(select2, Alignment.MIDDLE_LEFT);
    // select2.select("Timed");

    Label lbOwnGrp = CommonFieldHandler.createLable("计划分配团队:");
    lbOwnGrp.setWidth("20px");
    line.addComponent(lbOwnGrp, 0, 6, 0, 6);
    line.setComponentAlignment(lbOwnGrp, Alignment.MIDDLE_RIGHT);

    //		NativeSelect sectOwnGrp = new NativeSelect();
    Map<Object, String> groupsMap =
        teamService.queryTeamOfUser(LoginHandler.getLoggedInUser().getId());
    groupsMap.put("", "请选择");
    ComboBox sectOwnGrp = createComboBox(groupsMap, "150px");
    //		for (String p : groupsMap.keySet()) {
    //			String title = groupsMap.get(p);
    //			sectOwnGrp.addItem(p);
    //			sectOwnGrp.setItemCaption(p, title);
    //		}
    sectOwnGrp.setNullSelectionAllowed(false);
    ValueChangeListener valueChangeListener = createValueChangeListener();
    sectOwnGrp.addValueChangeListener(valueChangeListener);
    sectOwnGrp.setImmediate(true);
    scheduleEventFieldGroup.bind(sectOwnGrp, "assignedTeam");
    line.addComponent(sectOwnGrp, 1, 6, 1, 6);
    line.setComponentAlignment(sectOwnGrp, Alignment.MIDDLE_LEFT);

    final Label lbOwner = CommonFieldHandler.createLable("计划分配用户:");
    lbOwner.setWidth("20px");
    line.addComponent(lbOwner, 2, 6, 2, 6);
    line.setComponentAlignment(lbOwner, Alignment.MIDDLE_RIGHT);
    //		sectOwner = new NativeSelect();
    //		sectOwner.addItem("请选择");
    sectOwner.setNullSelectionAllowed(false);
    scheduleEventFieldGroup.bind(sectOwner, "assignedUser");
    line.addComponent(sectOwner, 3, 6, 3, 6);
    line.setComponentAlignment(sectOwner, Alignment.MIDDLE_LEFT);

    final Label lbDesc = CommonFieldHandler.createLable("计划描述:");
    lbDesc.setWidth("15px");
    line.addComponent(lbDesc, 0, 7, 0, 7);
    line.setComponentAlignment(lbDesc, Alignment.MIDDLE_RIGHT);
    final TextArea taDesc = CommonFieldHandler.createTextArea("");
    taDesc.setWidth("85%");
    taDesc.setHeight("290px");
    scheduleEventFieldGroup.bind(taDesc, "description");
    line.addComponent(taDesc, 1, 7, 3, 13);
    line.setComponentAlignment(taDesc, Alignment.MIDDLE_LEFT);

    //		CKEditorConfig config = new CKEditorConfig();

    final Button updateSave = new Button("保存");
    updateSave.addClickListener(
        new ClickListener() {
          @SuppressWarnings("unchecked")
          public void buttonClick(ClickEvent event) {
            // WW_TODO 修改保存到数据库
            Todo fieldGroupTodo = saveFieldGroupToDB();
            fireEvent(
                new SubmitEvent(
                    updateSave,
                    SubmitEvent.SUBMITTED,
                    scheduleEventFieldGroup.getItemDataSource()));

            // close popup window
            close();
            /*
             * Todo fieldGroupTodo = saveFieldGroupToDB(); //reflash current
             * Item copyBeanValueToContainer(hContainer,(BeanItem<Todo>)(
             * scheduleEventFieldGroup.getItemDataSource())); //刷新日历
             * main.refreshCalendarView(); Notification.show("保存成功",
             * Notification.Type.HUMANIZED_MESSAGE); //如果有外部流程,启动外部流程 if
             * (fieldGroupTodo.getRelatedTask()) { ViewToolManager
             * .showPopupWindow(new ActivityStartPopupWindow( "1111")); }
             */
            if (fieldGroupTodo.getRelatedTask()) {
              ViewToolManager.showPopupWindow(new ActivityStartPopupWindow("1111"));
            }
          }
        });
    line.addComponent(updateSave, 3, 14, 3, 14);
    line.setComponentAlignment(updateSave, Alignment.MIDDLE_RIGHT);
    //		line.setExpandRatio(updateSave, 1.0f);

    bottom.addComponent(line);
  }
  @Override
  public void init() {
    inputUserName = new TextField("Nama Untuk Log In");
    inputUserName.setDescription("Nama yang digunakan untuk log in");
    inputUserName.setImmediate(true);
    inputUserName.setWidth(function.FORM_WIDTH);
    inputUserName.setMaxLength(10);
    inputUserName.addValueChangeListener(this);
    inputName = new TextField("Nama Lengkap");
    inputName.setDescription("Nama lengkap pengguna");
    inputName.setImmediate(true);
    inputName.addValueChangeListener(this);
    inputName.setWidth(function.FORM_WIDTH);
    selectRole = new ComboBox("Role Pengguna");
    selectRole.setImmediate(true);
    selectRole.setDescription("Role dari pengguna");
    selectRole.addValueChangeListener(this);
    selectRole.setWidth(function.FORM_WIDTH);
    selectRole.setNullSelectionAllowed(false);
    inputEmployeeNum = new TextField("Nomor pegawai");
    inputEmployeeNum.setDescription("Nomor pegawai");
    inputEmployeeNum.addValueChangeListener(this);
    inputEmployeeNum.setImmediate(true);
    inputEmployeeNum.setWidth(function.FORM_WIDTH);
    inputTitle = new TextField("Jabatan");
    inputTitle.setDescription("Jabatan dari pengguna");
    inputTitle.addValueChangeListener(this);
    inputTitle.setImmediate(true);
    inputTitle.setWidth(function.FORM_WIDTH);
    inputPhoneNumber = new TextField("Nomor Telepon");
    inputPhoneNumber.setDescription("Nomor Telepon yang bisa dihubungi");
    inputPhoneNumber.setImmediate(true);
    inputPhoneNumber.addValueChangeListener(this);
    inputPhoneNumber.setWidth(function.FORM_WIDTH);
    inputAddress = new TextArea("Alamat");
    inputAddress.setDescription("Alamat pengguna");
    inputAddress.addValueChangeListener(this);
    inputAddress.setImmediate(true);
    inputAddress.setWidth(function.FORM_WIDTH);
    inputPassword1 = new PasswordField("Password");
    inputPassword1.setDescription("Masukan password untuk pengguna");
    inputPassword1.addValueChangeListener(this);
    inputPassword1.setImmediate(true);
    inputPassword1.setWidth(function.FORM_WIDTH);
    inputPassword2 = new PasswordField("Ulangi Password");
    inputPassword2.setDescription("Masukan password untuk pengguna");
    inputPassword2.addValueChangeListener(this);
    inputPassword2.setImmediate(true);
    inputPassword2.setWidth(function.FORM_WIDTH);
    inputSika = new TextField("SIKA");
    inputSika.setDescription("Masukan nomor SIKA");
    inputSika.addValueChangeListener(this);
    inputSika.setImmediate(true);
    inputSika.setWidth(function.FORM_WIDTH);

    labelError =
        new Label() {
          {
            setVisible(false);
            addStyleName("form-error");
            setContentMode(ContentMode.HTML);
          }
        };
    buttonSubmit = new Button("Simpan");
    buttonSubmit.addClickListener(this);

    buttonSaveEdit = new Button("Simpan Perubahan");
    buttonSaveEdit.addClickListener(this);
    buttonReset = new Button("Reset Form");
    buttonReset.addClickListener(this);
    buttonCancel = new Button("Batalkan");
    buttonCancel.addClickListener(this);
    buttonActivation = new Button("");
    buttonActivation.addClickListener(this);
    buttonResetPassword = new Button("Reset Password");
    buttonResetPassword.addClickListener(this);
    construct();
  }
  public TaskDashboardViewImpl() {
    this.withMargin(new MarginInfo(false, true, true, true));
    taskSearchPanel = new TaskSearchPanel();
    MHorizontalLayout groupWrapLayout = new MHorizontalLayout();
    groupWrapLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);

    groupWrapLayout.addComponent(new Label("Filter:"));
    final TaskSavedFilterComboBox savedFilterComboBox = new TaskSavedFilterComboBox();
    savedFilterComboBox.addQuerySelectListener(
        new SavedFilterComboBox.QuerySelectListener() {
          @Override
          public void querySelect(SavedFilterComboBox.QuerySelectEvent querySelectEvent) {
            List<SearchFieldInfo> fieldInfos = querySelectEvent.getSearchFieldInfos();
            TaskSearchCriteria criteria =
                SearchFieldInfo.buildSearchCriteria(TaskSearchCriteria.class, fieldInfos);
            criteria.setProjectid(new NumberSearchField(CurrentProjectVariables.getProjectId()));
            EventBusFactory.getInstance()
                .post(new TaskEvent.SearchRequest(TaskDashboardViewImpl.this, criteria));
          }
        });
    groupWrapLayout.addComponent(savedFilterComboBox);

    groupWrapLayout.addComponent(new Label("Sort:"));
    final ComboBox sortCombo = new ValueComboBox(false, DESCENDING, ASCENDING);
    sortCombo.setWidth("100px");
    sortCombo.addValueChangeListener(
        new Property.ValueChangeListener() {
          @Override
          public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
            String sortValue = (String) sortCombo.getValue();
            if (ASCENDING.equals(sortValue)) {
              sortDirection = SearchCriteria.ASC;
            } else {
              sortDirection = SearchCriteria.DESC;
            }
            queryAndDisplayTasks();
          }
        });
    sortDirection = SearchCriteria.DESC;
    groupWrapLayout.addComponent(sortCombo);

    groupWrapLayout.addComponent(new Label("Group by:"));
    final ComboBox groupCombo =
        new ValueComboBox(false, GROUP_DUE_DATE, GROUP_START_DATE, PLAIN_LIST);
    groupCombo.setWidth("100px");
    groupCombo.addValueChangeListener(
        new Property.ValueChangeListener() {
          @Override
          public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
            groupByState = (String) groupCombo.getValue();
            queryAndDisplayTasks();
          }
        });
    groupByState = GROUP_DUE_DATE;
    groupWrapLayout.addComponent(groupCombo);

    taskSearchPanel.addHeaderRight(groupWrapLayout);

    Button exportBtn = new Button("Export");
    final SplitButton exportSplitBtn = new SplitButton(exportBtn);
    exportBtn.addClickListener(
        new Button.ClickListener() {
          @Override
          public void buttonClick(ClickEvent event) {
            exportSplitBtn.setPopupVisible(true);
          }
        });
    exportSplitBtn.addStyleName(UIConstants.THEME_GREEN_LINK);
    OptionPopupContent popupButtonsControl = new OptionPopupContent();

    Button exportPdfBtn = new Button("PDF");
    exportPdfBtn.setIcon(FontAwesome.FILE_PDF_O);
    FileDownloader pdfFileDownloder = new FileDownloader(buildStreamSource(ReportExportType.PDF));
    pdfFileDownloder.extend(exportPdfBtn);
    popupButtonsControl.addOption(exportPdfBtn);

    Button exportExcelBtn = new Button("Excel");
    exportExcelBtn.setIcon(FontAwesome.FILE_EXCEL_O);
    FileDownloader excelFileDownloader =
        new FileDownloader(buildStreamSource(ReportExportType.EXCEL));
    excelFileDownloader.extend(exportExcelBtn);
    popupButtonsControl.addOption(exportExcelBtn);

    exportSplitBtn.setContent(popupButtonsControl);
    groupWrapLayout.with(exportSplitBtn);

    Button newTaskBtn =
        new Button(
            AppContext.getMessage(TaskI18nEnum.BUTTON_NEW_TASK),
            new Button.ClickListener() {
              private static final long serialVersionUID = 1L;

              @Override
              public void buttonClick(final ClickEvent event) {
                SimpleTask newTask = new SimpleTask();
                newTask.setProjectid(CurrentProjectVariables.getProjectId());
                UI.getCurrent().addWindow(new TaskAddWindow(newTask));
              }
            });
    newTaskBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.TASKS));
    newTaskBtn.setIcon(FontAwesome.PLUS);
    newTaskBtn.setDescription(AppContext.getMessage(TaskI18nEnum.BUTTON_NEW_TASKGROUP));
    newTaskBtn.setStyleName(UIConstants.THEME_GREEN_LINK);
    groupWrapLayout.addComponent(newTaskBtn);

    Button advanceDisplayBtn = new Button();
    advanceDisplayBtn.setWidth("50px");
    advanceDisplayBtn.setIcon(FontAwesome.SITEMAP);
    advanceDisplayBtn.setDescription(
        AppContext.getMessage(TaskGroupI18nEnum.ADVANCED_VIEW_TOOLTIP));

    Button calendarBtn =
        new Button(
            null,
            new Button.ClickListener() {
              @Override
              public void buttonClick(ClickEvent clickEvent) {
                EventBusFactory.getInstance()
                    .post(new TaskEvent.GotoCalendarView(TaskDashboardViewImpl.this));
              }
            });
    calendarBtn.setWidth("50px");
    calendarBtn.setDescription("Calendar View");
    calendarBtn.setIcon(FontAwesome.CALENDAR);

    Button chartDisplayBtn =
        new Button(
            null,
            new Button.ClickListener() {
              private static final long serialVersionUID = -5707546605789537298L;

              @Override
              public void buttonClick(ClickEvent event) {
                displayGanttChartView();
              }
            });
    chartDisplayBtn.setWidth("50px");
    chartDisplayBtn.setDescription("Display Gantt chart");
    chartDisplayBtn.setIcon(FontAwesome.BAR_CHART_O);

    Button kanbanBtn =
        new Button(
            null,
            new Button.ClickListener() {
              @Override
              public void buttonClick(ClickEvent clickEvent) {
                displayKanbanView();
              }
            });
    kanbanBtn.setWidth("50px");
    kanbanBtn.setDescription("Kanban View");
    kanbanBtn.setIcon(FontAwesome.TH);

    ToggleButtonGroup viewButtons = new ToggleButtonGroup();
    viewButtons.addButton(advanceDisplayBtn);
    viewButtons.addButton(calendarBtn);
    viewButtons.addButton(kanbanBtn);
    viewButtons.addButton(chartDisplayBtn);
    viewButtons.setDefaultButton(advanceDisplayBtn);
    groupWrapLayout.addComponent(viewButtons);

    mainLayout = new MHorizontalLayout().withFullHeight().withFullWidth();
    wrapBody = new MVerticalLayout().withMargin(new MarginInfo(false, true, true, false));
    rightColumn =
        new MVerticalLayout()
            .withWidth("350px")
            .withMargin(new MarginInfo(true, false, false, false));
    mainLayout.with(wrapBody, rightColumn).expand(wrapBody);
  }
Beispiel #16
0
  private void buildView() {
    logger.info(
        "Company ID : "
            + companyId
            + " | User Name : "
            + userName
            + " > "
            + "Painting Attendance Process UI");
    // Material Components Definition
    btnsaveAttenProc.setVisible(false);
    cbPayPeried = new GERPComboBox("Pay Period");
    cbPayPeried.setImmediate(true);
    cbPayPeried.setNullSelectionAllowed(false);
    cbPayPeried.setWidth("130");
    cbPayPeried.setItemCaptionPropertyId("periodName");
    cbPayPeried.addValueChangeListener(
        new Property.ValueChangeListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            Object itemId = event.getProperty().getValue();
            if (itemId != null) {
              BeanItem<?> item = (BeanItem<?>) cbPayPeried.getItem(itemId);
              payPeriodList = (PayPeriodDM) item.getBean();
              payPeriodId = payPeriodList.getPayPeriodId();
              loadStartandEndDates();
            }
          }
        });
    btnsaveAttenProc.setCaption("Save");
    tblMstScrSrchRslt.addItemClickListener(
        new ItemClickListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void itemClick(ItemClickEvent event) {
            if (tblMstScrSrchRslt.isSelected(event.getItemId())) {
              tblMstScrSrchRslt.setImmediate(true);
              btnsaveAttenProc.setStyleName("savebt");
              resetFields();
            } else {
              ((AbstractSelect) event.getSource()).select(event.getItemId());
              btnsaveAttenProc.setStyleName("savebt");
              readonlyfalse();
              editAttenProc();
              readonlytrue();
            }
          }
        });
    hlPageHdrContainter.addComponent(btnsaveAttenProc);
    hlPageHdrContainter.setComponentAlignment(btnsaveAttenProc, Alignment.MIDDLE_RIGHT);
    tfProcessPeriod = new GERPTextField("Process Period");
    tfProcessPeriod.setWidth("170");
    tfProcessPeriod.setReadOnly(true);
    cbBranch = new GERPComboBox("Branch");
    cbBranch.setWidth("170");
    cbBranch.setNullSelectionAllowed(false);
    cbBranch.setItemCaptionPropertyId("branchName");
    cbBranch.setImmediate(true);
    cbBranch.setValue(0L);
    cbBranch.addValueChangeListener(
        new Property.ValueChangeListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            Object itemId = event.getProperty().getValue();
            if (itemId != null) {
              loadEmployeeList();
            }
          }
        });
    btnsaveAttenProc.addClickListener(
        new ClickListener() {
          // Click Listener for Add and Update
          private static final long serialVersionUID = 6551953728534136363L;

          @Override
          public void buttonClick(ClickEvent event) {
            saveattapprove();
          }
        });
    cbEmployeeName = new GERPComboBox("Employee Name");
    cbEmployeeName.setItemCaptionPropertyId("firstname");
    cbEmployeeName.setWidth("200");
    cbEmployeeName.setImmediate(true);
    cbEmployeeName.setNullSelectionAllowed(false);
    btnSearchStaff = new GERPButton("Search Employee", "searchbt", this);
    btnAttendanceProc = new GERPButton("Run Attendance Process", "savebt", this);
    btnAttendanceProc.addClickListener(
        new ClickListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void buttonClick(ClickEvent event) {
            // TODO Auto-generated method stub
            loadAttendenceProcess();
            // new AttendenceApprove();
          }
        });
    btnSearch.setVisible(false);
    hlSearchLayout = new GERPAddEditHLayout();
    assembleSearchLayout();
    hlSrchContainer.addComponent(GERPPanelGenerator.createPanel(hlSearchLayout));
    resetFields();
    loadAttendanceProcessBranchList();
    loadPayPeriod();
    loadSrchRslt();
  }
Beispiel #17
0
  private Panel designLoginPanel() {

    final Panel loginPanel = new Panel("Login");
    HashMap<String, String> users = null;

    loginPanel.setWidth("100%");
    loginPanel.setHeight("100%");
    // Create absolute layout specifying its properties
    final AbsoluteLayout loginLayout = new AbsoluteLayout();
    loginLayout.setSizeFull();
    // Create components Objects and specify their properties
    int startLeft = 200, startTop = 300;
    try {
      users = getLoginInfo("jdbc:mysql://localhost:3306/", "linkeval", "root", "mofo");
    } catch (SQLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    Button btnLogin = new Button("Login");
    final ComboBox cmbUser = new ComboBox("Select your USER ID");
    final ComboBox cmbTask = new ComboBox("Select your TASK");
    cmbUser.setNullSelectionAllowed(false);
    cmbTask.setNullSelectionAllowed(false);
    // Add data
    Iterator it = users.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry pairs = (Map.Entry) it.next();
      cmbUser.addItem(pairs.getKey());
      cmbUser.setItemCaption(pairs.getKey(), pairs.getValue().toString());
      it.remove(); // avoids a ConcurrentModificationException
    }

    cmbUser.setValue(cmbUser.getItemIds().iterator().next());

    // Listeners

    btnLogin.addClickListener(
        new Button.ClickListener() {
          @Override
          public void buttonClick(ClickEvent event) {
            userId =
                String.valueOf(
                    cmbUser
                        .getValue()); // which is his Id in tabel as this combo box shows names as
            // captions and Ids as values
            userName = cmbUser.getItemCaption(userId);
            task = String.valueOf(cmbTask.getValue());
            if (task != "" && userId != "") {
              VerticalSplitPanel vsplit = new VerticalSplitPanel();
              displayedPanel = designMainPanel();
              vsplit.setSecondComponent(displayedPanel);
              vsplit.setFirstComponent(allLinksDetails());
              UI.getCurrent().setContent(vsplit);
            }
          }
        });
    cmbUser.addFocusListener(
        new FocusListener() {

          @Override
          public void focus(FocusEvent event) {
            // TODO Auto-generated method stub
            cmbUser.setValue(cmbUser.getItemIds().iterator().next());
          }
        });
    cmbUser.addValueChangeListener(
        new ValueChangeListener() {
          @Override
          public void valueChange(final ValueChangeEvent event) {
            final String valueString = String.valueOf(event.getProperty().getValue());

            try {
              List<String> tasks =
                  getTasksInfo(
                      "jdbc:mysql://localhost:3306/", "linkeval", "root", "mofo", valueString);

              cmbTask.removeAllItems();
              if (tasks != null) {
                for (String task : tasks) {
                  cmbTask.addItem(task);
                }
                cmbTask.setValue(cmbTask.getItemIds().iterator().next());
              }
            } catch (SQLException e) {
              // TODO Auto-generated catch block
              Notification.show(e.getMessage());
            }
          }
        });

    loginLayout.addComponent(cmbUser, "left: 800px; top: 200px;");
    loginLayout.addComponent(cmbTask, "left: 800px; top: 300px;");
    loginLayout.addComponent(btnLogin, "left: 900px; top: 400px;");

    loginPanel.setContent(loginLayout);

    return loginPanel;
  }
  @Override
  public void init() {
    buttonCancel = new Button("Batalkan");
    buttonCancel.addClickListener(this);

    buttonShow = new Button("Tampilkan Laporan");
    buttonShow.addClickListener(this);

    buttonPrint = new Button("Cetak");
    buttonPrint.addClickListener(this);
    buttonPrint.setIcon(new ThemeResource("icons/image/icon-print.png"));

    opener = new BrowserWindowOpener(ReportPrint.class);
    opener.setFeatures("height=200,width=400,resizable");
    // A button to open the printer-friendly page.
    opener.extend(buttonPrint);

    DateTime now = DateTime.now();
    Date beginYear =
        now.withDayOfYear(now.dayOfYear().getMinimumValue())
            .withHourOfDay(now.hourOfDay().getMinimumValue())
            .toDate();
    Date endYear =
        now.withDayOfYear(now.dayOfYear().getMaximumValue())
            .withHourOfDay(now.hourOfDay().getMaximumValue())
            .toDate();

    selectStartDate = new DateField("Dari Tanggal");
    selectStartDate.setImmediate(true);
    selectStartDate.setWidth(function.FORM_WIDTH);
    selectStartDate.setValue(beginYear);

    selectEndDate = new DateField("Hingga Tanggal");
    selectEndDate.setImmediate(true);
    selectEndDate.setWidth(function.FORM_WIDTH);
    selectEndDate.setValue(endYear);
    selectAcceptance = new OptionGroup("Persetujuan");
    Item itemType1 = selectAcceptance.addItem("diterima");
    Item itemType2 = selectAcceptance.addItem("belumditerima");
    selectAcceptance.setImmediate(true);
    selectAcceptance.setValue("diterima");

    selectAcceptance.setItemCaption("diterima", "Barang Kadaluarsa Disetujui");

    selectAcceptance.setItemCaption("belumditerima", "Barang Kadaluarsa Belum Disetujui");
    selectContent = new ComboBox("Pilih Tampilan");
    selectContent.setImmediate(true);
    selectContent.addItem(ReportContent.CHART);
    selectContent.addItem(ReportContent.TABLE);
    selectContent.addItem(ReportContent.TABLE_CHART);
    selectContent.setItemCaption(ReportContent.CHART, "Tampilkan Chart");
    selectContent.setItemCaption(ReportContent.TABLE, "Tampilkan Tabel");
    selectContent.setItemCaption(ReportContent.TABLE_CHART, "Tampilkan Tabel dan Chart");
    selectContent.setItemCaption(4, "Minggu Ke-4");
    selectContent.setValue(ReportContent.TABLE);

    selectAcceptance.addValueChangeListener(this);
    selectStartDate.addValueChangeListener(this);
    selectEndDate.addValueChangeListener(this);
    selectContent.addValueChangeListener(this);
    updateWindowOpener();

    construct();
  }