use of com.intellij.execution.filters.TextConsoleBuilder in project android by JetBrains.
the class AndroidRunConfiguration method getConsoleProvider.
@NotNull
@Override
protected ConsoleProvider getConsoleProvider() {
return new ConsoleProvider() {
@NotNull
@Override
public ConsoleView createAndAttach(@NotNull Disposable parent, @NotNull ProcessHandler handler, @NotNull Executor executor) throws ExecutionException {
Project project = getConfigurationModule().getProject();
final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
ConsoleView console = builder.getConsole();
console.attachToProcess(handler);
return console;
}
};
}
use of com.intellij.execution.filters.TextConsoleBuilder in project intellij-community by JetBrains.
the class DebuggerUtilsEx method addThreadDump.
public static void addThreadDump(Project project, List<ThreadState> threads, final RunnerLayoutUi ui, DebuggerSession session) {
final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
consoleBuilder.filters(ExceptionFilters.getFilters(session.getSearchScope()));
final ConsoleView consoleView = consoleBuilder.getConsole();
final DefaultActionGroup toolbarActions = new DefaultActionGroup();
consoleView.allowHeavyFilters();
final ThreadDumpPanel panel = new ThreadDumpPanel(project, consoleView, toolbarActions, threads);
final String id = THREAD_DUMP_CONTENT_PREFIX + " #" + myCurrentThreadDumpId;
final Content content = ui.createContent(id, panel, id, null, null);
content.putUserData(RunnerContentUi.LIGHTWEIGHT_CONTENT_MARKER, Boolean.TRUE);
content.setCloseable(true);
content.setDescription("Thread Dump");
ui.addContent(content);
ui.selectAndFocus(content, true, true);
myThreadDumpsCount++;
myCurrentThreadDumpId++;
Disposer.register(content, new Disposable() {
@Override
public void dispose() {
myThreadDumpsCount--;
if (myThreadDumpsCount == 0) {
myCurrentThreadDumpId = 1;
}
}
});
Disposer.register(content, consoleView);
ui.selectAndFocus(content, true, false);
if (threads.size() > 0) {
panel.selectStackFrame(0);
}
}
use of com.intellij.execution.filters.TextConsoleBuilder in project intellij-community by JetBrains.
the class MavenConsoleImpl method createConsoleBuilder.
public static TextConsoleBuilder createConsoleBuilder(final Project project) {
TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
builder.addFilter(new RegexpFilter(project, CONSOLE_FILTER_REGEXP) {
@Nullable
@Override
protected HyperlinkInfo createOpenFileHyperlink(String fileName, int line, int column) {
HyperlinkInfo res = super.createOpenFileHyperlink(fileName, line, column);
if (res == null && fileName.startsWith("\\") && SystemInfo.isWindows) {
// Maven cut prefix 'C:\' from paths on Windows
VirtualFile[] roots = ProjectRootManager.getInstance(project).getContentRoots();
if (roots.length > 0) {
String projectPath = roots[0].getPath();
if (projectPath.matches("[A-Z]:[\\\\/].+")) {
res = super.createOpenFileHyperlink(projectPath.charAt(0) + ":" + fileName, line, column);
}
}
}
return res;
}
});
builder.addFilter(new MavenGroovyConsoleFilter(project));
builder.addFilter(new MavenScalaConsoleFilter(project));
builder.addFilter(new MavenTestConsoleFilter());
return builder;
}
use of com.intellij.execution.filters.TextConsoleBuilder in project intellij-community by JetBrains.
the class XsltRunConfiguration method getState.
@Override
public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment executionEnvironment) throws ExecutionException {
if (myXsltFile == null)
throw new ExecutionException("No XSLT file selected");
final VirtualFile baseFile = myXsltFile.getFile();
final XsltCommandLineState state = new XsltCommandLineState(this, executionEnvironment);
final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(getProject());
builder.addFilter(new CustomRegexpFilter(getProject(), RegexpFilter.FILE_PATH_MACROS + "\\:" + "(?:(?: line )?" + RegexpFilter.LINE_MACROS + ")?" + "(?:\\:(?: column )?" + RegexpFilter.COLUMN_MACROS + ")?", baseFile, STRICT_FILE_PATH_EXPR));
builder.addFilter(new CustomRegexpFilter(getProject(), LOG_TAG + RegexpFilter.FILE_PATH_MACROS + "\\:" + "(?:(?: line )?" + RegexpFilter.LINE_MACROS + ")?" + "(?:\\:(?: column )?" + RegexpFilter.COLUMN_MACROS + ")?", baseFile, RELAXED_FILE_PATH_EXPR));
builder.addFilter(new CustomRegexpFilter(getProject(), RegexpFilter.FILE_PATH_MACROS + ";" + " \\w+ #" + RegexpFilter.LINE_MACROS + "(?:; \\w+ #" + RegexpFilter.COLUMN_MACROS + ")?", baseFile, STRICT_FILE_PATH_EXPR));
builder.addFilter(new CustomRegexpFilter(getProject(), LOG_TAG + RegexpFilter.FILE_PATH_MACROS + ";" + " \\w+ #" + RegexpFilter.LINE_MACROS + "(?:; \\w+ #" + RegexpFilter.COLUMN_MACROS + ")?", baseFile, RELAXED_FILE_PATH_EXPR));
builder.addFilter(new CustomRegexpFilter(getProject(), "(?:" + RegexpFilter.FILE_PATH_MACROS + ")?" + " line " + RegexpFilter.LINE_MACROS + "(?:\\:(?: column )?" + RegexpFilter.COLUMN_MACROS + ")?", baseFile, STRICT_FILE_PATH_EXPR));
state.setConsoleBuilder(builder);
return state;
}
use of com.intellij.execution.filters.TextConsoleBuilder in project intellij-community by JetBrains.
the class ConsoleManager method createConsole.
private void createConsole(@NotNull final NetService netService) {
TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(netService.getProject());
netService.configureConsole(consoleBuilder);
console = consoleBuilder.getConsole();
ApplicationManager.getApplication().invokeLater(() -> {
ActionGroup actionGroup = netService.getConsoleToolWindowActions();
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, false);
SimpleToolWindowPanel toolWindowPanel = new SimpleToolWindowPanel(false, true);
toolWindowPanel.setContent(console.getComponent());
toolWindowPanel.setToolbar(toolbar.getComponent());
ToolWindow toolWindow = ToolWindowManager.getInstance(netService.getProject()).registerToolWindow(netService.getConsoleToolWindowId(), false, ToolWindowAnchor.BOTTOM, netService.getProject(), true);
toolWindow.setIcon(netService.getConsoleToolWindowIcon());
Content content = ContentFactory.SERVICE.getInstance().createContent(toolWindowPanel, "", false);
Disposer.register(content, console);
toolWindow.getContentManager().addContent(content);
}, netService.getProject().getDisposed());
}
Aggregations