private String getImagem(TransacaoVO transacao) { if (transacao.getTipoDoLancamento().equals(TipoDoLancamento.DEBITO)) { return "imagens/debito.gif"; } else { return "imagens/credito.gif"; } }
private void listaDeTransacoesPopulateItem(ListItem<TransacaoVO> item) { TransacaoVO transacao = item.getModelObject(); item.add( new Label( "lblDataHoraTransacao", new Model<String>(UtilHelper.getDataHoraFormatada(transacao.getDataHoraTransacao())))); item.add(new Image("imgTipoDoLancamento", new ContextRelativeResource(getImagem(transacao)))); item.add(new Label("lblDescricao", new Model<String>(transacao.getDescricao()))); item.add( new Label( "lblAgencia", new Model<String>(UtilHelper.getAgenciaFormatada(transacao.getAgencia())))); item.add( new Label( "lblConta", new Model<String>(UtilHelper.getContaFormatada(transacao.getConta())))); item.add( new Label( "lblValor", new Model<String>(UtilHelper.getValorFormatado(transacao.getValor())))); item.add(new Label("lblIdDaTransacao", new Model<String>(transacao.getIdDaTransacao()))); }