GitOrigin-RevId: 885625b9ea8799b652ff08eb3d4a07c245526d03
This commit is contained in:
Vladimir Krivosheev
2019-12-14 07:11:32 +00:00
committed by intellij-monorepo-bot
parent 0a26756d32
commit 4e2a69b7a9
13 changed files with 55 additions and 77 deletions
@@ -582,6 +582,7 @@ public class BuildTreeConsoleView implements ConsoleView, DataProvider, BuildCon
public void allowHeavyFilters() {
}
@NotNull
@Override
public JComponent getComponent() {
return myPanel;
@@ -109,6 +109,7 @@ public class CompositeView<T extends ComponentContainer> extends JPanel implemen
return new AnAction[]{actionGroup};
}
@NotNull
@Override
public JComponent getComponent() {
return this;
@@ -1,4 +1,4 @@
// Copyright 2000-2017 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-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.
package com.intellij.execution.console;
import com.intellij.execution.filters.Filter;
@@ -123,6 +123,7 @@ public class ConsoleViewWrapperBase implements ConsoleView, ExecutionConsoleEx {
: null;
}
@NotNull
@Override
public JComponent getComponent() {
return myDelegate.getComponent();
@@ -1,4 +1,4 @@
// Copyright 2000-2018 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-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.
package com.intellij.execution.console;
import com.google.common.collect.Lists;
@@ -32,7 +32,7 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.List;
public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> extends JPanel implements ConsoleView,
public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> extends JPanel implements ConsoleView,
ObservableConsoleView,
DataProvider {
private final static String PRIMARY_CONSOLE_PANEL = "PRIMARY_CONSOLE_PANEL";
@@ -204,7 +204,7 @@ public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> ext
@Override
public AnAction[] createConsoleActions() {
List<AnAction> actions = Lists.newArrayList();
actions.addAll(mergeConsoleActions(Arrays.asList(myPrimaryConsoleView.createConsoleActions()),
actions.addAll(mergeConsoleActions(Arrays.asList(myPrimaryConsoleView.createConsoleActions()),
Arrays.asList(mySecondaryConsoleView.createConsoleActions())));
actions.add(mySwitchConsoleAction);
@@ -220,6 +220,7 @@ public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> ext
myPrimaryConsoleView.allowHeavyFilters();
}
@NotNull
@Override
public JComponent getComponent() {
return this;
@@ -265,7 +266,7 @@ public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> ext
public void setDisableSwitchConsoleActionOnProcessEnd(boolean disableSwitchConsoleActionOnProcessEnd) {
myDisableSwitchConsoleActionOnProcessEnd = disableSwitchConsoleActionOnProcessEnd;
}
@NotNull
private List<AnAction> mergeConsoleActions(@NotNull List<? extends AnAction> actions1, @NotNull Collection<? extends AnAction> actions2) {
return ContainerUtil.map(actions1, action1 -> {
@@ -299,7 +300,7 @@ public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> ext
DuplexConsoleView.this.getComponent().revalidate();
}
}
private class SwitchDuplexConsoleViewAction extends ToggleAction implements DumbAware {
SwitchDuplexConsoleViewAction() {
@@ -336,7 +337,7 @@ public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> ext
}
}
}
private static class MergedToggleAction extends ToggleAction implements DumbAware {
@NotNull
private final ToggleAction myAction1;
@@ -379,5 +380,5 @@ public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> ext
myAction2.actionPerformed(e);
}
}
}
@@ -1,29 +1,14 @@
/*
* Copyright 2000-2009 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.
*/
// 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.
package com.intellij.openapi.ui;
import com.intellij.openapi.Disposable;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
public interface ComponentContainer extends Disposable {
@NotNull
JComponent getComponent();
JComponent getPreferredFocusableComponent();
JComponent getPreferredFocusableComponent();
}
@@ -7,6 +7,7 @@ import com.intellij.openapi.actionSystem.DataProvider;
import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.util.BusyObject;
import com.intellij.util.ContentsUtil;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -39,6 +40,7 @@ public interface ContentManager extends Disposable, BusyObject {
void setSelectedContent(@NotNull Content content);
@NotNull
@ApiStatus.Internal
ActionCallback setSelectedContentCB(@NotNull Content content);
void setSelectedContent(@NotNull Content content, boolean requestFocus);
@@ -172,14 +172,14 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Prop
myManager.addContentManagerListener(new ContentManagerListener() {
@Override
public void contentAdded(@NotNull final ContentManagerEvent event) {
public void contentAdded(@NotNull ContentManagerEvent event) {
getCurrentLayout().contentAdded(event);
event.getContent().addPropertyChangeListener(ToolWindowContentUi.this);
rebuild();
}
@Override
public void contentRemoved(@NotNull final ContentManagerEvent event) {
public void contentRemoved(@NotNull ContentManagerEvent event) {
event.getContent().removePropertyChangeListener(ToolWindowContentUi.this);
getCurrentLayout().contentRemoved(event);
ensureSelectedContentVisible();
@@ -187,11 +187,11 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Prop
}
@Override
public void contentRemoveQuery(@NotNull final ContentManagerEvent event) {
public void contentRemoveQuery(@NotNull ContentManagerEvent event) {
}
@Override
public void selectionChanged(@NotNull final ContentManagerEvent event) {
public void selectionChanged(@NotNull ContentManagerEvent event) {
ensureSelectedContentVisible();
update();
@@ -212,15 +212,17 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Prop
}
private void ensureSelectedContentVisible() {
final Content selected = myManager.getSelectedContent();
Content selected = myManager.getSelectedContent();
if (selected == null) {
myContent.removeAll();
return;
}
if (myContent.getComponentCount() == 1) {
final Component visible = myContent.getComponent(0);
if (visible == selected.getComponent()) return;
Component visible = myContent.getComponent(0);
if (visible == selected.getComponent()) {
return;
}
}
myContent.removeAll();
@@ -476,10 +478,11 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Prop
c.putClientProperty(TOOLWINDOW_UI_INSTALLED, Boolean.TRUE);
}
private void initActionGroup(DefaultActionGroup group, final Content content) {
private void initActionGroup(DefaultActionGroup group, @Nullable Content content) {
if (content == null) {
return;
}
group.addSeparator();
group.add(new TabbedContentAction.CloseAction(content));
group.add(myCloseAllAction);
@@ -512,6 +515,7 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Prop
if (selectedContent == null && toolWindowGroup == null) {
return;
}
DefaultActionGroup configuredGroup = (DefaultActionGroup)ActionManager.getInstance().getAction("ToolWindowContextMenu");
DefaultActionGroup group = new DefaultActionGroup();
group.copyFromGroup(configuredGroup);
@@ -527,7 +531,8 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Prop
popupMenu.getComponent().show(comp, x, y);
}
private static AnAction createSplitTabsAction(final TabbedContent content) {
@NotNull
private static AnAction createSplitTabsAction(@NotNull TabbedContent content) {
return new DumbAwareAction("Split '" + content.getTitlePrefix() + "' group") {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
@@ -536,7 +541,8 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Prop
};
}
private static AnAction createMergeTabsAction(final ContentManager manager, final String tabPrefix) {
@NotNull
private static AnAction createMergeTabsAction(@NotNull ContentManager manager, String tabPrefix) {
return new DumbAwareAction("Merge tabs to '" + tabPrefix + "' group") {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
@@ -568,7 +574,7 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Prop
};
}
private void processHide(final MouseEvent e) {
private void processHide(@NotNull MouseEvent e) {
IdeEventQueue.getInstance().blockNextEvents(e);
final Component c = e.getComponent();
if (c instanceof BaseLabel) {
@@ -576,12 +582,14 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Prop
if (tab.getContent() != null) {
if (myManager.canCloseContents() && tab.getContent().isCloseable()) {
myManager.removeContent(tab.getContent(), true, true, true);
} else {
}
else {
if (myManager.getContentCount() == 1) {
hideWindow(e);
}
}
} else {
}
else {
hideWindow(e);
}
}
@@ -590,7 +598,7 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Prop
}
}
private void hideWindow(final MouseEvent e) {
private void hideWindow(@NotNull MouseEvent e) {
if (e.isControlDown()) {
myWindow.fireHiddenSide();
}
@@ -613,7 +621,7 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Prop
return null;
}
@NotNull
private CloseAction.CloseTarget computeCloseTarget() {
if (myManager.canCloseContents()) {
Content selected = myManager.getSelectedContent();
@@ -625,15 +633,14 @@ public final class ToolWindowContentUi extends JPanel implements ContentUI, Prop
return new HideToolwindowTarget();
}
private class HideToolwindowTarget implements CloseAction.CloseTarget {
private final class HideToolwindowTarget implements CloseAction.CloseTarget {
@Override
public void close() {
myWindow.fireHidden();
}
}
private class CloseContentTarget implements CloseAction.CloseTarget {
private final class CloseContentTarget implements CloseAction.CloseTarget {
private final Content myContent;
private CloseContentTarget(Content content) {
@@ -292,6 +292,7 @@ public class TerminalExecutionConsole implements ConsoleView, ObservableConsoleV
public void allowHeavyFilters() {
}
@NotNull
@Override
public JComponent getComponent() {
return myTerminalWidget.getComponent();
@@ -59,6 +59,7 @@ public class ContentImpl extends UserDataHolderBase implements Content {
myPinnable = isPinnable;
}
@NotNull
@Override
public JComponent getComponent() {
return myComponent;
@@ -508,7 +508,7 @@ public class ContentManagerImpl implements ContentManager, PropertyChangeListene
}
@Override
public void setSelectedContent(@NotNull final Content content) {
public void setSelectedContent(@NotNull Content content) {
setSelectedContentCB(content);
}
@@ -1,24 +1,13 @@
/*
* 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.
*/
// 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.
package com.intellij.execution.testframework.ui;
import com.intellij.execution.filters.Filter;
import com.intellij.execution.filters.HyperlinkInfo;
import com.intellij.execution.process.ProcessHandler;
import com.intellij.execution.testframework.*;
import com.intellij.execution.testframework.AbstractTestProxy;
import com.intellij.execution.testframework.HyperLink;
import com.intellij.execution.testframework.Printable;
import com.intellij.execution.testframework.TestConsoleProperties;
import com.intellij.execution.ui.ConsoleView;
import com.intellij.execution.ui.ConsoleViewContentType;
import com.intellij.execution.ui.ObservableConsoleView;
@@ -128,6 +117,7 @@ public abstract class BaseTestsOutputConsoleView implements ConsoleView, Observa
return myPrinter != null && myPrinter.canPause() && myConsole.canPause();
}
@NotNull
@Override
public JComponent getComponent() {
return myTestResultsPanel;
@@ -590,6 +590,7 @@ public abstract class CommitChangeListDialog extends DialogWrapper implements Si
return myCommitMessageArea.getEditorField();
}
@NotNull
@Override
public JComponent getComponent() {
return mySplitter;
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2014 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.
*/
// 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.
package com.intellij.lang.ant.config.execution;
import com.intellij.execution.DefaultExecutionResult;
@@ -54,6 +40,7 @@ public class AntRunProfileState implements RunProfileState {
}
return new DefaultExecutionResult(new ExecutionConsole() {
@NotNull
@Override
public JComponent getComponent() {
return processHandler.getUserData(MESSAGE_VIEW);