本文整理汇总了Java中org.eclipse.ui.console.MessageConsole.newMessageStream方法的典型用法代码示例。如果您正苦于以下问题:Java MessageConsole.newMessageStream方法的具体用法?Java MessageConsole.newMessageStream怎么用?Java MessageConsole.newMessageStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.console.MessageConsole
的用法示例。
在下文中一共展示了MessageConsole.newMessageStream方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOutputStream
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
@Override
public OutputStream getOutputStream(final OutputStreamType type, OutputRedirection redirect) {
if (!PlatformUI.isWorkbenchRunning()) {
return DEFAULT.getOutputStream(type, redirect);
}
final MessageConsole console = consoleSupplier.get();
boolean silent = redirect == OutputRedirection.SUPPRESS;
if (!silent) {
console.activate();
}
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
final MessageConsoleStream stream = console.newMessageStream();
getDisplay().asyncExec(() -> {
stream.setColor(toColor(type));
showConsoleView(silent);
});
return stream;
}
示例2: AndroidConsole
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
public AndroidConsole() {
console = new MessageConsole("Android", null);
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
out = console.newMessageStream();
err = console.newMessageStream();
// set the colors
final Display display = Display.getDefault();
display.syncExec(new Runnable() {
@Override
public void run() {
out.setColor(display.getSystemColor(SWT.COLOR_BLACK));
err.setColor(display.getSystemColor(SWT.COLOR_RED));
}
});
}
示例3: run
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
/**
* Runs the compiler on the selected files using the given processor
*
* @param fileNames
* files that need to be type-checked
* @param processors
* Type processors to run
* @param classpath
* The classpath to reference in compilation
*/
public void run()
{
Iterable<String> opts;
opts = getOptions(processors, classpath);
// The following code uses the compiler's internal APIs, which are
// volatile. (see warning in JavacTool source)
JavacTool tool = JavacTool.create();
JavacFileManager manager = tool.getStandardFileManager(collector, null, null);
Iterable<? extends JavaFileObject> fileObjs = manager.getJavaFileObjectsFromStrings(fileNames);
CheckerPlugin.getDefault();
MessageConsole console = CheckerPlugin.findConsole();
MessageConsoleStream stream = console.newMessageStream();
Writer writer = new OutputStreamWriter(stream);
JavacTask task = tool.getTask(writer, manager, collector, opts, null, fileObjs);
task.call();
manager.close();
}
示例4: ConsoleContext
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
public ConsoleContext ( final MessageConsole messageConsole )
{
this.writerStream = messageConsole.newMessageStream ();
final MessageConsoleStream errorStream = messageConsole.newMessageStream ();
errorStream.setColor ( Display.getDefault ().getSystemColor ( SWT.COLOR_RED ) );
this.errorPrintWriter = new PrintWriter ( new OutputStreamWriter ( errorStream ) );
this.logStream = messageConsole.newMessageStream ();
this.logStream.setColor ( Display.getDefault ().getSystemColor ( SWT.COLOR_GRAY ) );
}
示例5: createConsoles
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
private void createConsoles() {
ConsolePlugin consolePlugin = ConsolePlugin.getDefault();
IConsoleManager consoleManager = consolePlugin.getConsoleManager();
stdoutConsole = new MessageConsole("Stdout", ImageDescriptor.createFromFile(getClass(), "/consoles/stdout.gif"));
stdoutConsole.setTabWidth(TAB_WIDTH);
stdoutConsoleStream = stdoutConsole.newMessageStream();
stderrConsoleStream = stdoutConsole.newMessageStream();
stderrConsoleStream.setColor(stderrConsoleStreamColor);
engineConsole = new MessageConsole("Engine", ImageDescriptor.createFromFile(getClass(), "/consoles/engine.gif"));
engineConsole.setTabWidth(TAB_WIDTH);
engineConsoleStream = engineConsole.newMessageStream();
consoleManager.addConsoles(new IConsole[] {
engineConsole,
stdoutConsole
});
consolePipes = new ConsolePipes();
debugConsoleStream = new MessageConsoleStream(engineConsole) {
@Override
public void write(String str) throws IOException {
if (str.endsWith("\n")) {
str = str.substring(0, str.length() - 1);
}
Engine.logStudio.info("[debug] " + str);
}
};
}
示例6: initConsoleStream
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
/**
* Find console using name if exist or create new.
*
* @param name the console name
* @return console
*/
private void initConsoleStream() {
MessageConsole messageConsole = getMessageConsole();
messageConsole.clearConsole();
messageConsoleStream=messageConsole.newMessageStream();
logger.debug("Created message console stream");
messageConsoleStream.getConsole().addPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
((ConsoleView)event.getSource()).setScrollLock(true);
}
});
}
示例7: RunJasonFileEditor
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
public RunJasonFileEditor() {
super();
MessageConsole console = findConsole("Console");
MessageConsoleStream out = console.newMessageStream();
System.setOut(new PrintStream(out));
System.setErr(new PrintStream(out));
}
示例8: RunJasonApplication
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
public RunJasonApplication() {
super();
MessageConsole console = findConsole("Console");
MessageConsoleStream out = console.newMessageStream();
System.setOut(new PrintStream(out));
System.setErr(new PrintStream(out));
}
示例9: RunJasonFile
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
public RunJasonFile() {
super();
MessageConsole console = findConsole("Console");
MessageConsoleStream out = console.newMessageStream();
System.setOut(new PrintStream(out));
System.setErr(new PrintStream(out));
}
示例10: get
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
@Override
public CommandConsole get(String name, String title) throws IOException {
MessageConsole console = findConsole(name);
MessageConsoleStream stream = console.newMessageStream();
stream.setActivateOnWrite(true);
stream.write("*** " + title + " ***\n");
return new CommandConsoleImpl(console);
}
示例11: createInitialLayout
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
@Override
public void createInitialLayout(IPageLayout layout) {
layout.setEditorAreaVisible(false);
layout.setFixed(true);
MessageConsole myConsole = new MessageConsole("Console", null);
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { myConsole });
MessageConsoleStream stream = myConsole.newMessageStream();
PrintStream myS = new PrintStream(stream);
System.setOut(myS); // link standard output stream to the console
System.setErr(myS); // link error output stream to the console
}
示例12: showConsole
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
public static void showConsole(String consoleName, String content) throws IOException, PartInitException{
IWorkbenchPage page = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
MessageConsole console = ConsoleHelper
.findConsole(consoleName);
MessageConsoleStream out = console.newMessageStream();
out.println(content);
out.setActivateOnWrite(true);
out.setColor(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
out.close();
IConsoleView view = (IConsoleView) page.showView(IConsoleConstants.ID_CONSOLE_VIEW);
view.display(console);
}
示例13: installJSSConsole
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
/**
* Creates an additional Console for the Console view.
* Once installed, all the messages printed on the System.out and System.err streams
* will be redirected here.
*/
public static void installJSSConsole() {
try {
MessageConsole jssConsole = new MessageConsole(Messages.JaspersoftStudioPlugin_JSSConsoleTitle, null);
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{jssConsole});
MessageConsoleStream consoleStream = jssConsole.newMessageStream();
PrintStream pstream = new PrintStream(consoleStream);
System.setOut(pstream);
System.setErr(pstream);
} catch (SecurityException e) {
// something went wrong while trying to
// re-assign the standard output and error streams.
e.printStackTrace();
}
}
示例14: writeMessage
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
private void writeMessage(String message) {
if (console == null) {
MessageConsole antLRConsole = findConsole("AntLR compiler output");
console = antLRConsole.newMessageStream();
}
try {
console.println(message);
console.flush();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例15: writeMessage
import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
private void writeMessage(String message) {
if (console == null) {
MessageConsole antLRConsole = findConsole("AntLR compiler output");
console = antLRConsole.newMessageStream();
}
try {
console.println(message);
console.flush();
} catch (IOException e) {
//TODO
}
}