mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cidr-debugger: tests
This commit is contained in:
@@ -65,7 +65,7 @@ import com.intellij.unscramble.ThreadDumpPanel;
|
||||
import com.intellij.unscramble.ThreadState;
|
||||
import com.intellij.xdebugger.XDebuggerBundle;
|
||||
import com.intellij.xdebugger.impl.actions.XDebuggerActions;
|
||||
import com.intellij.xdebugger.impl.ui.DebuggerLogConsoleManagerBase;
|
||||
import com.intellij.xdebugger.impl.ui.DebuggerSessionTabBase;
|
||||
import com.intellij.xdebugger.impl.ui.XDebuggerUIConstants;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -74,7 +74,7 @@ import javax.swing.tree.TreePath;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class DebuggerSessionTab extends DebuggerLogConsoleManagerBase implements Disposable {
|
||||
public class DebuggerSessionTab extends DebuggerSessionTabBase implements Disposable {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.ui.DebuggerSessionTab");
|
||||
|
||||
private static final Icon WATCH_RETURN_VALUES_ICON = IconLoader.getIcon("/debugger/watchLastReturnValue.png");
|
||||
@@ -83,12 +83,9 @@ public class DebuggerSessionTab extends DebuggerLogConsoleManagerBase implements
|
||||
private final VariablesPanel myVariablesPanel;
|
||||
private final MainWatchPanel myWatchPanel;
|
||||
|
||||
private ExecutionConsole myConsole;
|
||||
private ProgramRunner myRunner;
|
||||
private volatile DebuggerSession myDebuggerSession;
|
||||
|
||||
private RunContentDescriptor myRunContentDescriptor;
|
||||
|
||||
private final MyDebuggerStateManager myStateManager = new MyDebuggerStateManager();
|
||||
|
||||
private final FramesPanel myFramesPanel;
|
||||
@@ -420,13 +417,6 @@ public class DebuggerSessionTab extends DebuggerLogConsoleManagerBase implements
|
||||
}
|
||||
}
|
||||
|
||||
protected void toFront() {
|
||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
ExecutionManager.getInstance(getProject()).getContentManager().toFrontRunContent(DefaultDebugExecutor.getDebugExecutorInstance(), myRunContentDescriptor);
|
||||
ProjectUtil.focusProjectWindow(getProject(), Registry.is("debugger.mayBringFrameToFrontOnBreakpoint"));
|
||||
}
|
||||
}
|
||||
|
||||
public String getSessionName() {
|
||||
return myConfiguration.getName();
|
||||
}
|
||||
|
||||
+20
-2
@@ -16,19 +16,26 @@
|
||||
package com.intellij.xdebugger.impl.ui;
|
||||
|
||||
import com.intellij.diagnostic.logging.*;
|
||||
import com.intellij.execution.ExecutionManager;
|
||||
import com.intellij.execution.configurations.RunConfigurationBase;
|
||||
import com.intellij.execution.configurations.RunProfile;
|
||||
import com.intellij.execution.executors.DefaultDebugExecutor;
|
||||
import com.intellij.execution.process.ProcessHandler;
|
||||
import com.intellij.execution.runners.ExecutionEnvironment;
|
||||
import com.intellij.execution.runners.ProgramRunner;
|
||||
import com.intellij.execution.ui.ExecutionConsole;
|
||||
import com.intellij.execution.ui.RunContentDescriptor;
|
||||
import com.intellij.execution.ui.RunnerLayoutUi;
|
||||
import com.intellij.ide.impl.ProjectUtil;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.ComponentWithActions;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.ui.content.Content;
|
||||
import com.intellij.ui.content.ContentManagerAdapter;
|
||||
import com.intellij.ui.content.ContentManagerEvent;
|
||||
@@ -46,16 +53,20 @@ import java.util.Map;
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class DebuggerLogConsoleManagerBase implements DebuggerLogConsoleManager, Disposable {
|
||||
public abstract class DebuggerSessionTabBase implements DebuggerLogConsoleManager, Disposable {
|
||||
private final Map<AdditionalTabComponent, Content> myAdditionalContent = new HashMap<AdditionalTabComponent, Content>();
|
||||
private final Map<AdditionalTabComponent, ContentManagerListener> myContentListeners =
|
||||
new HashMap<AdditionalTabComponent, ContentManagerListener>();
|
||||
private final Project myProject;
|
||||
private final LogFilesManager myManager;
|
||||
protected ExecutionEnvironment myEnvironment;
|
||||
|
||||
protected ExecutionConsole myConsole;
|
||||
protected RunContentDescriptor myRunContentDescriptor;
|
||||
|
||||
private final Icon DEFAULT_TAB_COMPONENT_ICON = IconLoader.getIcon("/fileTypes/text.png");
|
||||
|
||||
public DebuggerLogConsoleManagerBase(Project project) {
|
||||
public DebuggerSessionTabBase(Project project) {
|
||||
myProject = project;
|
||||
myManager = new LogFilesManager(project, this, this);
|
||||
}
|
||||
@@ -186,6 +197,13 @@ public abstract class DebuggerLogConsoleManagerBase implements DebuggerLogConsol
|
||||
getUi().removeContent(content, true);
|
||||
}
|
||||
|
||||
public void toFront() {
|
||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
ExecutionManager.getInstance(getProject()).getContentManager().toFrontRunContent(DefaultDebugExecutor.getDebugExecutorInstance(), myRunContentDescriptor);
|
||||
ProjectUtil.focusProjectWindow(getProject(), Registry.is("debugger.mayBringFrameToFrontOnBreakpoint"));
|
||||
}
|
||||
}
|
||||
|
||||
protected Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
@@ -60,11 +60,9 @@ import java.util.List;
|
||||
/**
|
||||
* @author spleaner
|
||||
*/
|
||||
public class XDebugSessionTab extends DebuggerLogConsoleManagerBase {
|
||||
public class XDebugSessionTab extends DebuggerSessionTabBase {
|
||||
private final String mySessionName;
|
||||
private final RunnerLayoutUi myUi;
|
||||
private RunContentDescriptor myRunContentDescriptor;
|
||||
private ExecutionConsole myConsole;
|
||||
private XWatchesView myWatchesView;
|
||||
private final List<XDebugViewBase> myViews = new ArrayList<XDebugViewBase>();
|
||||
|
||||
@@ -176,6 +174,7 @@ public class XDebugSessionTab extends DebuggerLogConsoleManagerBase {
|
||||
final @Nullable ExecutionEnvironment environment, final @Nullable ProgramRunner runner) {
|
||||
ExecutionResult executionResult = createExecutionResult(session);
|
||||
myConsole = executionResult.getExecutionConsole();
|
||||
myRunContentDescriptor = new RunContentDescriptor(myConsole, executionResult.getProcessHandler(), myUi.getComponent(), getSessionName());
|
||||
|
||||
myUi.addContent(createFramesContent(session), 0, PlaceInGrid.left, false);
|
||||
myUi.addContent(createVariablesContent(session), 0, PlaceInGrid.center, false);
|
||||
@@ -194,7 +193,6 @@ public class XDebugSessionTab extends DebuggerLogConsoleManagerBase {
|
||||
}
|
||||
session.getDebugProcess().registerAdditionalContent(myUi);
|
||||
|
||||
myRunContentDescriptor = new RunContentDescriptor(myConsole, executionResult.getProcessHandler(), myUi.getComponent(), getSessionName());
|
||||
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
return myRunContentDescriptor;
|
||||
@@ -256,13 +254,4 @@ public class XDebugSessionTab extends DebuggerLogConsoleManagerBase {
|
||||
public RunContentDescriptor getRunContentDescriptor() {
|
||||
return myRunContentDescriptor;
|
||||
}
|
||||
|
||||
public void toFront() {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
ProjectUtil.focusProjectWindow(getProject(), Registry.is("debugger.mayBringFrameToFrontOnBreakpoint"));
|
||||
ExecutionManager.getInstance(getProject()).getContentManager().toFrontRunContent(DefaultDebugExecutor.getDebugExecutorInstance(), myRunContentDescriptor);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user