private void appendDate(final Row row) {
        Datebox date = new Datebox();
        date.setParent(row);

        final TaskQualityForm taskQualityForm = getTaskQualityFormByRow(row);
        final TaskQualityFormItem item = (TaskQualityFormItem) row.getValue();

        Util.bind(date, new Util.Getter<Date>() {
            @Override
            public Date get() {
                return item.getDate();
            }
        }, new Util.Setter<Date>() {

            @Override
            public void set(Date value) {
                item.setDate(value);
                updateAdvancesIfNeeded();
            }
        });

        date.setDisabled(assignedTaskQualityFormsToOrderElementModel
                .isDisabledDateItem(taskQualityForm, item));
        date.setConstraint(checkConsecutiveDate(row));
    }
示例#2
0
 @Command
 public void openMenuPopup(
     @BindingParam("open") boolean open, @BindingParam("referenceValue") Row referenceValue) {
   if (open) {
     this.selectedUser = referenceValue.getValue();
   }
 }
 private Detail getDetails(Row row) {
     if (row.getValue() instanceof TaskQualityForm) {
         return ((Detail) row.getFirstChild());
     } else {
         return ((Detail) row.getGrid().getParent());
     }
 }
  @Listen("onClick = #btn_confirmar")
  public void alterarOperador() {
    Map<String, Object> arguments = (Map) rw_dadosOperador.getValue();
    Operador op = (Operador) arguments.get("funAlterar");
    lb_operador = (Listbox) arguments.get("lb_operador");
    String pass = tb_insira_password.getText();
    List<Operador> list =
        operadorDao.obtemPorUsername(tb_username.getText(), tb_password.getText());
    if (!list.isEmpty() && op.getId() != list.get(0).getId()) {
      Clients.showNotification(
          "Um operador ja foi cadrastado com esse username", "error", null, null, 2000);
    } else {
      if (!tb_password.getText().equals(pass)) {
        Clients.showNotification("o password deve ser igual", "error", null, null, 2000);

      } else {
        ListModelList<Operador> lista = (ListModelList) lb_operador.getModel();
        lista.remove(op);
        setValues(op);
        operadorDao.update(op);
        lista.add(0, op);
        operadorWin.detach();
        ;
        Clients.showNotification("Dados do operador " + op.getNome() + " foram alterados");
      }
    }
  }
 private Row findRowOfTaskQualityForm(List<Row> rows,
         TaskQualityForm taskQualityForm) {
     for (Row row : rows) {
         if (taskQualityForm.equals(row.getValue())) {
             return row;
         }
     }
     return null;
 }
示例#6
0
 @Override
 public void iniRowAction(Row row) {
   MenuLogList log = (MenuLogList) row.getValue();
   SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
   if (log.getDdate() != null) {
     BillLabel label = (BillLabel) row.getFellowIfAny("ddate");
     label.setValue(dateFormat.format(log.getDdate()));
   }
   if (log.getLdate() != null) {
     BillLabel label = (BillLabel) row.getFellowIfAny("ldate");
     label.setValue(dateFormat.format(log.getLdate()));
   }
 }
  @Listen("onContadorEscolhe = #lb_contador")
  public void escolheContador(ForwardEvent event) {
    Map<String, Object> arg = (Map) rw_dadosLeitura.getValue();
    Row rw_contador = (Row) arg.get("rw_contador");
    Textbox tb_escolherContador = (Textbox) arg.get("tb_contador");
    Listitem selectedItem = (Listitem) event.getOrigin().getTarget().getParent().getParent();
    selectedContador = (Contador) selectedItem.getValue();

    rw_contador.setValue(selectedContador);
    tb_escolherContador.setText("" + (selectedContador).getNumero());

    winescolher.detach();
  }
 private Row findRowOfTaskQualityFormItem(Row rowTaskQualityForm,
         String itemName) {
     Grid gridItems = (Grid) rowTaskQualityForm.getFirstChild()
             .getFirstChild();
     List<Row> rows = (List<Row>) gridItems.getRows().getChildren();
     for (Row row : rows) {
         TaskQualityFormItem item = (TaskQualityFormItem) row.getValue();
         if ((item != null) && (itemName.equals(item.getName()))) {
             return row;
         }
     }
     return null;
 }
  @Listen("onClick = #btn_confirmarLeitor")
  public void alterarleitor() {

    Map<String, Object> arguments = (Map) rw_dadosLeitor.getValue();
    Leitor leitor = (Leitor) arguments.get("funAlterar");
    lb_leitor = (Listbox) arguments.get("lb_leitor");
    ListModelList<Leitor> lista = (ListModelList) lb_leitor.getModel();
    lista.remove(leitor);
    setValuesLeitor(leitor);
    leitorDao.update(leitor);
    lista.add(0, leitor);
    winAlterarLeitor.detach();
    ;
    Clients.showNotification("Dados do leitor" + leitor.getNome() + " foram alterados");
  }
    private void appendCheckPassed(final Row row) {
        Checkbox checkbox = new Checkbox();
        checkbox.setParent(row);

        final TaskQualityForm taskQualityForm = getTaskQualityFormByRow(row);
        final TaskQualityFormItem item = (TaskQualityFormItem) row.getValue();

        Util.bind(checkbox, new Util.Getter<Boolean>() {
            @Override
            public Boolean get() {
                return item.getPassed();
            }
        }, new Util.Setter<Boolean>() {

            @Override
            public void set(Boolean value) {
                item.setPassed(value);
                updateAdvancesIfNeeded();
            }
        });

        checkbox.setDisabled(assignedTaskQualityFormsToOrderElementModel
                .isDisabledPassedItem(taskQualityForm, item));

        if (!taskQualityForm.isByItems()) {
            checkbox.addEventListener(Events.ON_CHECK, new EventListener() {
                @Override
                public void onEvent(Event event) {
                    assignedTaskQualityFormsToOrderElementModel
                            .updatePassedTaskQualityFormItems(taskQualityForm);
                    Grid gridItems = row.getGrid();
                    gridItems.setModel(new SimpleListModel(taskQualityForm
                            .getTaskQualityFormItems().toArray()));
                    gridItems.invalidate();
                }
            });
        }
    }