mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[Build tw] cleanup temporary build.view.side-by-side registry key IDEA-211886
GitOrigin-RevId: 396c8fb531a2ae51eaece2589dc929d6ed8c1493
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3b56d51785
commit
8ed4edc262
@@ -827,16 +827,13 @@ public class BuildTreeConsoleView implements ConsoleView, DataProvider, BuildCon
|
||||
}
|
||||
};
|
||||
Disposer.register(this, myView);
|
||||
if (executionConsole != null && buildViewSettingsProvider.isSideBySideView()) {
|
||||
if (executionConsole != null) {
|
||||
String nodeConsoleViewName = getNodeConsoleViewName(buildProgressRootNode);
|
||||
myView.addViewAndShowIfNeeded(executionConsole, nodeConsoleViewName, true);
|
||||
myNodeConsoleViewName.set(nodeConsoleViewName);
|
||||
}
|
||||
ConsoleView emptyConsole = new ConsoleViewImpl(project, GlobalSearchScope.EMPTY_SCOPE, true, false);
|
||||
myView.addView(emptyConsole, EMPTY_CONSOLE_NAME);
|
||||
if (!buildViewSettingsProvider.isSideBySideView()) {
|
||||
myPanel.setVisible(false);
|
||||
}
|
||||
JComponent consoleComponent = emptyConsole.getComponent();
|
||||
consoleComponent.setFocusable(true);
|
||||
myPanel.add(myView.getComponent(), BorderLayout.CENTER);
|
||||
@@ -901,22 +898,10 @@ public class BuildTreeConsoleView implements ConsoleView, DataProvider, BuildCon
|
||||
myView.addView(textConsoleView, nodeConsoleViewName);
|
||||
myView.showView(nodeConsoleViewName, false);
|
||||
}
|
||||
else if (myViewSettingsProvider.isSideBySideView()) {
|
||||
else {
|
||||
myView.showView(EMPTY_CONSOLE_NAME, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!myViewSettingsProvider.isSideBySideView()) {
|
||||
EventResult eventResult = node.getResult();
|
||||
BuildTextConsoleView taskOutputView = new BuildTextConsoleView(myProject, true, myExecutionConsoleFilters);
|
||||
boolean hasChanged = taskOutputView.appendEventResult(eventResult);
|
||||
if (!hasChanged) return false;
|
||||
|
||||
taskOutputView.scrollTo(0);
|
||||
myView.addView(taskOutputView, nodeConsoleViewName);
|
||||
myView.showView(nodeConsoleViewName, false);
|
||||
myPanel.setVisible(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -933,7 +918,6 @@ public class BuildTreeConsoleView implements ConsoleView, DataProvider, BuildCon
|
||||
}
|
||||
|
||||
private void addOutput(@NotNull ExecutionNode node, Consumer<BuildTextConsoleView> consumer) {
|
||||
if (!myViewSettingsProvider.isSideBySideView()) return;
|
||||
String nodeConsoleViewName = getNodeConsoleViewName(node);
|
||||
ExecutionConsole viewView = myView.getView(nodeConsoleViewName);
|
||||
if (viewView instanceof BuildTextConsoleView) {
|
||||
|
||||
@@ -12,15 +12,12 @@ import com.intellij.execution.filters.Filter;
|
||||
import com.intellij.execution.filters.HyperlinkInfo;
|
||||
import com.intellij.execution.process.ProcessHandler;
|
||||
import com.intellij.execution.runners.ExecutionEnvironment;
|
||||
import com.intellij.execution.runners.FakeRerunAction;
|
||||
import com.intellij.execution.ui.ConsoleView;
|
||||
import com.intellij.execution.ui.ConsoleViewContentType;
|
||||
import com.intellij.execution.ui.ExecutionConsole;
|
||||
import com.intellij.execution.ui.RunContentDescriptor;
|
||||
import com.intellij.execution.ui.actions.CloseAction;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.OccurenceNavigator;
|
||||
import com.intellij.ide.actions.PinActiveTabAction;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionUtil;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -33,6 +30,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Function;
|
||||
@@ -136,7 +134,7 @@ public class BuildView extends CompositeView<ExecutionConsole>
|
||||
ExecutionConsole executionConsole = myExecutionConsole;
|
||||
if (executionConsole != null) {
|
||||
executionConsole.getComponent(); //create editor to be able to add console editor actions
|
||||
if (myViewSettingsProvider.isExecutionViewHidden() || !myViewSettingsProvider.isSideBySideView()) {
|
||||
if (myViewSettingsProvider.isExecutionViewHidden()) {
|
||||
addViewAndShowIfNeeded(executionConsole, CONSOLE_VIEW_NAME, myViewManager.isConsoleEnabledByDefault());
|
||||
}
|
||||
}
|
||||
@@ -147,13 +145,8 @@ public class BuildView extends CompositeView<ExecutionConsole>
|
||||
if (eventView == null) {
|
||||
String eventViewName = BuildTreeConsoleView.class.getName();
|
||||
eventView = new BuildTreeConsoleView(myProject, myBuildDescriptor, myExecutionConsole, myViewSettingsProvider);
|
||||
if (myViewSettingsProvider.isSideBySideView()) {
|
||||
addView(eventView, eventViewName);
|
||||
showView(eventViewName);
|
||||
}
|
||||
else {
|
||||
addViewAndShowIfNeeded(eventView, eventViewName, !myViewManager.isConsoleEnabledByDefault());
|
||||
}
|
||||
addView(eventView, eventViewName);
|
||||
showView(eventViewName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,31 +287,13 @@ public class BuildView extends CompositeView<ExecutionConsole>
|
||||
ActionUtil.copyFrom(stopAction, IdeActions.ACTION_STOP_PROGRAM);
|
||||
stopAction.registerCustomShortcutSet(stopAction.getShortcutSet(), this);
|
||||
}
|
||||
final DefaultActionGroup consoleActionGroup = new DefaultActionGroup() {
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
super.update(e);
|
||||
String eventViewName = BuildTreeConsoleView.class.getName();
|
||||
e.getPresentation().setVisible(myViewSettingsProvider != null && !myViewSettingsProvider.isSideBySideView()
|
||||
&& !BuildView.this.isViewVisible(eventViewName));
|
||||
}
|
||||
};
|
||||
|
||||
ExecutionConsole consoleView = getConsoleView();
|
||||
if (consoleView instanceof ConsoleView) {
|
||||
consoleView.getComponent(); //create editor to be able to add console editor actions
|
||||
final AnAction[] consoleActions = ((ConsoleView)consoleView).createConsoleActions();
|
||||
for (AnAction anAction : consoleActions) {
|
||||
if (anAction instanceof StopAction) {
|
||||
if (stopAction == null) {
|
||||
stopAction = anAction;
|
||||
}
|
||||
}
|
||||
else if (!(anAction instanceof FakeRerunAction ||
|
||||
anAction instanceof PinActiveTabAction ||
|
||||
anAction instanceof CloseAction)) {
|
||||
consoleActionGroup.add(anAction);
|
||||
}
|
||||
if (stopAction == null) {
|
||||
final AnAction[] consoleActions = ((ConsoleView)consoleView).createConsoleActions();
|
||||
stopAction = Arrays.stream(consoleActions).filter(StopAction.class::isInstance).findFirst().orElse(null);
|
||||
}
|
||||
}
|
||||
final DefaultActionGroup actionGroup = new DefaultActionGroup();
|
||||
@@ -330,10 +305,6 @@ public class BuildView extends CompositeView<ExecutionConsole>
|
||||
rerunActionGroup.add(stopAction);
|
||||
}
|
||||
actionGroup.add(rerunActionGroup);
|
||||
if (myViewManager.isBuildContentView() && (myViewSettingsProvider == null || !myViewSettingsProvider.isSideBySideView())) {
|
||||
actionGroup.addAll(getSwitchActions());
|
||||
actionGroup.addSeparator();
|
||||
}
|
||||
final DefaultActionGroup otherActionGroup = new DefaultActionGroup();
|
||||
|
||||
List<AnAction> otherActions = myBuildDescriptor.getActions();
|
||||
@@ -344,7 +315,7 @@ public class BuildView extends CompositeView<ExecutionConsole>
|
||||
}
|
||||
otherActionGroup.addSeparator();
|
||||
}
|
||||
return new AnAction[]{actionGroup, consoleActionGroup, otherActionGroup};
|
||||
return new AnAction[]{actionGroup, otherActionGroup};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.build;
|
||||
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
@ApiStatus.Experimental
|
||||
public interface BuildViewSettingsProvider {
|
||||
boolean isExecutionViewHidden();
|
||||
|
||||
default boolean isSideBySideView() {
|
||||
return Registry.is("build.view.side-by-side", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
@file:JvmName("BuildTreeFilters")
|
||||
package com.intellij.build
|
||||
|
||||
@@ -9,9 +9,7 @@ import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.actionSystem.DefaultActionGroup
|
||||
import com.intellij.openapi.actionSystem.ToggleAction
|
||||
import com.intellij.openapi.project.DumbAware
|
||||
import com.intellij.openapi.util.NlsContext
|
||||
import com.intellij.openapi.util.NlsContexts
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import java.util.function.Predicate
|
||||
|
||||
@@ -43,10 +41,6 @@ open class FilterToggleAction constructor(text: @NlsContexts.Command String,
|
||||
private val defaultState: Boolean) : ToggleAction(text), DumbAware {
|
||||
override fun isSelected(e: AnActionEvent): Boolean {
|
||||
val presentation = e.presentation
|
||||
if (!Registry.`is`("build.view.side-by-side", true)) {
|
||||
presentation.isVisible = false
|
||||
return false
|
||||
}
|
||||
val filteringEnabled = filterable.isFilteringEnabled
|
||||
presentation.isEnabledAndVisible = filteringEnabled
|
||||
if (filteringEnabled && stateKey != null &&
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.build
|
||||
|
||||
import com.intellij.build.events.MessageEvent
|
||||
@@ -33,10 +33,7 @@ class BuildTreeConsoleViewTest: LightPlatformTestCase() {
|
||||
"test descriptor",
|
||||
"fake path",
|
||||
1L)
|
||||
treeConsoleView = BuildTreeConsoleView(getProject(), buildDescriptor, null, object : BuildViewSettingsProvider {
|
||||
override fun isExecutionViewHidden(): Boolean = false
|
||||
override fun isSideBySideView(): Boolean = true
|
||||
})
|
||||
treeConsoleView = BuildTreeConsoleView(project, buildDescriptor, null) { false }
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -116,7 +113,7 @@ class BuildTreeConsoleViewTest: LightPlatformTestCase() {
|
||||
TreeUtil.visitVisibleRows(tree, visitor)
|
||||
|
||||
|
||||
assertThat(visitor.userObjects.map { it -> (it as ExecutionNode).name + "--" + it.result!!.javaClass.simpleName })
|
||||
assertThat(visitor.userObjects.map { (it as ExecutionNode).name + "--" + it.result!!.javaClass.simpleName })
|
||||
.containsExactly("build finished--FailureResultImpl", "build event--FailureResultImpl", "build nested event--FailureResultImpl", "error message--")
|
||||
}
|
||||
|
||||
|
||||
@@ -1656,9 +1656,6 @@ ide.service.view.split=false
|
||||
ide.service.view.split.description=Split services in tool windows by type
|
||||
ide.service.view.split.restartRequired=true
|
||||
|
||||
build.view.side-by-side=true
|
||||
build.view.side-by-side.description=Enable Build tool window tree and console side-by-side view
|
||||
|
||||
clipboard.history.max.items=100
|
||||
clipboard.history.max.items.description=Maximum number of items in clipboard history
|
||||
clipboard.history.max.memory=10000000
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.plugins.gradle.execution.test.runner;
|
||||
|
||||
import com.intellij.build.BuildViewSettingsProvider;
|
||||
@@ -8,8 +8,6 @@ import com.intellij.execution.testframework.sm.runner.SMTestLocator;
|
||||
import com.intellij.execution.testframework.sm.runner.SMTestProxy;
|
||||
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView;
|
||||
import com.intellij.execution.ui.ConsoleViewContentType;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -48,7 +46,7 @@ public class GradleTestsExecutionConsole extends SMTRunnerConsoleView implements
|
||||
|
||||
@Override
|
||||
public boolean isExecutionViewHidden() {
|
||||
return Registry.is("build.view.side-by-side", true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user