super(pView, pMessage);
}
@Override
void doCommand() {
SelecionarTipoColunaPresenter tipoColunaPresenter = new SelecionarTipoColunaPresenter();
((IEditorView) view).setState(new Atualizacao(((IEditorView) view)));
if (tipoColunaPresenter.getColumTypeSelected() == 0) {
String columnName = tipoColunaPresenter.getColumName();
((IEditorView) view).getPresenter().getCenarioTM().addColumn(columnName);
((IEditorView) view).getGrid().setModel(((IEditorView) view).getPresenter().getCenarioTM());
((IEditorView) view).getPresenter().getContainerArvores().addArvoreData(columnName, null);
((IEditorView) view).getViewState().validaGrid();
} else if (tipoColunaPresenter.getColumTypeSelected() == 1) {
try {
//TODO Código do Helder
String formula = JOptionPane.showInputDialog("Informe a fórmula");
String columnName = tipoColunaPresenter.getColumName();
columnName = columnName.toUpperCase();
((IEditorView) view).getPresenter().getFacadeR().addColumn(formula, columnName);
((IEditorView) view).getPresenter().setProjeto(((IEditorView) view).getPresenter().getFacadeR().getCenario());
Object[] addedColumnData = ((IEditorView) view).getPresenter().getFacadeR().getColumnasObjects(columnName);
((IEditorView) view).getPresenter().getCenarioTM().addColuna(columnName, addedColumnData);
((IEditorView) view).setState(new Navegacao(((IEditorView) view)));
} catch (Exception ex) {
System.out.println("Erro: " + ex.getMessage());
}
} else if (tipoColunaPresenter.getColumTypeSelected() < 0) {
JOptionPane.showMessageDialog(view, "Cancelado pelo usuário", "Erro", JOptionPane.ERROR_MESSAGE);
}
((IEditorView) view).setState(new Navegacao(((IEditorView) view)));
((IEditorView) view).formatCells();
}