当前位置: 首页>>代码示例>>Java>>正文


Java TextConsoleBuilderFactory类代码示例

本文整理汇总了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);


}
 
开发者ID:3mmarg97,项目名称:LaravelStorm,代码行数:17,代码来源:LogTab.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ConsoleManager.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:RunIdeConsoleAction.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:LogConsoleBase.java

示例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");
    }
  }
}
 
开发者ID:CleverCloud,项目名称:clever-intellij-plugin,代码行数:25,代码来源:CcLogsToolWindow.java

示例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();
}
 
开发者ID:traff,项目名称:intellij-ocaml,代码行数:27,代码来源:OCamlTopLevelConsoleView.java

示例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);
}
 
开发者ID:antlr,项目名称:intellij-plugin-v4,代码行数:25,代码来源:ANTLRv4PluginController.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:26,代码来源:NekoRunningState.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:ProjectLevelVcsManagerImpl.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:RunIdeConsoleAction.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:20,代码来源:JavaExecutionUtil.java

示例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());
    }
}
 
开发者ID:KariiO,项目名称:Gherkin-TS-Runner,代码行数:40,代码来源:GherkinIconRenderer.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:DebuggerUtilsEx.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:JavaExecutionUtil.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ApplicationConfiguration.java


注:本文中的com.intellij.execution.filters.TextConsoleBuilderFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。