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