mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-90367 - CloudBees support - unify log consoles
This commit is contained in:
@@ -21,11 +21,14 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import java.io.Reader;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
* Date: 01-Feb-2006
|
||||
*/
|
||||
public interface LogConsoleManager extends AdditionalTabComponentManager {
|
||||
void addLogConsole(final String name, final String path, @NotNull Charset charset, final long skippedContent);
|
||||
void removeLogConsole(final String path);
|
||||
void addLogConsole(final String name, Reader reader, final String id);
|
||||
void removeLogConsole(final String pathOrId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.diagnostic.logging;
|
||||
|
||||
import com.intellij.execution.configurations.RunConfigurationBase;
|
||||
import com.intellij.execution.process.ProcessHandler;
|
||||
import com.intellij.execution.runners.ExecutionEnvironment;
|
||||
import com.intellij.execution.ui.RunnerLayoutUi;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.ComponentWithActions;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.ui.content.Content;
|
||||
import com.intellij.ui.content.ContentManagerAdapter;
|
||||
import com.intellij.ui.content.ContentManagerEvent;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
import java.io.Reader;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* User: michael.golubev
|
||||
*/
|
||||
public abstract class LogConsoleManagerBase implements LogConsoleManager, Disposable {
|
||||
|
||||
private final Project myProject;
|
||||
|
||||
private final Map<AdditionalTabComponent, Content> myAdditionalContent = new HashMap<AdditionalTabComponent, Content>();
|
||||
|
||||
private ExecutionEnvironment myEnvironment;
|
||||
|
||||
protected LogConsoleManagerBase(@NotNull Project project) {
|
||||
myProject = project;
|
||||
}
|
||||
|
||||
protected final Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
|
||||
public void setEnvironment(@NotNull final ExecutionEnvironment env) {
|
||||
myEnvironment = env;
|
||||
}
|
||||
|
||||
protected final ExecutionEnvironment getEnvironment() {
|
||||
return myEnvironment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addLogConsole(final String name, final String path, @NotNull Charset charset, final long skippedContent) {
|
||||
addLogConsole(name, path, charset, skippedContent, getDefaultIcon());
|
||||
}
|
||||
|
||||
public void addLogConsole(final String name, final String path, @NotNull Charset charset, final long skippedContent, Icon icon) {
|
||||
doAddLogConsole(new LogConsoleImpl(myProject, new File(path), charset, skippedContent, name, false) {
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return isConsoleActive(path);
|
||||
}
|
||||
}, path, icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addLogConsole(String name, Reader reader, final String id) {
|
||||
addLogConsole(name, reader, id, getDefaultIcon());
|
||||
}
|
||||
|
||||
public void addLogConsole(String name, Reader reader, final String id, Icon icon) {
|
||||
doAddLogConsole(new LogConsoleBase(myProject,
|
||||
reader,
|
||||
name,
|
||||
false,
|
||||
new DefaultLogFilterModel(myProject)) {
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return isConsoleActive(id);
|
||||
}
|
||||
}, id, icon);
|
||||
}
|
||||
|
||||
private void doAddLogConsole(final LogConsoleBase log,
|
||||
final String id,
|
||||
Icon icon) {
|
||||
if (myEnvironment != null && myEnvironment.getRunProfile() instanceof RunConfigurationBase) {
|
||||
((RunConfigurationBase)myEnvironment.getRunProfile()).customizeLogConsole(log);
|
||||
}
|
||||
log.attachStopLogConsoleTrackingListener(getProcessHandler());
|
||||
addAdditionalTabComponent(log, id, icon);
|
||||
|
||||
getUi().addListener(new ContentManagerAdapter() {
|
||||
public void selectionChanged(final ContentManagerEvent event) {
|
||||
log.activate();
|
||||
}
|
||||
}, log);
|
||||
}
|
||||
|
||||
private boolean isConsoleActive(String id) {
|
||||
final Content content = getUi().findContent(id);
|
||||
return content != null && content.isSelected();
|
||||
}
|
||||
|
||||
public void removeLogConsole(final String path) {
|
||||
final Content content = getUi().findContent(path);
|
||||
if (content != null) {
|
||||
final LogConsoleBase log = (LogConsoleBase)content.getComponent();
|
||||
removeAdditionalTabComponent(log);
|
||||
}
|
||||
}
|
||||
|
||||
public void addAdditionalTabComponent(final AdditionalTabComponent tabComponent, final String id) {
|
||||
addAdditionalTabComponent(tabComponent, id, getDefaultIcon());
|
||||
}
|
||||
|
||||
public Content addAdditionalTabComponent(final AdditionalTabComponent tabComponent, String id, Icon icon) {
|
||||
final Content logContent = createLogContent(tabComponent, id, icon);
|
||||
myAdditionalContent.put(tabComponent, logContent);
|
||||
getUi().addContent(logContent);
|
||||
return logContent;
|
||||
}
|
||||
|
||||
protected Content createLogContent(AdditionalTabComponent tabComponent, String id, Icon icon) {
|
||||
return getUi().createContent(id, (ComponentWithActions)tabComponent, tabComponent.getTabTitle(), icon,
|
||||
tabComponent.getPreferredFocusableComponent());
|
||||
}
|
||||
|
||||
public void removeAdditionalTabComponent(AdditionalTabComponent component) {
|
||||
Disposer.dispose(component);
|
||||
final Content content = myAdditionalContent.remove(component);
|
||||
if (!getUi().isDisposed()) {
|
||||
getUi().removeContent(content, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
for (AdditionalTabComponent component : ArrayUtil.toObjectArray(myAdditionalContent.keySet(), AdditionalTabComponent.class)) {
|
||||
removeAdditionalTabComponent(component);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract Icon getDefaultIcon();
|
||||
|
||||
protected abstract RunnerLayoutUi getUi();
|
||||
|
||||
public abstract ProcessHandler getProcessHandler();
|
||||
}
|
||||
@@ -27,7 +27,6 @@ import com.intellij.execution.ui.actions.CloseAction;
|
||||
import com.intellij.execution.ui.layout.PlaceInGrid;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.actions.ContextHelpAction;
|
||||
import com.intellij.openapi.CompositeDisposable;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -44,7 +43,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import java.io.File;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -52,12 +50,10 @@ import java.util.Map;
|
||||
/**
|
||||
* @author dyoma
|
||||
*/
|
||||
public class RunContentBuilder implements LogConsoleManager, Disposable {
|
||||
public class RunContentBuilder extends LogConsoleManagerBase {
|
||||
@NonNls private static final String JAVA_RUNNER = "JavaRunner";
|
||||
|
||||
|
||||
private final ProgramRunner myRunner;
|
||||
private final Project myProject;
|
||||
private final CompositeDisposable myDisposeables = new CompositeDisposable();
|
||||
private final ArrayList<AnAction> myRunnerActions = new ArrayList<AnAction>();
|
||||
private final Icon myRerunIcon = AllIcons.Actions.RefreshUsages;
|
||||
private final boolean myReuseProhibited = false;
|
||||
@@ -66,12 +62,10 @@ public class RunContentBuilder implements LogConsoleManager, Disposable {
|
||||
private final LogFilesManager myManager;
|
||||
|
||||
private RunnerLayoutUi myUi;
|
||||
private final Map<AdditionalTabComponent, Content> myAdditionalContent = new HashMap<AdditionalTabComponent, Content>();
|
||||
private final Executor myExecutor;
|
||||
private ExecutionEnvironment myEnvironment;
|
||||
|
||||
public RunContentBuilder(final Project project, final ProgramRunner runner, Executor executor) {
|
||||
myProject = project;
|
||||
super(project);
|
||||
myRunner = runner;
|
||||
myExecutor = executor;
|
||||
myManager = new LogFilesManager(project, this, this);
|
||||
@@ -86,7 +80,7 @@ public class RunContentBuilder implements LogConsoleManager, Disposable {
|
||||
}
|
||||
|
||||
public void setEnvironment(@NotNull final ExecutionEnvironment env) {
|
||||
myEnvironment = env;
|
||||
super.setEnvironment(env);
|
||||
final RunProfile profile = env.getRunProfile();
|
||||
if (profile instanceof RunConfigurationBase) {
|
||||
myManager.registerFileMatcher((RunConfigurationBase)profile);
|
||||
@@ -97,21 +91,17 @@ public class RunContentBuilder implements LogConsoleManager, Disposable {
|
||||
myRunnerActions.add(action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
Disposer.dispose(myDisposeables);
|
||||
}
|
||||
|
||||
private RunContentDescriptor createDescriptor() {
|
||||
if (myExecutionResult == null) {
|
||||
throw new IllegalStateException("Missing ExecutionResult");
|
||||
}
|
||||
|
||||
if (myEnvironment == null) {
|
||||
ExecutionEnvironment environment = getEnvironment();
|
||||
if (environment == null) {
|
||||
throw new IllegalStateException("Missing ExecutionEnvironment");
|
||||
}
|
||||
|
||||
final RunProfile profile = myEnvironment.getRunProfile();
|
||||
final RunProfile profile = environment.getRunProfile();
|
||||
|
||||
final ExecutionConsole console = myExecutionResult.getExecutionConsole();
|
||||
String runnerType = JAVA_RUNNER;
|
||||
@@ -121,7 +111,7 @@ public class RunContentBuilder implements LogConsoleManager, Disposable {
|
||||
runnerType = JAVA_RUNNER + "." + id;
|
||||
}
|
||||
}
|
||||
myUi = RunnerLayoutUi.Factory.getInstance(myProject).create(runnerType, myExecutor.getId(), profile.getName(), this);
|
||||
myUi = RunnerLayoutUi.Factory.getInstance(getProject()).create(runnerType, myExecutor.getId(), profile.getName(), this);
|
||||
myUi.getOptions().setMoveToGridActionEnabled(false).setMinimizeActionEnabled(false);
|
||||
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
@@ -168,42 +158,10 @@ public class RunContentBuilder implements LogConsoleManager, Disposable {
|
||||
consoleContent.setActions(consoleActions, ActionPlaces.UNKNOWN, console.getComponent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addLogConsole(final String name, final String path, @NotNull Charset charset, final long skippedContent) {
|
||||
final LogConsoleImpl log = new LogConsoleImpl(myProject, new File(path), charset, skippedContent, name, false){
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
final Content content = myUi.findContent(path);
|
||||
return content != null && content.isSelected();
|
||||
}
|
||||
};
|
||||
if (myEnvironment.getRunProfile() instanceof RunConfigurationBase) {
|
||||
((RunConfigurationBase) myEnvironment.getRunProfile()).customizeLogConsole(log);
|
||||
}
|
||||
log.attachStopLogConsoleTrackingListener(myExecutionResult.getProcessHandler());
|
||||
addAdditionalTabComponent(log, path);
|
||||
|
||||
myUi.addListener(new ContentManagerAdapter() {
|
||||
@Override
|
||||
public void selectionChanged(final ContentManagerEvent event) {
|
||||
log.stateChanged(new ChangeEvent(myUi));
|
||||
}
|
||||
}, log);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLogConsole(final String path) {
|
||||
final Content content = myUi.findContent(path);
|
||||
if (content != null) {
|
||||
final LogConsoleImpl log = (LogConsoleImpl)content.getComponent();
|
||||
removeAdditionalTabComponent(log);
|
||||
}
|
||||
}
|
||||
|
||||
private ActionGroup createActionToolbar(final RunContentDescriptor contentDescriptor, final JComponent component) {
|
||||
final DefaultActionGroup actionGroup = new DefaultActionGroup();
|
||||
|
||||
final RestartAction restartAction = new RestartAction(myExecutor, myRunner, getProcessHandler(), myRerunIcon, contentDescriptor, myEnvironment);
|
||||
final RestartAction restartAction = new RestartAction(myExecutor, myRunner, getProcessHandler(), myRerunIcon, contentDescriptor, getEnvironment());
|
||||
restartAction.registerShortcut(component);
|
||||
actionGroup.add(restartAction);
|
||||
contentDescriptor.setRestarter(new Runnable() {
|
||||
@@ -244,7 +202,7 @@ public class RunContentBuilder implements LogConsoleManager, Disposable {
|
||||
actionGroup.add(myUi.getOptions().getLayoutActions());
|
||||
actionGroup.addSeparator();
|
||||
actionGroup.add(PinToolwindowTabAction.getPinAction());
|
||||
actionGroup.add(new CloseAction(myExecutor, contentDescriptor, myProject));
|
||||
actionGroup.add(new CloseAction(myExecutor, contentDescriptor, getProject()));
|
||||
actionGroup.add(new ContextHelpAction(myExecutor.getHelpId()));
|
||||
return actionGroup;
|
||||
}
|
||||
@@ -263,30 +221,13 @@ public class RunContentBuilder implements LogConsoleManager, Disposable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAdditionalTabComponent(final AdditionalTabComponent tabComponent, final String id) {
|
||||
final Content content = myUi.createContent(id, (ComponentWithActions)tabComponent, tabComponent.getTabTitle(),
|
||||
AllIcons.Debugger.Console, tabComponent.getPreferredFocusableComponent());
|
||||
|
||||
|
||||
|
||||
myUi.addContent(content);
|
||||
myAdditionalContent.put(tabComponent, content);
|
||||
|
||||
myDisposeables.add(new Disposable(){
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (!myUi.isDisposed()) {
|
||||
removeAdditionalTabComponent(tabComponent);
|
||||
}
|
||||
}
|
||||
});
|
||||
protected RunnerLayoutUi getUi() {
|
||||
return myUi;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAdditionalTabComponent(AdditionalTabComponent component) {
|
||||
Disposer.dispose(component);
|
||||
final Content content = myAdditionalContent.remove(component);
|
||||
myUi.removeContent(content, true);
|
||||
protected Icon getDefaultIcon() {
|
||||
return AllIcons.Debugger.Console;
|
||||
}
|
||||
|
||||
private static class MyRunContentDescriptor extends RunContentDescriptor {
|
||||
|
||||
+22
-115
@@ -48,7 +48,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
import java.nio.charset.Charset;
|
||||
import java.io.Reader;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -56,24 +56,17 @@ import java.util.Map;
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class DebuggerSessionTabBase implements DebuggerLogConsoleManager, Disposable {
|
||||
@NotNull private final Project myProject;
|
||||
public abstract class DebuggerSessionTabBase extends LogConsoleManagerBase implements DebuggerLogConsoleManager {
|
||||
@NotNull private final LogFilesManager myManager;
|
||||
|
||||
@NotNull final String mySessionName;
|
||||
@NotNull protected final RunnerLayoutUi myUi;
|
||||
|
||||
@NotNull private final Map<AdditionalTabComponent, Content> myAdditionalContent = new HashMap<AdditionalTabComponent, Content>();
|
||||
@NotNull private final Map<AdditionalTabComponent, ContentManagerListener> myContentListeners =
|
||||
new HashMap<AdditionalTabComponent, ContentManagerListener>();
|
||||
|
||||
protected ExecutionEnvironment myEnvironment;
|
||||
|
||||
protected ExecutionConsole myConsole;
|
||||
protected RunContentDescriptor myRunContentDescriptor;
|
||||
|
||||
public DebuggerSessionTabBase(Project project, @NotNull String runnerId, @NotNull final String sessionName) {
|
||||
myProject = project;
|
||||
super(project);
|
||||
myManager = new LogFilesManager(project, this, this);
|
||||
|
||||
mySessionName = sessionName;
|
||||
@@ -89,6 +82,24 @@ public abstract class DebuggerSessionTabBase implements DebuggerLogConsoleManage
|
||||
|
||||
public abstract RunContentDescriptor getRunContentDescriptor();
|
||||
|
||||
@Override
|
||||
public ProcessHandler getProcessHandler() {
|
||||
return getRunContentDescriptor().getProcessHandler();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Content createLogContent(AdditionalTabComponent tabComponent, String id, Icon icon) {
|
||||
Content result = super.createLogContent(tabComponent, id, icon);
|
||||
result.setCloseable(false);
|
||||
result.setDescription(tabComponent.getTooltip());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Icon getDefaultIcon() {
|
||||
return AllIcons.FileTypes.Text;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public RunnerLayoutUi getUi() {
|
||||
return myUi;
|
||||
@@ -111,42 +122,6 @@ public abstract class DebuggerSessionTabBase implements DebuggerLogConsoleManage
|
||||
return myManager;
|
||||
}
|
||||
|
||||
// TODO[oleg]: talk to nick
|
||||
public void setEnvironment(@NotNull final ExecutionEnvironment env) {
|
||||
myEnvironment = env;
|
||||
}
|
||||
|
||||
public void addLogConsole(final String name, final String path, @NotNull final Charset charset, final long skippedContent, Icon icon) {
|
||||
final Ref<Content> content = new Ref<Content>();
|
||||
addLogConsole(new LogConsoleImpl(myProject, new File(path), charset, skippedContent, name, false) {
|
||||
public boolean isActive() {
|
||||
final Content logContent = content.get();
|
||||
return logContent != null && logContent.isSelected();
|
||||
}
|
||||
}, icon, content);
|
||||
}
|
||||
|
||||
private void addLogConsole(final LogConsoleBase logConsole, Icon icon, Ref<Content> content) {
|
||||
logConsole.attachStopLogConsoleTrackingListener(getRunContentDescriptor().getProcessHandler());
|
||||
// Attach custom log handlers
|
||||
if (myEnvironment != null && myEnvironment.getRunProfile() instanceof RunConfigurationBase) {
|
||||
((RunConfigurationBase)myEnvironment.getRunProfile()).customizeLogConsole(logConsole);
|
||||
}
|
||||
|
||||
content.set(addLogComponent(logConsole, icon));
|
||||
final ContentManagerAdapter l = new ContentManagerAdapter() {
|
||||
public void selectionChanged(final ContentManagerEvent event) {
|
||||
logConsole.activate();
|
||||
}
|
||||
};
|
||||
myContentListeners.put(logConsole, l);
|
||||
getUi().addListener(l, this);
|
||||
}
|
||||
|
||||
public void addLogConsole(String name, String path, @NotNull Charset charset, long skippedContent) {
|
||||
addLogConsole(name, path, charset, skippedContent, AllIcons.FileTypes.Text);
|
||||
}
|
||||
|
||||
protected void attachNotificationTo(final Content content) {
|
||||
if (myConsole instanceof ObservableConsoleView) {
|
||||
ObservableConsoleView observable = (ObservableConsoleView)myConsole;
|
||||
@@ -160,67 +135,6 @@ public abstract class DebuggerSessionTabBase implements DebuggerLogConsoleManage
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String getLogContentId(@NotNull String tabTitle) {
|
||||
return "Log-" + tabTitle;
|
||||
}
|
||||
|
||||
public void removeLogConsole(final String path) {
|
||||
LogConsoleImpl componentToRemove = null;
|
||||
for (AdditionalTabComponent tabComponent : myAdditionalContent.keySet()) {
|
||||
if (tabComponent instanceof LogConsoleImpl) {
|
||||
final LogConsoleImpl console = (LogConsoleImpl)tabComponent;
|
||||
if (Comparing.strEqual(console.getPath(), path)) {
|
||||
componentToRemove = console;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (componentToRemove != null) {
|
||||
getUi().removeListener(myContentListeners.remove(componentToRemove));
|
||||
removeAdditionalTabComponent(componentToRemove);
|
||||
}
|
||||
}
|
||||
|
||||
public void addAdditionalTabComponent(AdditionalTabComponent tabComponent, String id, Icon icon) {
|
||||
addLogComponent(tabComponent, id, icon);
|
||||
}
|
||||
|
||||
public void addAdditionalTabComponent(final AdditionalTabComponent tabComponent, final String id) {
|
||||
addLogComponent(tabComponent, id);
|
||||
}
|
||||
|
||||
private void addLogComponent(AdditionalTabComponent component, String id) {
|
||||
addLogComponent(component, id, AllIcons.FileTypes.Text);
|
||||
}
|
||||
|
||||
private Content addLogComponent(AdditionalTabComponent tabComponent, Icon icon) {
|
||||
@NonNls final String id = getLogContentId(tabComponent.getTabTitle());
|
||||
return addLogComponent(tabComponent, id, icon);
|
||||
}
|
||||
|
||||
private Content addLogComponent(final AdditionalTabComponent tabComponent, String id, Icon icon) {
|
||||
final Content logContent = getUi().createContent(id, (ComponentWithActions)tabComponent, tabComponent.getTabTitle(), icon,
|
||||
tabComponent.getPreferredFocusableComponent());
|
||||
logContent.setCloseable(false);
|
||||
logContent.setDescription(tabComponent.getTooltip());
|
||||
myAdditionalContent.put(tabComponent, logContent);
|
||||
getUi().addContent(logContent);
|
||||
Disposer.register(this, new Disposable() {
|
||||
public void dispose() {
|
||||
removeAdditionalTabComponent(tabComponent);
|
||||
}
|
||||
});
|
||||
|
||||
return logContent;
|
||||
}
|
||||
|
||||
public void removeAdditionalTabComponent(AdditionalTabComponent component) {
|
||||
Disposer.dispose(component);
|
||||
final Content content = myAdditionalContent.remove(component);
|
||||
getUi().removeContent(content, true);
|
||||
}
|
||||
|
||||
public void toFront() {
|
||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
ExecutionManager.getInstance(getProject()).getContentManager().toFrontRunContent(DefaultDebugExecutor.getDebugExecutorInstance(), myRunContentDescriptor);
|
||||
@@ -230,17 +144,10 @@ public abstract class DebuggerSessionTabBase implements DebuggerLogConsoleManage
|
||||
boolean focusWnd = Registry.is("debugger.mayBringFrameToFrontOnBreakpoint");
|
||||
ProjectUtil.focusProjectWindow(getProject(), focusWnd);
|
||||
if (!focusWnd) {
|
||||
AppIcon.getInstance().requestAttention(myProject, true);
|
||||
AppIcon.getInstance().requestAttention(getProject(), true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user