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


Java MessageConsole.newMessageStream方法代码示例

本文整理汇总了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;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:19,代码来源:ConsoleOutputStreamProvider.java

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

示例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();
}
 
开发者ID:reprogrammer,项目名称:checker-framework,代码行数:35,代码来源:JavacRunner.java

示例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 ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:12,代码来源:ConsoleContext.java

示例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);
		}
		
	};
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:34,代码来源:ConvertigoPlugin.java

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

示例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));
}
 
开发者ID:jason-lang,项目名称:jason-eclipse-plugin,代码行数:10,代码来源:RunJasonFileEditor.java

示例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));
}
 
开发者ID:jason-lang,项目名称:jason-eclipse-plugin,代码行数:10,代码来源:RunJasonApplication.java

示例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));
}
 
开发者ID:jason-lang,项目名称:jason-eclipse-plugin,代码行数:10,代码来源:RunJasonFile.java

示例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);
}
 
开发者ID:bazelbuild,项目名称:eclipse,代码行数:9,代码来源:CommandConsoleFactoryImpl.java

示例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
}
 
开发者ID:NineWorlds,项目名称:xstreamer,代码行数:15,代码来源:Perspective.java

示例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);
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:15,代码来源:ViewHelper.java

示例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();
	}	
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:JaspersoftStudioPlugin.java

示例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();
	}
}
 
开发者ID:asupdev,项目名称:asup,代码行数:16,代码来源:EditAntLR.java

示例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
	}
}
 
开发者ID:asupdev,项目名称:asup,代码行数:15,代码来源:CompileAntLR.java


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