public void setStatuses() {
   setSelectItems(siDocStatus, DocFlow.user_obj.getStatuses(DocFlow.system_id));
   try {
     siDocStatus.setValue(mpCurrentStatus.get(DocFlow.system_id).toString());
   } catch (Exception e) {
   }
 }
    private void reset(final UploadComponentOptions options) {
      resetComponents(options);
      clear();

      final Set<String> types = components.keySet();
      currentType = types.iterator().next();

      parentCanvas = new Canvas();
      layout = new VLayout();
      final SelectItem typeItem = new SelectItem("uploadType", "Upload Type");
      typeItem.setValueMap(types.toArray(new String[types.size()]));
      typeItem.setValue(currentType);
      typeItem.setWidth(250);
      typeItem.addChangedHandler(
          new ChangedHandler() {
            public void onChanged(final ChangedEvent event) {
              currentType = typeItem.getValue().toString();
              update();
            }
          });
      final Form form =
          new Form(
              DomConstants.buildConstant(DomConstants.UPLOAD_COMPONENT_TYPE, uploadComponentNumber),
              typeItem);
      form.setPadding(0);
      form.setMargin(0);
      form.setCellSpacing(0);
      form.setCellPadding(0);

      form.setAlign(Alignment.RIGHT);
      form.setWidth(350);
      form.setHeight(20);
      final HLayout header = new HLayout();
      header.setAlign(Alignment.RIGHT);
      header.addMember(form);
      header.setHeight(20);

      layout.setAlign(Alignment.RIGHT);
      layout.addMember(header);
      layout.addMember(parentCanvas);
      layout.setGroupTitle("File Chooser");
      layout.setIsGroup(true);
      layout.setHeight("185px");
      layout.setPadding(2);
      layout.setLayoutAlign(Alignment.CENTER);
      layout.setAlign(Alignment.CENTER);

      for (final UploadComponent uploadComponent : components.values()) {
        final Canvas childCanvas = uploadComponent.get();
        childCanvas.hide();
        parentCanvas.addChild(childCanvas);
      }
      update();
      wrapperLayout.addMember(layout);
    }
Beispiel #3
0
  /** Prepares the language form */
  private Tab setupLanguage(final ValuesManager vm) {
    Tab languageTab = new Tab();
    languageTab.setTitle(I18N.message(LANGUAGE));

    SelectItem languageItem = ItemFactory.newLanguageSelector(LANGUAGE, false, true);
    languageItem.setTitle(I18N.message("defaultlang"));
    languageItem.setRequired(true);
    languageItem.setValue(I18N.getLocale());

    final DynamicForm languageForm = new DynamicForm();
    languageForm.setID("languageForm");
    languageForm.setValuesManager(vm);
    languageForm.setFields(languageItem);
    languageForm.setDisabled(true);
    languageTab.setPane(languageForm);
    return languageTab;
  }
Beispiel #4
0
 public void clearFields() {
   LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
   map.put("-1", "---");
   try {
     siCustomerType.setValueMap(map);
     siCustomerType.setValue("-1");
     addrComp.getSiRegion().setValue("-1");
     addrComp.getSiSubregion().setValueMap(map);
     addrComp.getSiSubregion().setValue("-1");
     addrComp.getSiCity().setValueMap(map);
     addrComp.getSiCity().setValue("-1");
     addrComp.getSiStreet().setValueMap(map);
     addrComp.getSiStreet().setValue("-1");
   } catch (Exception e) {
     // TODO: handle exception
   }
 }
Beispiel #5
0
  private void creteriaChanged() {
    siZones.setValue((Integer) null);
    Criteria cr = new Criteria();
    addZoneCriteria(cr, addrComp.getSiRegion(), "regionid");
    addZoneCriteria(cr, addrComp.getSiSubregion(), "subregionid");
    addZoneCriteria(cr, addrComp.getSiCity(), "cityid");
    addZoneCriteria(cr, addrComp.getSiStreet(), "streetid");
    cr.addCriteria("uniq", SC.generateID());
    siZones.setOptionCriteria(cr);
    siZones.fetchData(
        new DSCallback() {

          @Override
          public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (response.getData() != null && response.getData().length > 0)
              siZones.setValue(response.getData()[0].getAttributeAsDouble(siZones.getValueField()));
          }
        });
  }
 public void setDocState(int state) {
   siDocStatus.setValue("" + state);
 }
  private void refresh() {
    form.clearValues();
    form.clearErrors(false);

    if (form != null) form.destroy();

    if (formsContainer.contains(form)) formsContainer.removeChild(form);

    form = new DynamicForm();
    form.setNumCols(2);
    form.setTitleOrientation(TitleOrientation.TOP);

    TextItem include = ItemFactory.newTextItem("include", "include", account.getIncludes());
    include.addChangedHandler(changedHandler);

    TextItem exclude = ItemFactory.newTextItem("exclude", "exclude", account.getExcludes());
    exclude.addChangedHandler(changedHandler);

    TextItem folder = ItemFactory.newTextItem("mailfolder", "mailfolder", account.getMailFolder());
    folder.addChangedHandler(changedHandler);

    SelectItem format = ItemFactory.newSelectItem("format", "format");
    LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
    map.put("0", I18N.message("multiplefiles"));
    map.put("1", I18N.message("singleeml"));
    format.setValueMap(map);
    format.addChangedHandler(changedHandler);
    format.setValue(Integer.toString(account.getFormat()));

    CheckboxItem deleteFomMailbox = new CheckboxItem();
    deleteFomMailbox.setName("delete");
    deleteFomMailbox.setTitle(I18N.message("deletefrommailbox"));
    deleteFomMailbox.setRedrawOnChange(true);
    deleteFomMailbox.setWidth(50);
    deleteFomMailbox.addChangedHandler(changedHandler);
    deleteFomMailbox.setValue(account.isDeleteFromMailbox());

    final DateItem startDate = ItemFactory.newDateItem("startdate", "earliestdate");
    startDate.addChangedHandler(changedHandler);
    startDate.setValue(account.getStartDate());
    startDate.setUseMask(false);
    startDate.setShowPickerIcon(true);
    startDate.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATE);
    startDate.addKeyPressHandler(
        new KeyPressHandler() {
          @Override
          public void onKeyPress(KeyPressEvent event) {
            if ("backspace".equals(event.getKeyName().toLowerCase())
                || "delete".equals(event.getKeyName().toLowerCase())) {
              startDate.clearValue();
              startDate.setValue((Date) null);
              changedHandler.onChanged(null);
            } else {
              changedHandler.onChanged(null);
            }
          }
        });

    form.setItems(folder, format, include, exclude, startDate, deleteFomMailbox);

    formsContainer.addMember(form);
  }