private AbstractField createBooleanField(Object propertyId) {
   ComboBox booleanSelect = new ComboBox();
   booleanSelect.addItem(true);
   booleanSelect.addItem(false);
   if (owner.getFilterDecorator() != null) {
     /* Add possible 'view all' item */
     if (owner.getFilterDecorator().getAllItemsVisibleString() != null) {
       Object nullItem = booleanSelect.addItem();
       booleanSelect.setNullSelectionItemId(nullItem);
       booleanSelect.setItemCaption(
           nullItem, owner.getFilterDecorator().getAllItemsVisibleString());
     }
     String caption = owner.getFilterDecorator().getBooleanFilterDisplayName(propertyId, true);
     booleanSelect.setItemCaption(true, caption == null ? "true" : caption);
     Resource icon = owner.getFilterDecorator().getBooleanFilterIcon(propertyId, true);
     if (icon != null) {
       booleanSelect.setItemIcon(true, icon);
     }
     caption = owner.getFilterDecorator().getBooleanFilterDisplayName(propertyId, false);
     booleanSelect.setItemCaption(false, caption == null ? "false" : caption);
     icon = owner.getFilterDecorator().getBooleanFilterIcon(propertyId, false);
     if (icon != null) {
       booleanSelect.setItemIcon(false, icon);
     }
   } else {
     booleanSelect.setItemCaption(true, "true");
     booleanSelect.setItemCaption(false, "false");
   }
   booleans.put(booleanSelect, propertyId);
   return booleanSelect;
 }
 @SuppressWarnings({"rawtypes", "unchecked"})
 private AbstractField createEnumField(Class<?> type, Object propertyId) {
   ComboBox enumSelect = new ComboBox();
   /* Add possible 'view all' item */
   if (owner.getFilterDecorator() != null
       && owner.getFilterDecorator().getAllItemsVisibleString() != null) {
     Object nullItem = enumSelect.addItem();
     enumSelect.setNullSelectionItemId(nullItem);
     enumSelect.setItemCaption(nullItem, owner.getFilterDecorator().getAllItemsVisibleString());
   }
   /* Add items from enumeration */
   for (Object o : EnumSet.allOf((Class<Enum>) type)) {
     enumSelect.addItem(o);
     if (owner.getFilterDecorator() != null) {
       String caption = owner.getFilterDecorator().getEnumFilterDisplayName(propertyId, o);
       enumSelect.setItemCaption(o, caption == null ? o.toString() : caption);
       Resource icon = owner.getFilterDecorator().getEnumFilterIcon(propertyId, o);
       if (icon != null) {
         enumSelect.setItemIcon(o, icon);
       }
     } else {
       enumSelect.setItemCaption(o, o.toString());
     }
   }
   enums.put(enumSelect, propertyId);
   return enumSelect;
 }
Esempio n. 3
0
 private void fillcbAcivo(String id_auxiliar, String grupoContable) {
   cb_Activos.removeAllItems();
   cb_Activos.setNullSelectionAllowed(false);
   cb_Activos.setInputPrompt("Seleccione el Activo");
   for (ActivosModel activo : activo_impl.activos_by_auxiliar(id_auxiliar, grupoContable)) {
     cb_Activos.addItem(activo.getACT_Codigo_Activo());
     cb_Activos.setItemCaption(activo.getACT_Codigo_Activo(), activo.getACT_Nombre_Activo());
   }
   String a = "ALL";
   cb_Activos.addItem(a);
   cb_Activos.setItemCaption(a, "Todos los Activos");
 }
 @Override
 public void setSelectGoodsData(Map<String, String> data) {
   for (Map.Entry<String, String> entry : data.entrySet()) {
     inputGoodsSelect.addItem(entry.getKey());
     inputGoodsSelect.setItemCaption(entry.getKey(), entry.getValue());
   }
 }
Esempio n. 5
0
  public void buttonClick(ClickEvent event) {
    try {
      if (event.getButton().equals(saveBtn)) {
        save();
        close();
      } else if (event.getButton().equals(addBtn)) {
        LightProcessDefinition lpd = (LightProcessDefinition) processesComboBox.getValue();
        addTableRow(lpd);
        processesComboBox.removeItem(lpd);
      } else if (event.getButton().equals(deleteBtn)) {
        delete();
        close();
      } else if (event.getButton() instanceof TableLinkButton) {
        LightProcessDefinition lpd =
            (LightProcessDefinition) ((TableLinkButton) event.getButton()).getTableValue();
        table.removeItem(lpd);
        processesComboBox.addItem(lpd);
        processesComboBox.setItemCaption(
            lpd, lpd.getLabel() + " (version " + lpd.getVersion() + ")");
      } else {
        close();
      }

    } catch (Exception ex) {
      ex.printStackTrace();
      showError(ex.getMessage());
    }
  }
