示例#1
0
  @Override
  public void salvar() {
    try {
      if (this.criterioController.salvar(criterioForm.getCriterio())) {
        removeComponent(getComponent());
        addComponent(modoLayoutTable);
        setComponent(modoLayoutTable);
        MessageBox mb =
            new MessageBox(
                getWindow(),
                "Cadastrar",
                MessageBox.Icon.INFO,
                "Criterio Cadastrado",
                new MessageBox.ButtonConfig(ButtonType.OK, "Ok"));
        mb.show();

        buttonAdicionar.setVisible(true);
        buttonDeletar.setVisible(false);
        buttonClonar.setVisible(false);
        buttonEditar.setVisible(false);
        buttonSalvar.setVisible(false);
        buttonVoltar.setVisible(false);
      } else {
      }
    } catch (Exception e) {
      System.out.println("ERRO SALVAR");
      msg("Erro ao salvar " + e.getMessage(), MessageBox.Icon.ERROR);
    }
  }
示例#2
0
  @Override
  public void editar() {

    try {
      if (this.criterioController.alterar(criterioForm.getCriterio())) {
        removeComponent(getComponent());
        addComponent(modoLayoutTable);
        setComponent(modoLayoutTable);
        isRemover = true;
        MessageBox mb =
            new MessageBox(
                getWindow(),
                "Alterar",
                MessageBox.Icon.INFO,
                "Criterio Alterado",
                new MessageBox.ButtonConfig(ButtonType.OK, "Ok"));
        mb.show();

        buttonAdicionar.setVisible(true);
        buttonDeletar.setVisible(false);
        buttonClonar.setVisible(false);
        buttonEditar.setVisible(false);
        buttonSalvar.setVisible(false);
        buttonVoltar.setVisible(false);
      } else {
      }
    } catch (Exception e) {
      msg(e.getMessage(), MessageBox.Icon.ERROR);
    }
  }