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);
}
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();
}
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();
}
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);
}
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);
}
Aggregations