use of com.intellij.ide.browsers.OpenUrlHyperlinkInfo in project intellij-plugins by JetBrains.
the class JstdConsoleView method initUI.
@Override
public void initUI() {
super.initUI();
if (myServer == null) {
return;
}
TestTreeView treeView = this.getResultsViewer().getTreeView();
TestTreeRenderer originalRenderer = ObjectUtils.tryCast(treeView.getCellRenderer(), TestTreeRenderer.class);
if (originalRenderer != null) {
myFormatter = new JstdRootTestProxyFormatter(myServer, treeView);
originalRenderer.setAdditionalRootFormatter(myFormatter);
}
if (!myServer.isStopped() && myServer.getCapturedBrowsers().isEmpty()) {
myServer.addLifeCycleListener(new JstdServerLifeCycleAdapter() {
@Override
public void onServerStarted() {
print("To capture a browser open ", ConsoleViewContentType.SYSTEM_OUTPUT);
String url = myServer.getServerUrl() + "/capture";
printHyperlink(url, new OpenUrlHyperlinkInfo(url));
print("\n", ConsoleViewContentType.SYSTEM_OUTPUT);
}
}, this);
}
myServer.addLifeCycleListener(new JstdServerLifeCycleAdapter() {
@Override
public void onServerTerminated(int exitCode) {
print("JsTestDriver server finished with exit code " + exitCode + "\n", ConsoleViewContentType.SYSTEM_OUTPUT);
JstdToolWindowManager.getInstance(getProperties().getProject()).show();
}
}, this);
}
use of com.intellij.ide.browsers.OpenUrlHyperlinkInfo in project intellij-plugins by JetBrains.
the class KarmaConsoleView method printBrowserCapturingSuggestion.
private void printBrowserCapturingSuggestion() {
SMTestProxy.SMRootTestProxy rootNode = getResultsViewer().getTestsRootNode();
rootNode.addLast(printer -> {
printer.print("To capture a browser open ", ConsoleViewContentType.SYSTEM_OUTPUT);
String url = myServer.formatUrl("/");
printer.printHyperlink(url, new OpenUrlHyperlinkInfo(url));
printer.print("\n", ConsoleViewContentType.SYSTEM_OUTPUT);
});
}
Aggregations