Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to use console view in Eclipse RCP Application
How to use console view in Eclipse RCP Application [message #1728541] Tue, 05 April 2016 10:04
xiangheng song is currently offline xiangheng songFriend
Messages: 1
Registered: April 2016
Junior Member
Hi,
I just started using RCP to write Java-based applications. I am trying to add a console view in my app, and output info of log4j to the console. Now it works. But there is a problem, it cannot perform as eclipse witch output once per line, but output all info after the method finish.

	Object[] elements = tableViewer.getCheckedElements();
	if(elements.length > 0){
		for(Object ele : elements){
			File file = (File) ele;
			logger.info("log4j处理目录" + file.getAbsolutePath());
			MessageConsoleStream stream = ConsoleFactory.getConsole().newMessageStream();
			stream.println("println处理目录" + file.getAbsolutePath());
			try {
				stream.flush();
				stream.close();
			} catch (IOException e1) {
				e1.printStackTrace();
			}
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

I tried use stream.println() stream.flush(), but it does not work.
It is my first time questing on eclipse forum. Sorry for my english.
Previous Topic:Need help with Eclipse 4.5
Next Topic:Install update (p2): Could not locate the running profile instance.
Goto Forum:
  


Current Time: Thu Oct 01 22:23:58 GMT 2020

Powered by FUDForum. Page generated in 0.01338 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top