Search in sources :

Example 36 with Content

use of com.intellij.ui.content.Content in project intellij-community by JetBrains.

the class ExecutionToolWindowFixture method findContent.

@NotNull
public ContentFixture findContent(@NotNull TextMatcher tabNameMatcher) {
    Content content = getContent(tabNameMatcher);
    assertNotNull(content);
    return new ContentFixture(this, myRobot, content);
}
Also used : Content(com.intellij.ui.content.Content) Assert.assertNotNull(junit.framework.Assert.assertNotNull) NotNull(org.jetbrains.annotations.NotNull)

Example 37 with Content

use of com.intellij.ui.content.Content in project intellij-community by JetBrains.

the class ToolWindowFixture method getContent.

@Nullable
protected Content getContent(@NotNull final String displayName) {
    activateAndWaitUntilIsVisible();
    final Ref<Content> contentRef = new Ref<>();
    pause(new Condition("finding content '" + displayName + "'") {

        @Override
        public boolean test() {
            Content[] contents = getContents();
            for (Content content : contents) {
                if (displayName.equals(content.getDisplayName())) {
                    contentRef.set(content);
                    return true;
                }
            }
            return false;
        }
    }, GuiTestUtil.SHORT_TIMEOUT);
    return contentRef.get();
}
Also used : Condition(org.fest.swing.timing.Condition) Ref(com.intellij.openapi.util.Ref) Content(com.intellij.ui.content.Content) Nullable(org.jetbrains.annotations.Nullable)

Example 38 with Content

use of com.intellij.ui.content.Content in project intellij-community by JetBrains.

the class ToolWindowFixture method getContent.

@Nullable
protected Content getContent(@NotNull final TextMatcher displayNameMatcher, @NotNull Timeout timeout) {
    long now = System.currentTimeMillis();
    long budget = timeout.duration();
    activateAndWaitUntilIsVisible(Timeout.timeout(budget));
    long revisedNow = System.currentTimeMillis();
    budget -= (revisedNow - now);
    final Ref<Content> contentRef = new Ref<>();
    pause(new Condition("finding content matching " + displayNameMatcher.formattedValues()) {

        @Override
        public boolean test() {
            Content[] contents = getContents();
            for (Content content : contents) {
                String displayName = content.getDisplayName();
                if (displayNameMatcher.isMatching(displayName)) {
                    contentRef.set(content);
                    return true;
                }
            }
            return false;
        }
    }, Timeout.timeout(budget));
    return contentRef.get();
}
Also used : Condition(org.fest.swing.timing.Condition) Ref(com.intellij.openapi.util.Ref) Content(com.intellij.ui.content.Content) Nullable(org.jetbrains.annotations.Nullable)

Example 39 with Content

use of com.intellij.ui.content.Content in project intellij-community by JetBrains.

the class MessagesToolWindowFixture method getGradleSyncContent.

@NotNull
public ContentFixture getGradleSyncContent() {
    Content content = getContent("Gradle Sync");
    assertNotNull(content);
    return new SyncContentFixture(content);
}
Also used : Content(com.intellij.ui.content.Content) Assert.assertNotNull(junit.framework.Assert.assertNotNull) NotNull(org.jetbrains.annotations.NotNull)

Example 40 with Content

use of com.intellij.ui.content.Content in project intellij-community by JetBrains.

the class EventLog method activate.

private static void activate(@NotNull ToolWindow eventLog, @Nullable final String groupId, @Nullable final Runnable r) {
    eventLog.activate(() -> {
        if (groupId == null)
            return;
        String contentName = getContentName(groupId);
        Content content = eventLog.getContentManager().findContent(contentName);
        if (content != null) {
            eventLog.getContentManager().setSelectedContent(content);
        }
        if (r != null) {
            r.run();
        }
    }, true);
}
Also used : Content(com.intellij.ui.content.Content)

Aggregations

Content (com.intellij.ui.content.Content)157 ContentManager (com.intellij.ui.content.ContentManager)42 ToolWindow (com.intellij.openapi.wm.ToolWindow)37 NotNull (org.jetbrains.annotations.NotNull)19 ContentFactory (com.intellij.ui.content.ContentFactory)14 Project (com.intellij.openapi.project.Project)13 Nullable (org.jetbrains.annotations.Nullable)13 MessageView (com.intellij.ui.content.MessageView)10 Disposable (com.intellij.openapi.Disposable)8 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)8 RunnerLayoutUi (com.intellij.execution.ui.RunnerLayoutUi)7 ToolWindowManagerEx (com.intellij.openapi.wm.ex.ToolWindowManagerEx)7 ConsoleView (com.intellij.execution.ui.ConsoleView)6 SimpleToolWindowPanel (com.intellij.openapi.ui.SimpleToolWindowPanel)6 TabbedContent (com.intellij.ui.content.TabbedContent)6 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)5 Ref (com.intellij.openapi.util.Ref)5 ExecutionConsole (com.intellij.execution.ui.ExecutionConsole)4 ToolWindowManagerAdapter (com.intellij.openapi.wm.ex.ToolWindowManagerAdapter)4 Assert.assertNotNull (junit.framework.Assert.assertNotNull)4