private void openRawTab() {
    if (currentTab.equals(TABS.RAW)) return;

    String tabHandlercurrent = "inlineButtonChecked";
    String tabsContent = "tabsContent";
    String cssTabContent = "tabContent";
    String tabContentCurrent = "tabContentCurrent";

    HTML5Element tab = (HTML5Element) rawTab.getElement().cast();
    ((HTML5Element) tab.getParentElement())
        .querySelector("." + tabHandlercurrent)
        .getClassList()
        .remove(tabHandlercurrent);
    tab.getClassList().add(tabHandlercurrent);

    HTML5Element contentParent = (HTML5Element) tabContent.getParentElement();
    contentParent
        .querySelector("." + tabsContent + " ." + cssTabContent + "." + tabContentCurrent)
        .getClassList()
        .remove(tabContentCurrent);
    contentParent
        .querySelector("." + tabsContent + " ." + cssTabContent + "[data-tab=\"raw\"]")
        .getClassList()
        .add(tabContentCurrent);

    currentTab = TABS.RAW;

    if (headersCodeMirror != null) {
      headersCodeMirror.refresh();
    }
    GoogleAnalytics.sendEvent(ANALYTICS_EVENT_CATEGORY, "Tab switched", "Raw tab");
    GoogleAnalyticsApp.sendEvent(ANALYTICS_EVENT_CATEGORY, "Tab switched", "Raw tab");
  }
  private void openFormTab() {
    if (currentTab.equals(TABS.FORM)) return;

    updateForm();
    ensureFormHasRow();

    String tabHandlercurrent = "inlineButtonChecked";
    String tabsContent = "tabsContent";
    String cssTabContent = "tabContent";
    String tabContentCurrent = "tabContentCurrent";

    HTML5Element tab = (HTML5Element) formTab.getElement().cast();
    ((HTML5Element) tab.getParentElement())
        .querySelector("." + tabHandlercurrent)
        .getClassList()
        .remove(tabHandlercurrent);
    tab.getClassList().add(tabHandlercurrent);

    HTML5Element contentParent = (HTML5Element) tabContent.getParentElement();
    contentParent
        .querySelector("." + tabsContent + " ." + cssTabContent + "." + tabContentCurrent)
        .getClassList()
        .remove(tabContentCurrent);
    contentParent
        .querySelector("." + tabsContent + " ." + cssTabContent + "[data-tab=\"form\"]")
        .getClassList()
        .add(tabContentCurrent);

    currentTab = TABS.FORM;
    GoogleAnalytics.sendEvent(ANALYTICS_EVENT_CATEGORY, "Tab switched", "Form tab");
    GoogleAnalyticsApp.sendEvent(ANALYTICS_EVENT_CATEGORY, "Tab switched", "Form tab");
  }
  private static void handleShortcut(final ShortcutItem sc) {
    String type = sc.getType();

    if (type.equals(ShortcutType.OPEN_REQUEST.toString())) {
      RestClient.getClientFactory().getPlaceController().goTo(new SavedPlace("default"));
    } else if (type.equals(ShortcutType.SAVE_REQUEST.toString())) {
      eventBus.fireEvent(new SaveRequestEvent());
    } else if (type.equals(ShortcutType.SEND_REQUEST.toString())) {
      eventBus.fireEvent(new RequestStartActionEvent(new Date()));
    } else if (type.equals(ShortcutType.HISTORY_TAB.toString())) {
      RestClient.getClientFactory().getPlaceController().goTo(new HistoryPlace("default"));
    }
    GoogleAnalytics.sendEvent("Shortcats usage", "Shortcat used", type);
    GoogleAnalyticsApp.sendEvent("Shortcats usage", "Shortcat used", type);
  }