private void saveUIState() {
    if (mySearchEditorPanel == null) return;
    final UIState uiState = UIState.getInstance();
    uiState.filtersVisible = isFilterPanelVisible();
    uiState.existingTemplatesVisible = isExistingTemplatesPanelVisible();
    uiState.templatesTreeState = myExistingTemplatesComponent.getTreeState();

    if (!myEditConfigOnly) {
      uiState.pinned = myPinned;
      if (myInjected.isVisible()) {
        uiState.searchInjectedCode = myInjected.isSelected();
      }
      uiState.matchCase = myMatchCase.isSelected();
      if (myScopePanel.isVisible()) {
        final SearchScope scope = myScopePanel.getScope();
        uiState.scopeDescriptor = Scopes.getDescriptor(scope);
        uiState.scopeType = Scopes.getType(scope);
      }
      if (myReplace) {
        if (myShortenFqn.isVisible()) {
          uiState.shortenFQNames = myShortenFqn.isSelected();
        }
        if (myStaticImport.isVisible()) {
          uiState.useStaticImport = myStaticImport.isSelected();
        }
        uiState.reformat = myReformat.isSelected();
      }
    }
  }
private void saveUIState()