<commit_before>package com.intellij.xdebugger.impl.ui;

import com.intellij.openapi.editor.Document;
import com.intellij.openapi.project.Project;
import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider;
import com.intellij.xdebugger.impl.XDebuggerHistoryManager;
import com.intellij.xdebugger.XSourcePosition;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.util.Collections;
import java.util.List;

/**
 * @author nik
 */
public abstract class XDebuggerEditorBase {
  private final Project myProject;
  private final XDebuggerEditorsProvider myDebuggerEditorsProvider;
  @Nullable private final String myHistoryId;
  private final XSourcePosition mySourcePosition;
  private int myHistoryIndex;

  protected XDebuggerEditorBase(final Project project, XDebuggerEditorsProvider debuggerEditorsProvider, @Nullable @NonNls String historyId,
                                final @Nullable XSourcePosition sourcePosition) {
    myProject = project;
    myDebuggerEditorsProvider = debuggerEditorsProvider;
    myHistoryId = historyId;
    mySourcePosition = sourcePosition;
  }

  public abstract JComponent getComponent();

  protected abstract void doSetText(String text);

  public void setText(String text) {
    saveTextInHistory(text);
    doSetText(null);
  }

  public abstract String getText();

  @Nullable
  public abstract JComponent getPreferredFocusedComponent();

  public abstract void selectAll();

  protected void onHistoryChanged() {
  }

  protected List<String> getRecentExpressions() {
    if (myHistoryId != null) {
      return XDebuggerHistoryManager.getInstance(myProject).getRecentExpressions(myHistoryId);
    }<commit_msg>IDEADEV-38415: Cannot edit watch in Flex debugger.<commit_after>package com.intellij.xdebugger.impl.ui;

import com.intellij.openapi.editor.Document;
import com.intellij.openapi.project.Project;
import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider;
import com.intellij.xdebugger.impl.XDebuggerHistoryManager;
import com.intellij.xdebugger.XSourcePosition;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.util.Collections;
import java.util.List;

/**
 * @author nik
 */
public abstract class XDebuggerEditorBase {
  private final Project myProject;
  private final XDebuggerEditorsProvider myDebuggerEditorsProvider;
  @Nullable private final String myHistoryId;
  private final XSourcePosition mySourcePosition;
  private int myHistoryIndex;

  protected XDebuggerEditorBase(final Project project, XDebuggerEditorsProvider debuggerEditorsProvider, @Nullable @NonNls String historyId,
                                final @Nullable XSourcePosition sourcePosition) {
    myProject = project;
    myDebuggerEditorsProvider = debuggerEditorsProvider;
    myHistoryId = historyId;
    mySourcePosition = sourcePosition;
  }

  public abstract JComponent getComponent();

  protected abstract void doSetText(String text);

  public void setText(String text) {
    saveTextInHistory(text);
    doSetText(text);
  }

  public abstract String getText();

  @Nullable
  public abstract JComponent getPreferredFocusedComponent();

  public abstract void selectAll();

  protected void onHistoryChanged() {
  }

  protected List<String> getRecentExpressions() {
    if (myHistoryId != null) {
      return XDebuggerHistoryManager.getInstance(myProject).getRecentExpressions(myHistoryId);
    }
{'fraction_non_alphanumeric': 0.07525035765379114, 'fraction_numerical': 0.001430615164520744, 'mean_word_length': 5.037996545768567, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6347416', 'n_tokens_mistral': 975, 'n_tokens_neox': 958, 'n_words': 225}