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


Java MessageConsole.newOutputStream方法代码示例

本文整理汇总了Java中org.eclipse.ui.console.MessageConsole.newOutputStream方法的典型用法代码示例。如果您正苦于以下问题:Java MessageConsole.newOutputStream方法的具体用法?Java MessageConsole.newOutputStream怎么用?Java MessageConsole.newOutputStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.console.MessageConsole的用法示例。


在下文中一共展示了MessageConsole.newOutputStream方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getConsoleOutputStream

import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
public static IOConsoleOutputStream getConsoleOutputStream(String name, String iconPath) {
    synchronized (lock) {
        IOConsoleOutputStream outputStream = consoleOutputs.get(name);
        if (outputStream == null) {
            MessageConsole console = getConsole(name, iconPath);

            HashMap<IOConsoleOutputStream, String> themeConsoleStreamToColor = new HashMap<IOConsoleOutputStream, String>();
            outputStream = console.newOutputStream();
            themeConsoleStreamToColor.put(outputStream, "console.output");
            console.setAttribute("themeConsoleStreamToColor", themeConsoleStreamToColor);
            ConsoleColorCache.getDefault().keepConsoleColorsSynched(console);
            consoles.put(name, console);
            consoleOutputs.put(name, outputStream);
        }
        return outputStream;
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:18,代码来源:MessageConsoles.java

示例2: run

import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
public static void run(final BuildLauncher build, final IProgressMonitor monitor, String... runArgs) {
    monitor.beginTask("Running gradle build", IProgressMonitor.UNKNOWN);
    MessageConsole messageConsole = UiUtils.getMessageConsole("Gradle run");
    final IOConsoleOutputStream consoleStream = messageConsole.newOutputStream();
    build.setStandardOutput(consoleStream);
    build.setStandardError(consoleStream);
    GradlePluginUtils.setBuildLoggingOptions(build, runArgs);
    UiUtils.showConsoleView();
    // STUDIO-2676 - bring new console to front
    ConsolePlugin.getDefault().getConsoleManager().showConsoleView(messageConsole);
    
    build.addProgressListener(new ProgressListener() {
        
        @Override
        public void statusChanged(ProgressEvent progressEvent) {
            monitor.beginTask(progressEvent.getDescription(), IProgressMonitor.UNKNOWN);
        }
    });
    
    build.run();
    monitor.done();
}
 
开发者ID:mulesoft,项目名称:mule-tooling-incubator,代码行数:23,代码来源:GradleRunner.java

示例3: redirectOutputToConsole

import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
private void redirectOutputToConsole(PipedOutputStream nextOutput) {
    MessageConsole messageConsole = MavenUIPlugin.getDefault().getGenericOutputConsole();
    final IOConsoleOutputStream consoleStream = messageConsole.newOutputStream();
    PipedInputStream inputStream = null;
    try {
        inputStream = new PipedInputStream(nextOutput);
    } catch (IOException e) {
        throw new RuntimeException("IO exception creating piped streams (should not happen)", e);
    }
    redirectOutputToConsoleThread = new OutputRedirectorThread(inputStream, consoleStream, RunnableUtils.newRunnableClosing(inputStream, consoleStream));

    UiUtils.showConsoleView();
    // STUDIO-2676 - bring new console to front
    ConsolePlugin.getDefault().getConsoleManager().showConsoleView(messageConsole);
    redirectOutputToConsoleThread.start();
}
 
开发者ID:mulesoft,项目名称:mule-tooling-incubator,代码行数:17,代码来源:LifeCycleJob.java

示例4: runFile

import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
@Override
protected void runFile ( final IFile file, final IProgressMonitor monitor ) throws Exception
{

    final MessageConsole mc = new MessageConsole ( String.format ( "OSCAR Validation: %s", file ), "org.eclipse.scada.configuration.oscar.validation", null, true );

    ConsolePlugin.getDefault ().getConsoleManager ().addConsoles ( new IConsole[] { mc } );
    mc.activate ();

    final File dataFile = file.getLocation ().toFile ();

    Map<String, Map<String, Map<String, String>>> data;

    if ( OscarLoader.isOscar ( dataFile ) )
    {
        data = new OscarLoader ( dataFile ).getData ();
    }
    else
    {
        try (FileInputStream stream = new FileInputStream ( dataFile ))
        {
            data = OscarLoader.loadJsonData ( stream );
        }
    }

    final PrintStream consoleStream = new PrintStream ( mc.newOutputStream () );
    try
    {
        new LoopValidator ( data, consoleStream ).validate ();
    }
    finally
    {
        consoleStream.close ();
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:36,代码来源:OscarValidatorHandler.java


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