@Override public void go(HasWidgets container) { super.go(container); carregaTelaFuncionarios(); }
private void carregaTela( int tela, Funcionario funcionario, List<FuncionarioSelecionavel> funcionarios, Pesquisa pesquisa) { this.container.remove(bodyPanel); this.bodyPanel.clear(); switch (tela) { case TELA_FUNCIONARIOS: Presenter<FuncionariosDisplay> funcionarioPresenter = new FuncionariosPresenter(new FuncionariosView(), eventBus, this.funcionarios); funcionarioPresenter.go(this.bodyPanel); break; case TELA_NOVO_FUNCIONARIO: Presenter<NovoFuncionarioDisplay> novoFuncionarioPresenter = new NovoFuncionarioPresenter(new NovoFuncionarioView(), eventBus); novoFuncionarioPresenter.go(this.bodyPanel); break; case TELA_EDITAR_FUNCIONARIO: Presenter<NovoFuncionarioDisplay> editarFuncionarioPresenter = new NovoFuncionarioPresenter(new NovoFuncionarioView(), eventBus, funcionario); editarFuncionarioPresenter.go(this.bodyPanel); break; case TELA_NOVA_PESQUISA: pesquisa = new Pesquisa(null, funcionarios, funcionarios, null); Presenter<NovaPesquisaDisplay> novaPesquisaPresenter = new NovaPesquisaPresenter(new NovaPesquisaView(), eventBus, pesquisa); novaPesquisaPresenter.go(this.bodyPanel); break; case TELA_PARTICIPANTES_PESQUISA: Presenter<ParticipantesPesquisaDisplay> participantesPesquisaPresenter = new ParticipantesPesquisaPresenter(new ParticipantesPesquisaView(), eventBus, pesquisa); participantesPesquisaPresenter.go(this.bodyPanel); break; case TELA_AVALIADOS_PESQUISA: Presenter<AvaliadosPesquisaDisplay> avaliadosPesquisaPresenter = new AvaliadosPesquisaPresenter(new AvaliadosPesquisaView(), eventBus, pesquisa); avaliadosPesquisaPresenter.go(this.bodyPanel); break; case TELA_PERGUNTAS_PESQUISA: Presenter<PerguntasPesquisaDisplay> perguntasPesquisaPresenter = new PerguntasPesquisaPresenter(new PerguntasPesquisaView(), eventBus, pesquisa); perguntasPesquisaPresenter.go(this.bodyPanel); break; case TELA_RELATORIOS: Presenter<RelatoriosDisplay> relatoriosPresenter = new RelatoriosPresenter(new RelatoriosView(), eventBus); relatoriosPresenter.go(this.bodyPanel); break; case TELA_EXIBIR_RELATORIO: Presenter<ExibirRelatorioDisplay> exibirRelatorioPresenter = new ExibirRelatorioPresenter( new ExibirRelatorioView(), eventBus, funcionario, pesquisa); exibirRelatorioPresenter.go(this.bodyPanel); break; case TELA_RESPONDER_PESQUISA: Presenter<ResponderPesquisaDisplay> responderPesquisaPresenter = new ResponderPesquisaPresenter(new ResponderPesquisaView(), eventBus); responderPesquisaPresenter.go(this.bodyPanel); break; case TELA_RESPONDER_PESQUISA_FUNCIONARIO: Presenter<ResponderPesquisaFuncionarioDisplay> responderPesquisaFuncionarioPresenter = new ResponderPesquisaFuncionarioPresenter( new ResponderPesquisaFuncionarioView(), eventBus, funcionario, pesquisa.getPerguntas()); responderPesquisaFuncionarioPresenter.go(this.bodyPanel); break; default: throw new UnsupportedOperationException("Link inválido"); } super.container.add(bodyPanel); }