private void prepareTabs() {
        tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
            @Override
            public void onSelection(final SelectionEvent<Integer> event) {
                int selection = event.getSelectedItem().intValue();
                if (selection == 0) {
                    if (!History.getToken().startsWith("main")) {
                        History.newItem("main/");
                    }
                }
                if (selection == 1) {
                    if (!History.getToken().startsWith("question")) {
                        History.newItem("question/" + questionView.getQuestionTextBox().getValue());
                    }
                }
                if (selection == 2) {
                    if (!History.getToken().startsWith("reports")) {
                        History.newItem("reports/");
                    }
                }
            }
        });
        //tabPanel.setAnimationEnabled(true); //may cause problems in chrome.
        tabPanel.add(mainView.asWidget(), "Main");
        tabPanel.add(questionView.asWidget(), "Question");
        tabPanel.add(reportsView.asWidget(), "Reports");
    }