package jetbrains.mps.debug.api.run;

/*Generated by MPS */

import jetbrains.mps.annotations.GeneratedClass;
import com.intellij.execution.configurations.RunProfileState;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.debug.api.IDebuggerSettings;
import jetbrains.mps.debug.api.EmptyDebuggerSettings;
import jetbrains.mps.logging.Logger;

@GeneratedClass(node = "r:0cf7389f-e174-4742-a3d2-15c79317838a(jetbrains.mps.debug.api.run)/4474271214082913266", model = "r:0cf7389f-e174-4742-a3d2-15c79317838a(jetbrains.mps.debug.api.run)")
public abstract class DebuggerRunProfileState implements RunProfileState {

  @NotNull
  protected IDebuggerSettings myDebuggerSettings = EmptyDebuggerSettings.getInstance();
  private boolean myUpdated = false;
  public DebuggerRunProfileState() {
  }
  protected void updateDebuggerSettings() {
    if (myUpdated) {
      Logger.getLogger(DebuggerRunProfileState.class).warning("Updating debugger settings twice.");
      return;
    }
    myUpdated = true;
    IDebuggerSettings debuggerSettings = getDebuggerConfiguration().createDebuggerSettings();
    if (debuggerSettings != null) {
      myDebuggerSettings = debuggerSettings;
    }
  }
  @NotNull
  public IDebuggerSettings getDebuggerSettings() {
    updateDebuggerSettings();
    return myDebuggerSettings;
  }
  @NotNull
  public abstract IDebuggerConfiguration getDebuggerConfiguration();
}