Esempio n. 6
0
  public void refreshTable() {
    try {
      table.removeAllItems();
      Collection<LightProcessDefinition> processes =
          ProcessbaseApplication.getCurrent()
              .getBpmModule()
              .getLightProcessDefinitions(ProcessState.ENABLED);

      for (LightProcessDefinition pd : processes) {
        if (pd.getCategoryNames().contains(category.getName())) {
          addTableRow(pd);
        } else {
          Item woItem = processesComboBox.addItem(pd);
          String caption = pd.getLabel() != null ? pd.getLabel() : pd.getName();
          processesComboBox.setItemCaption(pd, caption + " (version " + pd.getVersion() + ")");
        }
      }
      table.setSortContainerPropertyId("name");
      table.setSortAscending(true);
      table.sort();
    } catch (Exception ex) {
      ex.printStackTrace();
      showError(ex.getMessage());
    }
  }
Esempio n. 7
0
 /** Llenado del Combo Box */
 private void fillcbGrupo() {
   cb_Grupo.setNullSelectionAllowed(false);
   cb_Grupo.setInputPrompt("Seleccione un Grupo Contable");
   for (GruposContablesModel grupo : grupo_impl.getalls()) {
     cb_Grupo.addItem(grupo.getGRC_Grupo_Contable());
     cb_Grupo.setItemCaption(grupo.getGRC_Grupo_Contable(), grupo.getGRC_Nombre_Grupo_Contable());
   }
 }
  @Override
  public void setComboBoxData(ComboDataList list) {
    Map<String, String> roleList = list.getRoleList();

    for (Map.Entry<String, String> entry : roleList.entrySet()) {
      selectRole.addItem(entry.getKey());
      selectRole.setItemCaption(entry.getKey(), entry.getValue());
    }
  }
Esempio n. 9
0
 private void fillcbAuxiliar(String id_grupo) {
   cb_Auxiliar.removeAllItems();
   cb_Auxiliar.setNullSelectionAllowed(false);
   cb_Auxiliar.setInputPrompt("Seleccione el Auxiliar Contable");
   for (AuxiliaresContablesModel auxiliar : auxiliar_impl.getreporte(id_grupo)) {
     cb_Auxiliar.addItem(auxiliar.getAUC_Auxiliar_Contable());
     cb_Auxiliar.setItemCaption(
         auxiliar.getAUC_Auxiliar_Contable(), auxiliar.getAUC_Nombre_Auxiliar_Contable());
   }
 }
Esempio n. 10
0
    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));
        }
      }
    }
Esempio n. 11
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;
  }
  public GestionNotificacion() {
    super();
    setMargin(true);
    setSpacing(true);
    setSizeFull();
    HorizontalL h1 = new HorizontalL();
    id = new CampoRuc();
    razonSocial = new CampoRazonSocial();
    razonSocial.setWidth("320px");
    direccion = new CampoDireccion();
    direccion.setWidth("450px");
    correoElectronico = new CampoCorreoElectronico();
    correoElectronico.setWidth("260px");

    tipoIdentificacion = new ComboBox();
    tipoIdentificacion.addItem("04");
    tipoIdentificacion.addItem("05");
    tipoIdentificacion.addItem("06");
    tipoIdentificacion.addItem("07");
    tipoIdentificacion.addItem("08");
    tipoIdentificacion.setItemCaption("04", "RUC");
    tipoIdentificacion.setItemCaption("05", "CEDULA");
    tipoIdentificacion.setItemCaption("06", "PASAPORTE");
    tipoIdentificacion.setItemCaption("07", "CONSUMIDOR FINAL");
    tipoIdentificacion.setItemCaption("08", "IDENTIFICADOR EXTERIOR");
    tipoIdentificacion.setNullSelectionAllowed(false);
    tipoIdentificacion.setValue("04");
    tipoIdentificacion.setWidth("140px");

    h1.addComponent(tipoIdentificacion, id);
    h1.addComponent("Razón Social", razonSocial);
    // h1.addComponent("Dirección",direccion);
    h1.addComponent("Email", correoElectronico);
    botonAnadir = new BotonAnadir();

    addComponent(h1);
    setComponentAlignment(h1, Alignment.TOP_CENTER);
    HorizontalL h2 = new HorizontalL();
    h2.addComponent("direccion", direccion);
    h2.addComponent(botonAnadir);
    addComponent(h2);

    grid = new Grid();
    beanItemC = new BeanItemContainer<DemografiaCliente>(DemografiaCliente.class);
    grid.setContainerDataSource(beanItemC);
    //		DemografiaCliente d=new DemografiaCliente();
    //		beanItemC.addBean(d);
    grid.removeColumn("entidadEmisora");
    grid.getColumn("id").setHeaderCaption("Identificacion");
    grid.setColumnOrder("razonSocial", "identificacion", "direccion", "correoElectronico");
    grid.setSizeFull();
    grid.removeColumn("tipoIdentificacion");
    grid.removeColumn("id");
    botonCancelar = new BotonCancelar();

    addComponent(grid);
    addComponent(botonCancelar);
    setComponentAlignment(botonCancelar, Alignment.BOTTOM_RIGHT);
    setComponentAlignment(h2, Alignment.TOP_CENTER);
    setExpandRatio(h1, 1);
    setExpandRatio(h2, 1);
    setExpandRatio(grid, 8);
    setExpandRatio(botonCancelar, 1);
    nuevoDato = new DemografiaCliente();
    beanItem = new BeanItem<DemografiaCliente>(nuevoDato);
    fg = new FieldGroup();
    fg.setItemDataSource(beanItem);
  }
  @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();
  }