/** {@inheritDoc} */
  @Override
  public void onToggleSplitterClicked(boolean isShowSplitter) {
    terminalTab.setScopes(isShowSplitter ? EnumSet.allOf(State.class) : EnumSet.of(RUNNERS));

    if (isShowSplitter) {
      panelState.setSplitterState(SPLITTER_ON);

      view.setLeftPropertiesPanel(leftPropertiesContainer);
      view.setRightPropertiesPanel(rightPropertiesContainer);
    } else {
      panelState.setSplitterState(SPLITTER_OFF);

      view.setGeneralPropertiesPanel(rightPropertiesContainer);
    }

    if (TEMPLATE.equals(state)) {
      panelState.setState(TEMPLATE);

      leftTabContainer.showTab(locale.runnerTabTemplates());

      if (SPLITTER_OFF.equals(panelState.getSplitterState())) {
        rightPropertiesContainer.showTab(propertiesTab.getTitle());
      }
    }
  }
  private void initializeRightPropertiesPanel(@NotNull Provider<TabBuilder> tabBuilderProvider) {
    rightPropertiesContainer.addTab(consoleTab);

    TabSelectHandler terminalHandler =
        new TabSelectHandler() {
          @Override
          public void onTabSelected() {
            if (selectedRunner != null) {
              selectedRunner.setActiveTab(locale.runnerTabTerminal());

              terminalContainer.update(selectedRunner);
            }
          }
        };

    terminalTab =
        tabBuilderProvider
            .get()
            .presenter(terminalContainer)
            .title(locale.runnerTabTerminal())
            .visible(VISIBLE)
            .selectHandler(terminalHandler)
            .scope(EnumSet.of(RUNNERS))
            .tabType(RIGHT)
            .build();
    rightPropertiesContainer.addTab(terminalTab);

    rightPropertiesContainer.addTab(propertiesTab);

    rightPropertiesContainer.showTabTitle(consoleTab.getTitle(), false);
    rightPropertiesContainer.showTabTitle(propertiesTab.getTitle(), false);
  }
  private void initializeLeftPropertiesPanel(@NotNull Provider<TabBuilder> tabBuilderProvider) {
    final TabSelectHandler consoleHandler =
        new TabSelectHandler() {
          @Override
          public void onTabSelected() {
            if (selectedRunner != null) {
              selectedRunner.setActiveTab(locale.runnerTabConsole());
            }
          }
        };

    consoleTab =
        tabBuilderProvider
            .get()
            .presenter(consoleContainer)
            .title(locale.runnerTabConsole())
            .visible(REMOVABLE)
            .selectHandler(consoleHandler)
            .scope(EnumSet.of(RUNNERS))
            .tabType(RIGHT)
            .build();

    leftPropertiesContainer.addTab(consoleTab);

    TabSelectHandler propertiesHandler =
        new TabSelectHandler() {
          @Override
          public void onTabSelected() {
            if (RUNNERS.equals(panelState.getState())) {
              propertiesContainer.show(selectedRunner);

              if (selectedRunner != null) {
                selectedRunner.setActiveTab(locale.runnerTabProperties());
              }
            } else {
              propertiesContainer.show(selectedEnvironment);
            }
          }
        };

    propertiesTab =
        tabBuilderProvider
            .get()
            .presenter(propertiesContainer)
            .selectHandler(propertiesHandler)
            .title(locale.runnerTabProperties())
            .visible(REMOVABLE)
            .scope(EnumSet.allOf(State.class))
            .tabType(RIGHT)
            .build();

    leftPropertiesContainer.addTab(propertiesTab);
  }
  private void initializeLeftPanel(
      @NotNull final PanelState panelState,
      @NotNull Provider<TabBuilder> tabBuilderProvider,
      @NotNull HistoryPanel historyPanel,
      @NotNull final TemplatesContainer templatesContainer) {
    TabSelectHandler historyHandler =
        new TabSelectHandler() {
          @Override
          public void onTabSelected() {
            selectHistoryTab();
          }
        };

    Tab historyTab =
        tabBuilderProvider
            .get()
            .presenter(historyPanel)
            .selectHandler(historyHandler)
            .title(locale.runnerTabHistory())
            .visible(REMOVABLE)
            .scope(EnumSet.allOf(State.class))
            .tabType(LEFT)
            .build();

    leftTabContainer.addTab(historyTab);

    TabSelectHandler templatesHandler =
        new TabSelectHandler() {
          @Override
          public void onTabSelected() {
            state = TEMPLATE;
            panelState.setState(State.TEMPLATE);

            templatesContainer.selectEnvironment();
            templatesContainer.changeEnableStateRunButton();

            view.hideOtherButtons();
          }
        };

    Tab templateTab =
        tabBuilderProvider
            .get()
            .presenter(templatesContainer)
            .selectHandler(templatesHandler)
            .title(locale.runnerTabTemplates())
            .visible(REMOVABLE)
            .scope(EnumSet.allOf(State.class))
            .tabType(LEFT)
            .build();

    leftTabContainer.addTab(templateTab);
  }
  private void runnerSelected() {
    selectedRunner = selectionManager.getRunner();
    if (selectedRunner == null) {
      showNoRunnerMessage(true);

      propertiesContainer.reset();
      return;
    }

    showNoRunnerMessage(false);

    if (SPLITTER_OFF.equals(panelState.getSplitterState())) {
      rightPropertiesContainer.showTab(selectedRunner.getActiveTab());
    }

    history.selectRunner(selectedRunner);

    if (locale.runnerTabTerminal().equals(selectedRunner.getActiveTab())
        || SPLITTER_ON.equals(panelState.getSplitterState())) {
      terminalContainer.update(selectedRunner);
    }

    update(selectedRunner);

    updateRunnerTimer();
  }
  /** {@inheritDoc} */
  @Override
  public void actionPerformed(ActionEvent e) {
    runnerManagerPresenter.setActive();

    tabContainer.showTab(locale.runnerTabTemplates());

    createSimpleEnvironment();
  }