本文整理汇总了Java中com.intellij.execution.filters.TextConsoleBuilderFactory类的典型用法代码示例。如果您正苦于以下问题:Java TextConsoleBuilderFactory类的具体用法?Java TextConsoleBuilderFactory怎么用?Java TextConsoleBuilderFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextConsoleBuilderFactory类属于com.intellij.execution.filters包,在下文中一共展示了TextConsoleBuilderFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LogTab
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
public LogTab(Project project) {
super(new BorderLayout());
this.project = project;
handler = new EmptyProcess();
group = new ActionGroup() {
@NotNull
@Override
public AnAction[] getChildren(@Nullable AnActionEvent anActionEvent) {
return console.createConsoleActions();
}
};
console = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
console.attachToProcess(handler);
}
示例2: createConsole
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
private void createConsole(@NotNull final NetService netService) {
TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(netService.getProject());
netService.configureConsole(consoleBuilder);
console = consoleBuilder.getConsole();
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
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());
}
示例3: createConsoleView
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
@NotNull
private static RunContentDescriptor createConsoleView(@NotNull Project project, @NotNull PsiFile psiFile) {
ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
DefaultActionGroup toolbarActions = new DefaultActionGroup();
JComponent panel = new JPanel(new BorderLayout());
panel.add(consoleView.getComponent(), BorderLayout.CENTER);
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, toolbarActions, false);
toolbar.setTargetComponent(consoleView.getComponent());
panel.add(toolbar.getComponent(), BorderLayout.WEST);
final RunContentDescriptor descriptor = new RunContentDescriptor(consoleView, null, panel, psiFile.getName()) {
@Override
public boolean isContentReuseProhibited() {
return true;
}
};
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
toolbarActions.addAll(consoleView.createConsoleActions());
toolbarActions.add(new CloseAction(executor, descriptor, project));
ExecutionManager.getInstance(project).getContentManager().showRunContent(executor, descriptor);
return descriptor;
}
示例4: LogConsoleBase
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
public LogConsoleBase(@NotNull Project project, @Nullable Reader reader, String title, final boolean buildInActions, LogFilterModel model,
@NotNull GlobalSearchScope scope, LogFormatter formatter) {
super(new BorderLayout());
myProject = project;
myTitle = title;
myModel = model;
myFormatter = formatter;
myFilters = myModel.getLogFilters();
myReaderThread = new ReaderThread(reader);
myBuildInActions = buildInActions;
TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project, scope);
myConsole = builder.getConsole();
myConsole.attachToProcess(myProcessHandler);
myDisposed = false;
myModel.addFilterListener(this);
}
示例5: CcLogsToolWindow
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
public CcLogsToolWindow(@NotNull Project project) {
ToolWindow toolWindow = ToolWindowManager.getInstance(project).registerToolWindow("Logs Clever Cloud", false, ToolWindowAnchor.BOTTOM);
ContentManager contentManager = toolWindow.getContentManager();
ProjectSettings projectSettings = ServiceManager.getService(project, ProjectSettings.class);
ArrayList<Application> applications = projectSettings.applications;
for (Application application : applications) {
TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
ConsoleView console = builder.getConsole();
Content logs = contentManager.getFactory().createContent(console.getComponent(), application.name, false);
contentManager.addContent(logs);
writeLogs(project, application, console);
String oldLogs = CcApi.getInstance(project).logRequest(application);
if (oldLogs != null && !oldLogs.isEmpty()) {
WebSocketCore.printSocket(console, oldLogs);
}
else if (oldLogs != null && oldLogs.isEmpty()) {
WebSocketCore.printSocket(console, "No logs available.\n");
}
}
}
示例6: OCamlTopLevelConsoleView
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
public OCamlTopLevelConsoleView(@NotNull final Project project, @NotNull final ContentManager contentManager, final Sdk topLevelSdk) throws ExecutionException {
super(project, contentManager);
myConsoleNumber = ++ourLastConsoleNumber;
final GeneralCommandLine cmd = createCommandLine(topLevelSdk);
myConsoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
myProcessHandler = new OSProcessHandler(cmd.createProcess(), cmd.getCommandLineString());
myConsoleView.attachToProcess(myProcessHandler);
ProcessTerminatedListener.attach(myProcessHandler);
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
final DefaultActionGroup group = new DefaultActionGroup();
group.add(getOCamlToolWindowOpenCloseAction(true, false));
group.addAll(myConsoleView.createConsoleActions());
group.add(getOCamlToolWindowSettingsAction());
group.add(getOCamlToolWindowOpenCloseAction(false, true));
final JComponent toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, false).getComponent();
toolbar.setMaximumSize(new Dimension(toolbar.getPreferredSize().width, Integer.MAX_VALUE));
add(toolbar);
add(myConsoleView.getComponent());
myConsoleView.getComponent().requestFocus();
myProcessHandler.startNotify();
}
示例7: createToolWindows
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
public void createToolWindows() {
LOG.info("createToolWindows "+project.getName());
ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
previewPanel = new PreviewPanel(project);
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(previewPanel, "", false);
previewWindow = toolWindowManager.registerToolWindow(PREVIEW_WINDOW_ID, true, ToolWindowAnchor.BOTTOM);
previewWindow.getContentManager().addContent(content);
previewWindow.setIcon(Icons.FILE);
TextConsoleBuilderFactory factory = TextConsoleBuilderFactory.getInstance();
TextConsoleBuilder consoleBuilder = factory.createBuilder(project);
this.console = consoleBuilder.getConsole();
JComponent consoleComponent = console.getComponent();
content = contentFactory.createContent(consoleComponent, "", false);
consoleWindow = toolWindowManager.registerToolWindow(CONSOLE_WINDOW_ID, true, ToolWindowAnchor.BOTTOM);
consoleWindow.getContentManager().addContent(content);
consoleWindow.setIcon(Icons.FILE);
}
示例8: getCommandForNeko
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
private GeneralCommandLine getCommandForNeko(@Nullable HaxeSdkData sdkData, HaxeModuleSettings settings) throws ExecutionException {
if (sdkData == null || sdkData.getNekoBinPath() == null || sdkData.getNekoBinPath().isEmpty()) {
throw new ExecutionException(HaxeBundle.message("haxe.run.bad.neko.bin.path"));
}
GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath(sdkData.getNekoBinPath());
commandLine.setWorkDirectory(module.getModuleDirPath());
if (customFileToLaunch != null) {
commandLine.addParameter(customFileToLaunch);
}
else {
final VirtualFile outputDirectory = CompilerPathsImpl.getModuleOutputDirectory(module, false);
final VirtualFile fileToLaunch = outputDirectory != null ? outputDirectory.findChild(settings.getOutputFileName()) : null;
if (fileToLaunch != null) {
commandLine.addParameter(fileToLaunch.getPath());
}
}
final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(module.getProject());
setConsoleBuilder(consoleBuilder);
return commandLine;
}
示例9: getOrCreateConsoleContent
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
private Content getOrCreateConsoleContent(final ContentManager contentManager) {
final String displayName = VcsBundle.message("vcs.console.toolwindow.display.name");
Content content = contentManager.findContent(displayName);
if (content == null) {
releaseConsole();
myConsole = TextConsoleBuilderFactory.getInstance().createBuilder(myProject).getConsole();
JPanel panel = new JPanel(new BorderLayout());
panel.add(myConsole.getComponent(), BorderLayout.CENTER);
ActionToolbar toolbar = ActionManager.getInstance()
.createActionToolbar("VcsManager", new DefaultActionGroup(myConsole.createConsoleActions()), false);
panel.add(toolbar.getComponent(), BorderLayout.WEST);
content = ContentFactory.getInstance().createContent(panel, displayName, true);
content.setDisposer(myConsoleDisposer);
contentManager.addContent(content);
for (Pair<String, ConsoleViewContentType> pair : myPendingOutput) {
printToConsole(pair.first, pair.second);
}
myPendingOutput.clear();
}
return content;
}
示例10: createConsoleView
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
@Nonnull
private static RunContentDescriptor createConsoleView(@Nonnull Project project, @Nonnull PsiFile psiFile) {
ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
DefaultActionGroup toolbarActions = new DefaultActionGroup();
JComponent panel = new JPanel(new BorderLayout());
panel.add(consoleView.getComponent(), BorderLayout.CENTER);
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, toolbarActions, false);
toolbar.setTargetComponent(consoleView.getComponent());
panel.add(toolbar.getComponent(), BorderLayout.WEST);
final RunContentDescriptor descriptor = new RunContentDescriptor(consoleView, null, panel, psiFile.getName()) {
@Override
public boolean isContentReuseProhibited() {
return true;
}
};
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
toolbarActions.addAll(consoleView.createConsoleActions());
toolbarActions.add(new CloseAction(executor, descriptor, project));
ExecutionManager.getInstance(project).getContentManager().showRunContent(executor, descriptor);
return descriptor;
}
示例11: getState
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
@Override
public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) throws ExecutionException
{
final JavaCommandLineState state = new JavaCommandLineState(env)
{
@Override
protected OwnJavaParameters createJavaParameters()
{
return myParameters;
}
};
final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(myProject);
if(myFilters != null)
{
builder.filters(myFilters);
}
state.setConsoleBuilder(builder);
return state;
}
示例12: callProtractor
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
private void callProtractor() {
try {
Config config = Config.getInstance(project);
if (config == null) {
return;
}
GeneralCommandLine command = getProtractorRunCommand(config);
Process p = command.createProcess();
if (project != null) {
ToolWindowManager manager = ToolWindowManager.getInstance(project);
String id = "Gherkin Runner";
TextConsoleBuilderFactory factory = TextConsoleBuilderFactory.getInstance();
TextConsoleBuilder builder = factory.createBuilder(project);
ConsoleView view = builder.getConsole();
ColoredProcessHandler handler = new ColoredProcessHandler(p, command.getPreparedCommandLine());
handler.startNotify();
view.attachToProcess(handler);
ToolWindow window = manager.getToolWindow(id);
Icon cucumberIcon = IconLoader.findIcon("/resources/icons/cucumber.png");
if (window == null) {
window = manager.registerToolWindow(id, true, ToolWindowAnchor.BOTTOM);
window.setIcon(cucumberIcon);
}
ContentFactory cf = window.getContentManager().getFactory();
Content c = cf.createContent(view.getComponent(), "Run " + (window.getContentManager().getContentCount() + 1), true);
window.getContentManager().addContent(c);
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
示例13: addThreadDump
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
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);
}
}
示例14: getState
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
@Override
public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) {
final JavaCommandLineState state = new JavaCommandLineState(env) {
@Override
protected JavaParameters createJavaParameters() {
return myParameters;
}
};
final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(myProject);
if (myFilters != null) {
builder.filters(myFilters);
}
state.setConsoleBuilder(builder);
return state;
}
示例15: getState
import com.intellij.execution.filters.TextConsoleBuilderFactory; //导入依赖的package包/类
@Override
public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) throws ExecutionException {
final JavaCommandLineState state = new JavaApplicationCommandLineState<ApplicationConfiguration>(this, env);
JavaRunConfigurationModule module = getConfigurationModule();
state.setConsoleBuilder(TextConsoleBuilderFactory.getInstance().createBuilder(getProject(), module.getSearchScope()));
return state;
}