@Override public void remover(Object target) { if (isRemover) { Criterio topico = (Criterio) target; System.out.println("remover target" + " " + topico.getId()); this.criterioController.remover(topico.getId()); } else { try { MessageBox mb = new MessageBox( getWindow(), "Remover", MessageBox.Icon.QUESTION, "Remover Criterio?", new MessageBox.ButtonConfig(MessageBox.ButtonType.YES, "Sim"), new MessageBox.ButtonConfig(MessageBox.ButtonType.NO, "Nao")); mb.show( new MessageBox.EventListener() { public void buttonClicked(ButtonType buttonType) { if (buttonType.equals(buttonType.YES)) { criterioController.removerButton(criterioForm.getCriterio()); removeComponent(getComponent()); addComponent(modoLayoutTable); setComponent(modoLayoutTable); isRemover = true; buttonAdicionar.setVisible(true); buttonDeletar.setVisible(false); buttonClonar.setVisible(false); buttonEditar.setVisible(false); buttonSalvar.setVisible(false); buttonVoltar.setVisible(false); MessageBox mb = new MessageBox( getWindow(), "Remover", MessageBox.Icon.INFO, "Criterio Removido", new MessageBox.ButtonConfig(ButtonType.OK, "Ok")); mb.show(); } else { } } }); } catch (Exception e) { msg("remover.view.button: " + e.getMessage(), MessageBox.Icon.ERROR); } } }
public void defaultTable() { tabelaFiltro.tableMain.setContainerDataSource( new BeanItemContainer<Criterio>(Criterio.class, Criterio.listaUsuario())); tabelaFiltro.tableMain.setVisibleColumns(new Object[] {"id", "nome", "status", "prioridade"}); }